<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "400, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 538, 539, 540, 541, 572, 573, 799, 865, 867, 869, 912, 913, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 1179" 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 PRODTYPE 'This page brings up prodtypes for editing, or 'produces a blank prodtype form for adding new 'ones. '----------------------------------------------- '----------------------------------------------- 'FUNCTION 'Recursive function to write out the categories 'and sub-categories in a trail '----------------------------------------------- Function DoCats(objCategoriesDictionary, objSubCategoriesDictionary, numMotherID, strTrail) 'Ignore it if the category is the current category - we don't want them to put a category 'inside itself, or inside one of it's children! If numMotherID & "" <> PT_ID & "" then 'Write out the trail response.write "" & vbcrlf '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 numSubCategory in arySubCategories If isnumeric(numSubCategory) 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, numSubCategory, strTrailToPass end if Next end if end if end Function '----------------------------------------------- 'COLLECT VALUES FROM FORM '----------------------------------------------- PT_ID = Request.Querystring("PT_ID") %> <% =GetString("Config_headtitle") %>
<% '----------------------------------------------- 'RUN DATABASE QUERY '----------------------------------------------- strQuery = "SELECT * FROM tblCactuShopProdtype WHERE PT_ID = " & PT_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. '----------------------------------------------- 'Need to run the HTMLencode function on some of 'the variables to escape speechmarks that may 'appear in text fields. If these aren't dealt 'with like this then the text box text could be 'truncated because the browser thinks the opened 'speechmarks have been closed. '----------------------------------------------- 'Hold the names and descriptions in arrays the 'size of the total languages '----------------------------------------------- Dim PT_Name(), PT_Desc() Redim PT_Name(numTotalLanguages) Redim PT_Desc(numTotalLanguages) If numRecordCount > 0 Then PT_ID = objRecordSet("PT_ID") PT_Live = objRecordSet("PT_Live") PT_MotherProdType = objRecordSet("PT_MotherProdType") PT_ProductDisplayType = objRecordSet("PT_ProductDisplayType") PT_OrderByValue = objRecordSet("PT_OrderByValue") PT_OrderProductsBy = objRecordSet("PT_OrderProductsBy") PT_ProdTypeDisplayType = objRecordSet("PT_ProdTypeDisplayType") 'Loop through all languages and get the names and descriptions numCounter = 0 For numCounter = 1 to numTotalLanguages If aryLangLiveBack(numCounter) = "y" then PT_Name(numCounter) = SafeHTMLencode(objRecordSet("PT_Name" & CStr(numCounter))) PT_Desc(numCounter) = SafeHTMLencode(objRecordSet("PT_Desc" & CStr(numCounter))) If PT_Name(numCounter) <> "" then strFirstNonEmptyName = PT_Name(numCounter) end if end if Next If PT_Name(numDefaultLanguage) <> "" then strFirstNonEmptyName = PT_Name(numDefaultLanguage) Else PT_ID = 0 PT_MotherProdType = Request.QueryString("PT_MotherProdType") numCounter = 0 'Set the product name in the default language to 'new' For numCounter = 1 to numTotalLanguages If aryLangLiveBack(numCounter) = "y" then If numCounter = numDefaultLanguage then PT_Name(numCounter) = GetString("ContentText_New") end if next 'Set the page title to 'new' strFirstNonEmptyName = GetString("ContentText_New") End If objRecordSet.Close %>
"> <% numCounter = 0 For numCounter = 1 to numTotalLanguages If aryLangLiveBack(numCounter) = "y" then if numTotalLanguages > 1 then if numCounter = 1 then %> <% end if %> <% end if %> <% if numTotalLanguages > 1 then %> <% end if %> <% end if next %>
<% Response.Write(strFirstNonEmptyName & " ") %> <% WriteString("PageTitle_ProdtypePage") %>
<% WriteString("FormLabel_ShowOnSite") %> checked="true" <% End If%>type="checkbox" name="PT_Live" value="y">
<% WriteString("FormLabel_ProductDisplayType") %>
<% WriteString("FormLabel_SubCatDisplayType") %>
<% WriteString("ContentText_CategoryParent") %>

<% =aryLangBackNames(numCounter) %>
<% WriteString("FormLabel_CategoryName") %>
<% WriteString("FormLabel_CategoryDescription") %>

<% WriteString("FormLabel_OrderByValue") %>
<% WriteString("FormLabel_OrderProductsBy") %>
<% WriteString("ContentText_NormalImage") %>
<% '----------------------------------------- 'FIND AND SHOW EXISTING IMAGE (IF ANY) '----------------------------------------- If Not CallMode = "new" Then Set FSO = Server.CreateObject("Scripting.FileSystemObject") strFileName = GetFileLocation(Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_categories/"), PT_ID, Split(Application(LICENSENUMBER & "allowedimages"), ","), FSO) If strFileName = "" Then strFileStatus = GetString("ContentText_NoImagePresent") Else strFileStatus = "
" End If End If '----------------------------------------- 'HANDLE LOGO DISPLAY AND UPLOADER BOX '----------------------------------------- Response.Write(strFileStatus) %>
<% If Not PT_ID = 0 And Not strFileName = "" Then %> <% WriteString("ContentText_TickHereToRemoveImage") %> <% End If %>

<% WriteString("ContentText_LargeImage") %>
<% '----------------------------------------- 'FIND AND SHOW EXISTING IMAGE (IF ANY) '----------------------------------------- If Not CallMode = "new" Then strFileName = GetFileLocation(Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_categories_large/"), PT_ID, Split(Application(LICENSENUMBER & "allowedimages"), ","), FSO) If strFileName = "" Then strFileStatus = GetString("ContentText_NoImagePresent") Else strFileStatus = "
" End If End If '----------------------------------------- 'HANDLE LOGO DISPLAY AND UPLOADER BOX '----------------------------------------- Response.Write(strFileStatus) %>
<% If Not PT_ID = 0 And Not strFileName = "" Then %> <% WriteString("ContentText_TickHereToRemoveImage") %> <% End If %>
  <% WriteString("FormButton_Add") %> <% Else %> <% WriteString("FormButton_Update") %> <% End If %>">
<% '----------------------------------------------- 'If a prodtype is being edited then we need to 'show the delete option. '----------------------------------------------- If numRecordCount > 0 Then %>
<% WriteString("ContentText_DeleteOptionOne") %>
"> <% WriteString("ContentText_DeleteOptionOneText") %>
<% WriteString("ContentText_DeleteOptionTwo") %>
"> <% WriteString("ContentText_DeleteOptionTwoText") %>
<% End If %>
<% objDataConn.Close Set objDataConn = Nothing %>