<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "326, 327, 328, 415, 416, 418, 419, 420, 421, 835, 901, 914, 915, 984" 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. '=============================================== '----------------------------------------------- 'PRODTYPE BACK 'Displays a listing of all the products and 'their versions, and all sub-categories '----------------------------------------------- numProdtypeID = request.querystring("PT_ID") If numProdtypeID = "" then numProdtypeID = 0 strQuery = "SELECT * FROM tblCactuShopProdtype WHERE PT_ID = " & numProdtypeID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) numRecordCount = objRecordSet.Recordcount If numRecordCount>0 then strProdtypeName = objRecordSet("PT_Name" & CStr(numLanguageID)) PT_OrderProductsBy = objRecordSet("PT_OrderProductsBy") If strProdtypeName & "" = "" then numCounter = 0 for numCounter = 1 to numTotalLanguages strProdtypeName = objRecordSet("PT_Name" & CStr(numCounter)) If strProdtypeName & "" <> "" then exit for next end if else strProdtypeName = "New Page" end if objRecordSet.close %> <% =GetString("Config_headtitle") %>
<% '----------------------------------------------- 'SHOW ANY SUB CATEGORIES 'As the prodtypes are recursive, any 'prodtype and have sub prod-types, and 'the option to add them '----------------------------------------------- %> <% strQuery = "SELECT * FROM tblCactuShopProdtype WHERE PT_MotherProdType=" & numProdtypeID & " ORDER BY " & strCategoryOrderBy 'This is set in the back_menu.asp file Call ExecuteSQL(strQuery, numCursorType, objRecordSet) if objRecordSet.bof and objRecordSet.eof then %> <% else %> <% end if objRecordSet.Close '----------------------------------------------- 'SHOW PRODUCTS AND VERSIONS 'Now show all the products and versions in the 'category '----------------------------------------------- %> <% if numRecordCount > 0 then strProductsOrderBy = Application(LICENSENUMBER & "orderby_products") If PT_OrderProductsBy <> "" then strProductsOrderBy = PT_OrderProductsBy if strProductsOrderBy = "" then strProductsOrderBy = "P_Name" 'If the orderby is a 'languaged'-field, then stick on the numerical language ID If strProductsOrderBy = "P_Name" or strProductsOrderBy = "P_Desc" or strProductsOrderBy = "P_StrapLine" or strProductsOrderBy = "P_SpecTable" or strProductsOrderBy = "P_Hyperlink" then strProductsOrderBy = strProductsOrderBy & CStr(numLanguageID) end if strQuery = "SELECT * FROM (tblCactuShopProducts INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE PT_ID = " & numProdtypeID & " ORDER BY " & strProductsOrderBy Call ExecuteSQL(strQuery, numCursorType, objRecordSet) if objRecordSet.BOF and objRecordSet.EOF then %><% else do while not objRecordSet.EOF P_OrderVersionsBy = objRecordSet("P_OrderVersionsBy") strProductName = objRecordSet("P_Name" & CStr(numLanguageID)) If strProductName & "" = "" then numCounter = 0 for numCounter = 1 to numTotalLanguages strProductName = objRecordSet("P_Name" & CStr(numCounter)) If strProductName & "" <> "" then exit for next end if If objRecordSet("P_Live") <> "y" then strLiveIndicator = "" strLiveIndicator2 = "" else strLiveIndicator = "" strLiveIndicator2 = "" end if %> <% objRecordSet.moveNext loop %> <% end if 'close all objects objRecordSet.Close objDataConn.Close set objDataConn = nothing end if %>
<% =strProdtypeName %>
<% WriteString("ContentText_AddNewSubcategory") %> <% WriteSafeString(" title="<% WriteSafeString("ContentText_AddNewSubcategory") %>" src="images_webshop/b_category.gif" border="0"> <% WriteString("ContentText_AddNewProduct") %> <% WriteSafeString(" title="<% WriteSafeString("ContentText_AddNewProduct") %>" src="images_webshop/b_product.gif" border="0"> <% WriteString("ContentText_ModifyThePage") %> <% WriteSafeString(" title="<% WriteSafeString("ContentText_ModifyThePage") %>" src="images_webshop/b_category.gif" border="0">

<% WriteString("ContentText_SubCategories") %>
<% WriteString("ContentText_NoSubCategories") %>
<% numBackgroundCounter = 0 do while not objRecordSet.EOF strProdtypeName = objRecordSet("PT_Name" & CStr(numLanguageID)) numBackgroundCounter = numBackgroundCounter + 1 If numBackgroundCounter / 2 = Int(numBackgroundCounter / 2) then strBgColour="#DDDDDD" else strBgColour="#EEEEEE" end if If strProdtypeName & "" = "" then 'loop around all languages till we find a non-blank numCounter = 0 For numCounter = 1 to numTotalLanguages if objRecordSet("PT_Name" & CStr(numCounter)) & "" <> "" then strProdtypeName = objRecordSet("PT_Name" & CStr(numCounter)) exit for end if Next end if %> <% objRecordSet.moveNext loop %>
<% =strProdtypeName %> "><% WriteSafeString(" title="<% WriteSafeString("ImageLabel_EditThisProduct") %>" src="images_webshop/b_category.gif" border="0">


<% WriteString("ContentText_Products") %>
<% WriteString("ContentText_NoProducts") %>

<% =strLiveIndicator & strProductName & strLiveIndicator2 %> &strParentName=<% =Server.URLEncode(Replace(strProductName, "'", "xxxAPOSTROPHExxx")) %>','_blank','scrollbars=yes,width=350,height=400')"><% WriteSafeString(" title="<% WriteSafeString("ContentText_RelatedProducts") %>" src="images_webshop/b_related.gif" border="0"> &PT_ID=<% =objRecordSet("PT_ID") %>"><% WriteSafeString(" title="<% WriteSafeString("ImageLabel_EditThisProduct") %>" src="images_webshop/b_product.gif" border="0">
<% WriteString("ContentText_AddAVersionOfProduct") %> &PT_ID=<% =objRecordSet("PPT_ProdTypeID") %>"><% WriteSafeString(" title="<% WriteSafeString("ContentText_AddAVersionOfProduct") %>" src="images_webshop/b_version.gif" border="0">
<% '----------------------------------------------- 'THIS NESTED QUERY DRAWS VERSION TABLE '----------------------------------------------- strVersionsOrderBy = Application(LICENSENUMBER & "orderby_versions") If P_OrderVersionsBy <> "" then strVersionsOrderBy = P_OrderVersionsBy If strVersionsOrderBy = "" then strVersionsOrderBy = "V_Name" if strVersionsOrderBy = "V_Name" or strVersionsOrderBy = "V_Desc" then strVersionsOrderBy = strVersionsOrderBy & CStr(numLanguageID) strQuery2 = "SELECT * FROM (tblCactuShopTaxRates INNER JOIN tblCactuShopVersions ON tblCactuShopTaxRates.T_ID = tblCactuShopVersions.V_Tax) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID WHERE P_ID=" & objRecordSet("P_ID") & " ORDER BY " & strVersionsOrderBy Call ExecuteSQL(strQuery2, numCursorType, objRecordSet2) numBackgroundCounter = 0 do while not objRecordSet2.EOF numBackgroundCounter = numBackgroundCounter + 1 numPrice = Round(objRecordSet2("V_Price"),2) numTax = objRecordSet2("T_Taxrate") If numBackgroundCounter / 2 = Int(numBackgroundCounter / 2) then strBgColour = "#EEEEEE" strBgColour2 = "#FFAAAA" else strBgColour = "#DDDDDD" strBgColour2 = "#FFBBBB" end if strVersionName = objRecordSet2("V_Name" & CStr(numLanguageID)) If strVersionName & "" = "" then numCounter = 0 for numCounter = 1 to numTotalLanguages strVersionName = objRecordSet2("V_Name" & CStr(numCounter)) If strVersionName & "" <> "" then exit for next end if If objRecordSet2("V_Quantity") <= 0 AND objRecordSet2("V_QuantityWarnLevel") <> 0 then strBgColour = strBgColour2 If objRecordSet2("V_Live") <> "y" then strLiveIndicator = "" strLiveIndicator2 = "" else strLiveIndicator = "" strLiveIndicator2 = "" end if %> <% objRecordSet2.moveNext loop objRecordSet2.Close '----------------------------------------------- 'END OF NESTED QUERY '----------------------------------------------- %>
<% =strLiveIndicator & strVersionName & strLiveIndicator2 %> <% =objRecordSet2("V_CodeNumber") %> <% =objRecordSet2("V_Quantity") %> (<% =objRecordSet2("V_QuantityWarnLevel") %>) <% =CurrencyDisplay(numPrice, 1, blnDefaultCurrencyHasDecimals) %> <% =" " & numTax %> &P_ID=<% =objRecordSet2("P_ID") %>&PT_ID=<% =numProdtypeID %>&strCallMode=c"><% WriteSafeString(" title="<% WriteSafeString("ImageLabel_CloneThisVersion") %>" src="images_webshop/c_version.gif" border="0"> &P_ID=<% =objRecordSet2("P_ID") %>&PT_ID=<% =numProdtypeID %>"><% WriteSafeString(" title="<% WriteSafeString("ImageLabel_EditThisVersion") %>" src="images_webshop/b_version.gif" border="0">

<% WriteString("ContentText_ProductPagetext") %>