<% =SYS(3101,1256) olddate=SET("Date") oldmark=SET("Mark") ajaxresponse=CREATEOBJECT('empty') oJSON=NEWOBJECT('json','json.prg') thepassword=orequest.form('txtpassword') IF NOT ALLTRIM(thepassword)==ALLTRIM(onlinepassword) RETURN '{"terror":"Password not correct","message":"password not correct"}' endif fref=ALLTRIM(TRANSFORM(NVL(orequest.form('fref'),''))) rserial=ALLTRIM(TRANSFORM(NVL(orequest.form('serial'),''))) rref=orequest.form('txtrecord') theaction=orequest.form('taction') if theaction<>'delete' RETURN '{"terror":"","message":"You want to '+theaction+'"}' endif usesafe('details') usesafe('fileref') usesafe('category') select 'details' go val(transform(rref)) *locate for val(srno)=val(rserial) and allt(reffid)==fref if eof() or val(srno)<>val(rserial) or allt(reffid)<>fref RETURN '{"terror":"record not found!","message":"Record may have already been deleted by someone else"}' endif thiscateg=category thisreffid=reffid delete next 1 select 'category' locate for allt(reffid)==fref and allt(category)==allt(thiscateg) if not eof() replace qty with qty-1 if qty=0 delete next 1 endif endif RETURN '{"terror":"","message":"Record deleted successfully"}' %>