%
logedin=.t.
crlf=chr(13)+chr(10)
thekot=orequest.form('kot')
if isnull(thekot)
thekot=orequest.querystring('kot')
endif
hotelelements=[]
imagepath=addbs(oprop.appstartpath)+[images\]
IF isnull(thekot) or EMPTY(thekot)
thekot=[AUTO]
txtKOTID=thekot
lkpSaleman=[140000]
txtTBLID=[]
tsql=[select almara,CNT(almara) from (']+dbclocation+[itemmast') group by almara where packing='HOTEL MENU' order by almara into cursor menus]
&tsql
tsql=[SELECT itemid, name, sale, almara,extra FROM (']+dbclocation+[itemmast') where packing='HOTEL MENU' order by almara INTO CURSOR menuitems]
&tsql
thealmara=[Miscellaneous]
scan
menuhead=[]
if not allt(almara)==thealmara
thealmara=allt(almara)
select [menus]
locate for allt(almara)==thealmara
midcol=[
]
if file(imagepath+thealmara+'.png')
imgsource=[]
else
imgsource=iif(empty(almara),'Miscellaneous',allt(almara))
endif
midcol=midcol+imgsource+[
]+chr(13)+chr(10)
hotelelements=hotelelements+menuitem
endscan
ELSE
thekot=allt(transform(thekot))
tsql=[SELECT * FROM (']+dbclocation+[kot') WHERE allt(kotid)==']+thekot+[' INTO CURSOR otcsdata READWRITE]
&tsql
txtKOTID=kotid
lkpSaleman=Saleman
txtTBLID=opt
ENDIF
tsql=[SELECT * FROM (']+dbclocation+[accounts') ORDER BY name INTO CURSOR salemen where left(accountid,2)='14']
&tsql
selectopts=[]
do while not eof()
selectopts=selectopts+[]+crlf
skip
enddo
*select [otcsdata]
%>
SSSoft™Transfer