<%
'-----------------------------------------------
'SHOW ANY SUB CATEGORIES
'As the prodtypes are recursive, any
'prodtype and have sub prod-types, and
'the option to add them
'-----------------------------------------------
%>
<% WriteString("ContentText_SubCategories") %>
<%
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 %>
<% WriteString("ContentText_NoSubCategories") %>
<% else %>
<% 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
%>
<%
end if
objRecordSet.Close
'-----------------------------------------------
'SHOW PRODUCTS AND VERSIONS
'Now show all the products and versions in the
'category
'-----------------------------------------------
%>
<% WriteString("ContentText_Products") %>
<%
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
%>
<% WriteString("ContentText_NoProducts") %>
<%
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
%>
<%
'-----------------------------------------------
'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
%>