if ! empty(m.gcExportPath)

* * * * hlavicka souboru
  fh = fcreate(m.gcexportpath + "cenik" + m.lckasa + ".htm")
  = fputs(m.fh, '<HTML>' )
  = fputs(m.fh, '<HEAD>' )
  = fputs(m.fh, '<TITLE> Ceník pokladny ' + man_nazev + "           " + dtoc(date()) + '</TITLE>' )
  = fputs(m.fh, '<meta http-equiv="content-type" content="text/html; charset=windows-1250" />' )
  = fputs(m.fh, '<meta http-equiv="content-language" content="cs" />' )
  = fputs(m.fh, '</HEAD>' )

  = fputs(m.fh, '<BODY bgcolor="#ffffff"  text="#000000"  link="#FF0000"  vlink="#CCCC99"  alink="#0000FF" >' )
  = fputs(m.fh, '<CENTER><TABLE>' )

SELECT cenik
go top
o_druh = "*&^%$"
scan
  prdelku = .f.
  if druh_kalk # m.o_druh
    o_druh = druh_kalk
    = fputs(m.fh, '</TABLE></CENTER>' )
    = fputs(m.fh, '<BR><BR>')
    = fputs(m.fh, '<CENTER><FONT size="4" face="Comic Sans MS, Arial"><B>' + druh_kalk + '</B></FONT></CENTER>')
    = fputs(m.fh, '<CENTER><TABLE width="700" border="1" cellspacing="2" cellpadding="0">' )
    = fputs(m.fh, '<TR><TD align=center><b> Nazev </b></TD>')
    = fputs(m.fh, '<TD align=center><b>Kod</b></TD>')
    = fputs(m.fh, '<TD align=center><b>Cena1</b></TD>')
    = fputs(m.fh, '<TD align=center><b>Cena2</b></TD>')
    = fputs(m.fh, '<TD align=center><b>Cena3</b></TD>')
    = fputs(m.fh, '<TD align=center><b>Cena4</b></TD>')
    = fputs(m.fh, '<TD align=center><b>Cena5</b></TD>')
    = fputs(m.fh, '</TR>')
  endif

  = fputs(m.fh, '<TR>')
  = fputs(m.fh, '<TD align=left >' + nazev + '</TD>')
  = fputs(m.fh, '<TD align=right >' + kod + '</TD>')
  = fputs(m.fh, '<TD align=right >' + iif(cena1=0, "-", str(cena1,8,1)) + '</TD>')
  = fputs(m.fh, '<TD align=right >' + iif(cena2=0, "-", str(cena2,8,1)) + '</TD>')
  = fputs(m.fh, '<TD align=right >' + iif(cena3=0, "-", str(cena3,8,1)) + '</TD>')
  = fputs(m.fh, '<TD align=right >' + iif(cena4=0, "-", str(cena4,8,1)) + '</TD>')
  = fputs(m.fh, '<TD align=right >' + iif(cena5=0, "-", str(cena5,8,1)) + '</TD>')
  = fputs(m.fh, '</TR>')

endscan


* * * * paticka souboru
  = fputs(m.fh, '</BODY>' )
  = fputs(m.fh, '</HTML>' )

  = fclose(m.fh)

endif