[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] Bell-Haun - PDF Admin

P D F   D O W N L O A D   A D M I N


[search db=../dbs/sectioncategory.db&eqsectioniddatarq=[sectionid]&assortsort=1&sorttype=num&ascategorynameort=2] [hideif [numfound]=0] [/hideif] [founditems] [/founditems]
These are the previously entered categories
and the corresponding sort orders for
[lookup db=../dbs/section.db&lookinfield=sectionid&value=[sectionid]&returnfield=sectionname]:
DeleteCategorySort

Enter New categories
and the corresponding sort orders for
[lookup db=../dbs/section.db&lookinfield=sectionid&value=[sectionid]&returnfield=sectionname] below:
 CategorySort
 
 
 
[/search]
[/case] [case value=Assign PDFs] Bell-Haun - PDF Admin

P D F D O W N L O A D   A D M I N


[text]thepdfs=thedelimiter[/text] [search db=../dbs/sectioncategorypdf.db&eqsectioncategoryiddatarq=[sectioncategoryid]&assortsort=1&sorttype=num] [if ("[numfound]"="0")] [else] [/else] [/if] [/search] [text]atleastone=no[/text] [if ("[atleastone]"="no")] [then] [/then] [/if]
The following [numfound] PDFs have already been assigned to [lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=categoryname] under [lookup db=../dbs/section.db&lookinfield=sectionid&value=[lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=sectionid]&returnfield=sectionname]:
The following PDFs are still available for assigning to [lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=categoryname] under [lookup db=../dbs/section.db&lookinfield=sectionid&value=[lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=sectionid]&returnfield=sectionname]:
[lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=categoryname] under [lookup db=../dbs/section.db&lookinfield=sectionid&value=[lookup db=../dbs/sectioncategory.db&lookinfield=sectioncategoryid&value=[sectioncategoryid]&returnfield=sectionid]&returnfield=sectionname] already has all the PDFs assigned to it.

[/case] [case value=PDFTitle]
[search db=../dbs/sectioncategorypdf.db&nesectioncategorypdfiddatarq=find_all_the_pdfs&eqsectioncategoryiddatarq=[sectioncategoryid]&assortsort=1&sorttype=num] [founditems] [/founditems] [/search]
PDFTitleSort
[pdffilename]
[/case] [default] Bell-Haun - PDF Admin [text multi=T]theformname=twoSelectsForm&firstfieldname=sectionid&secondfieldname=sectioncategoryid[/text]

P D F D O W N L O A D   A D M I N
Sections:

Categories:

PDFs:

Upload New PDF:

[/default] [/switch]
[include ^pagecounter.tpl]