%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "326, 327, 361, 400, 421, 517, 518, 524, 525, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 549, 865, 866, 868, 1149, 1150, 1151, 1152, 1153, 1246" strThisBackPage = "products" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== '----------------------------------------------- 'MODIFY PRODUCT 'This page brings up products for editing, or 'produces a blank product form for adding new 'products. '----------------------------------------------- '----------------------------------------------- 'FUNCTION: BUILD UP PRODTYPE MULTISELECTOR '----------------------------------------------- Function DoCats(objCategoriesDictionary, objSubCategoriesDictionary, numMotherID, strTrail) 'Write out the trail response.write("") 'If there are any sub categories for this category If objSubCategoriesDictionary.Exists(CInt(numMotherID)) then 'Get all sub categories and loop through them arySubCategories = split(objSubCategoriesDictionary.Item(CInt(numMotherID)), ",") For each intSubCategory in arySubCategories If isnumeric(intSubCategory) then 'Add the sub category to the end of the trail and call the function with the new sub-cat strTrailToPass = " " & strTrail DoCats objCategoriesDictionary, objSubCategoriesDictionary, intSubCategory, strTrailToPass end if Next end if end Function '----------------------------------------------- 'COLLECT VALUES FROM QUERYSTRING '----------------------------------------------- P_ID = Request.Querystring("P_ID") PT_ID = Request.Querystring("PT_ID") numOriginalProdType = PT_ID Dim P_Name(), P_Desc(), P_StrapLine(), P_SpecTable(), P_Hyperlink() Redim P_Name(numTotalLanguages) Redim P_Desc(numTotalLanguages) Redim P_StrapLine(numTotalLanguages) Redim P_SpecTable(numTotalLanguages) Redim P_Hyperlink(numTotalLanguages) '----------------------------------------------- 'RUN DATABASE QUERY '----------------------------------------------- strQuery = "SELECT * FROM tblCactuShopProducts WHERE P_ID = " & P_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) numRecordCount = objRecordSet.RecordCount '----------------------------------------------- 'If a product has been pulled out of the DB then 'set these variables to the field info that was 'pulled out, otherwise this is a new product and 'the variables will be left blank. '----------------------------------------------- If numRecordCount > 0 Then P_ID = objRecordSet("P_ID") P_Live = objRecordSet("P_Live") P_Featured = objRecordSet("P_Featured") P_OrderByValue = objRecordSet("P_OrderByValue") P_OrderVersionsBy = objRecordSet("P_OrderVersionsBy") P_VersionDisplayType = objRecordSet("P_VersionDisplayType") strFirstNonEmptyName = objRecordSet("P_Name" & numLanguageID) & "" 'Loop through all languages and get the names and descriptions For numCounter = 1 to numTotalLanguages If aryLangLiveBack(numCounter) = "y" then P_Name(numCounter) = SafeHTMLencode(objRecordSet("P_Name" & CStr(numCounter))) P_Desc(numCounter) = SafeHTMLencode(objRecordSet("P_Desc" & CStr(numCounter))) P_StrapLine(numCounter) = SafeHTMLencode(objRecordSet("P_StrapLine" & CStr(numCounter))) P_SpecTable(numCounter) = SafeHTMLencode(objRecordSet("P_SpecTable" & CStr(numCounter))) P_Hyperlink(numCounter) = SafeHTMLencode(objRecordSet("P_Hyperlink" & CStr(numCounter))) If P_Name(numCounter) <> "" and strFirstNonEmptyName = "" then strFirstNonEmptyName = P_Name(numCounter) end if end if Next Else P_ID = 0 End If objRecordSet.Close '----------------------------------------------- 'SET CATEGORY WE CLICK-THROUGH FROM AS ON '----------------------------------------------- dim strSelectedCategories If P_ID = 0 Then strSelectedCategories = "z" & PT_ID & "z" %>
|
<% '----------------------------------------------- 'If a product is being edited then we need to 'show the delete option and the table of 'versions. '----------------------------------------------- If numRecordCount > 0 Then %> |