[math show=F]varcounter=0[/math] [text]allthevars=0A0A0A0A0A0A0A0A0A0A[/text] [formvariables] [showif [name]^Content-Disposition] [hideif [middle startafter=[url]name="[/url]&endbefore=[url]"#[/url]][name]#[/middle]~imagefile] [hideif [middle startafter=[url]name="[/url]&endbefore=[url]"#[/url]][name]#[/middle]=template] [math show=F]varcounter=varcounter+1[/math] [text]allthevars=[allthevars][middle startafter=[url]name="[/url]&endbefore=[url]"#[/url]][name]#[/middle][varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[varcounter]A[/text] [text][middle startafter=[url]name="[/url]&endbefore=[url]"#[/url]][name]#[/middle]=[value][/text] [/hideif] [/hideif] [/showif] [/formvariables] [switch value=[whatToDo]] [case value=updatecategory] [formvariables name=deletecategory] [delete db=../dbs/sectioncategory.db&eqsectioncategoryiddatarq=[value]] [delete db=../dbs/sectioncategorypdf.db&eqsectioncategoryiddatarq=[value]] [/formvariables] [formvariables name=old&exact=F] [replace db=../dbs/sectioncategory.db&eqsectioncategoryiddatarq=[getchars start=4][name][/getchars]]categoryname=[value]&sort=[interpret][sort[getchars start=4][name][/getchars]][/interpret][/replace] [/formvariables] [formvariables name=newcat&exact=F] [hideif [countchars][value][/countchars]=0] [append db=../dbs/sectioncategory.db]sectioncategoryid=[cart]A[index]§ionid=[sectionid]§ionname=[lookup db=../dbs/section.db&lookinfield=sectionid&value=[sectionid]&returnfield=sectionname]&categoryname=[value]&sort=[interpret][newsort[getchars start=7][name][/getchars]][/interpret][/append] [/hideif] [/formvariables] [/case] [case value=assignPDF] [formvariables name=deleteid][delete db=../dbs/sectioncategorypdf.db&eqsectioncategorypdfiddatarq=[value]][/formvariables] [formvariables name=pdffilename][append db=../dbs/sectioncategorypdf.db]sectioncategorypdfid=[cart]A[index]&pdffilename=[value]§ioncategoryid=[sectioncategoryid][/append][/formvariables] [/case] [case value=PDFTitle] [formvariables name=title&exact=F] [replace db=../dbs/sectioncategorypdf.db&eqsectioncategorypdfiddatarq=[getchars start=6][name][/getchars]]title=[value]&sort=[interpret][sort[getchars start=6][name][/getchars]][/interpret][/replace] [/formvariables] [/case] [case value=deletePDF] [formvariables name=deletefile] [delete db=../dbs/sectioncategorypdf.db&eqpdffilenamedatarq=[value]] [deletefile file=../pdf/[value]] [/formvariables] [/case] [case value=uploadPDF] [formvariables name=imagefile&exact=F][text show=T]theUploadedName=[middle startafter=[url]filename="[/url]&endbefore=[url]"[/url]][name][/middle][/text][/formvariables] [if ("[theUploadedName]"^"\")][then][listwords words=[theUploadedName]&delimiters=\][text]theFileName=[word][/text][/listwords][text]theUploadedName=[theFileName][/text][/then][/if] [writefile file=../pdf/[theUploadedName]&secure=F][formvariables name=imagefile&exact=F][value][/formvariables][/writefile] [/case] [/switch] [switch value=[whatToShow]] [case value=Add/Edit Categories]