[!]Ali is working in this file[/!]
[protect ADMIN,[lookup db=prefs.db&lookinfield=PREF&value=ADMIN&returnfield=value]]
[showif [raw][__C_OVERRIDE][/raw]=[__C_OVERRIDE]]
[Text]__C_OVERRIDE=N[/Text]
[/showif]
[showif [action]=Add]
[if ("[__C_TYPE]"="O") & ("[__C_CART]"="")]
[then]
You must specify a CART for an 'option' type.
[text]action=NEW[/text]
[text]failed=TRUE[/text]
[/then]
[/if]
[if ("[__C_NAME]"="")]
[then]
You must specify a name.
[text]action=NEW[/text]
[text]failed=TRUE[/text]
[/then]
[/if]
[hideif [failed]=TRUE]
[math show=f]the_ID=[search db=categories.db&neC_IDdatarq=find_all&deC_IDsort=1&C_IDtype=number&max=1][founditems][C_ID][/founditems][/search]+1[/math]
[math show=f]the_Rank=[search db=categories.db&neC_IDdatarq=find_all&deC_RANKsort=1&C_RANKtype=number&max=1][founditems][C_RANK][/founditems][/search]+1[/math]
[append db=categories.db]C_ID=[the_ID]&C_RANK=[the_Rank][formvariables name=__&exact=F]&[getchars start=3][name][/getchars]=[url][value][/url][/formvariables]&C_OVERRIDE=[__C_OVERRIDE][/append]
[commitdatabase db=categories.db]
[/hideif]
[/showif]
[showif [action]=Update]
[if ("[__C_TYPE]"="O") & (""="[__C_CART]")]
[then]
You must specify a CART for this type.
[text]action=edit[/text]
[/then]
[else]
[replace db=categories.db&eqC_IDdatarq=[url][C_ID][/url]] [formvariables name=__&exact=F]&[getchars start=3][name][/getchars]=[url][value][/url][/formvariables]&C_OVERRIDE=[__C_OVERRIDE][/replace]
[commitdatabase db=categories.db]
[replace db=related.db&eqR_CATEGORYdatarq=[url][c_id][/url]]R_CRANK=[url][__C_RANK][/url]&R_CTYPE=[url][__C_TYPE][/url][/replace]
[commitdatabase db=related.db]
[/else]
[/if]
[/showif]
[showif [action]=Delete]
[delete db=categories.db&eqC_IDdatarq=[url][c_id][/url]]
[commitdatabase db=categories.db]
[/showif]
[include body_tag.inc]
[hideif [action]=New]
[hideif [action]=Edit]
[text]page_title=Options[/text]
[text]helpid=options[/text]
[include banner.inc]
| Name | Type | Cart | Override |
| | | Price & SKU |
[search db=categories.db&neC_IDdatarq=find_all&C_RANKtype=number&asC_RANKsort=1][founditems]
| [C_NAME] | [lookup db=types.db&lookinfield=T_ID&value=[C_TYPE]&returnfield=T_NAME] | [C_CART] | [showif [C_OVERRIDE]=Y]Yes[/showif][hideif [C_OVERRIDE]=Y]No[/hideif] |
[/founditems][/search]
|
| New Option |
[/hideif]
[/hideif]
[showif [action]=New]
[text]page_title=Add New Option[/text]
[text]helpid=options_new[/text]
[include banner.inc]
[/showif]
[showif [action]=Edit]
[text]page_title=Edit Option[/text]
[text]helpid=options_edit[/text]
[include banner.inc]
[/showif]