<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "18, 33, 55, 108, 150, 151, 152, 156, 157, 158, 159, 160, 161, 265, 266, 294, 295, 296, 648, 870, 871" %> <% product = Request.Querystring("product") version = Request.Querystring("V") recorprod = request.querystring("recorprod") recor = request.querystring("recor") SearchedID = request.querystring("PT_ID") cat = request.querystring("cat") ParentProd = request.QueryString("pp") PassedKeywords = Request.QueryString("keywords") strShowBackLink = Request.Querystring("strShowBackLink") if not isnull(version) and version <> "" then PassedKeywords = "" PageHistory = request.querystring("ph") SearchFor = request.querystring("SearchFor") keywords = request.querystring("keywords") If SearchedID="" then SearchedID=1 If recorprod="" then recorprod=1 If recor="" then recor=1 If version="" then version=0 If cat="" then cat=0 If Not IsNumeric(product) then response.redirect("../ecommerce/error_occ.asp") If Not IsNumeric(version) then response.redirect("../ecommerce/error_occ.asp") If Not IsNumeric(SearchedID) and SearchedID<>"all" then response.redirect("../ecommerce/error_occ.asp") If Not IsNumeric(cat) then response.redirect("../ecommerce/error_occ.asp") If Not IsNumeric(recor) then response.redirect("../ecommerce/error_occ.asp") If Not IsNumeric(recorprod) then response.redirect("../ecommerce/error_occ.asp") If DBType = "mysql" Then theQuery = "SELECT PT_Live, PT_Name, P_StrapLine, P_Live, P_Name, P_SpecTable, P_Desc, P_Hyperlink FROM tbl_Versions INNER JOIN tbl_Products ON tbl_Versions.V_Product = tbl_Products.P_ID INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE P_ID=" & product & " AND V_Live='y' AND P_Live='y' AND PT_Live='y'" Else theQuery = "SELECT PT_Live, PT_Name, P_StrapLine, P_Live, P_Name, P_SpecTable, P_Desc, P_Hyperlink FROM (tbl_Versions INNER JOIN ((tbl_Products INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID) INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID) ON tbl_Versions.V_Product = tbl_Products.P_ID) INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE P_ID=" & product & " AND V_Live='y' AND P_Live='y' AND PT_Live='y'" End If Call ExecuteSQL(theQuery,cursortype,rs_main) if Application(HASHKEYNUMBERXYZ & "tracking") = "y" then theQuery2 = "INSERT INTO tbl_ProductStats (PS_ProdNo, PS_Date, PS_IP) VALUES (" & _ product & "," & datedelimiter & _ ReverseFormatYear(Now()) & datedelimiter & ",'" & _ Request.ServerVariables("HTTP_HOST") & "')" Call ExecuteSQL(theQuery2,cursortype,rs_main2) End if Call ReadFromTemplate(templatelocation,aryPageTemplate,strBasketHTML,strCategoryListHTML) response.write(aryPageTemplate(0)) If rs_main.recordcount=0 then %>
<% WriteString("ContentText_ProductUnavailable") %>
<% else %>
<% If rs_main("P_StrapLine")<>"" then %> <% end if %> <% theQuery = "SELECT tbl_Products.P_ID, tbl_Products.P_Name FROM tbl_RelatedProducts INNER JOIN tbl_Products ON tbl_RelatedProducts.RP_ChildID = tbl_Products.P_ID WHERE tbl_RelatedProducts.RP_ParentID = " & product & " AND tbl_Products.P_Live = 'y' ORDER BY tbl_Products.P_Name" Call executeSQL(theQuery,cursortype,rs_main2) If rs_main2.RecordCount > 0 Then %> <% End If rs_main2.Close %>
<% If PageHistory = "cat" Then LocationBar = LocationBar & "" & GetString("ContentText_Categories") & " > " ElseIf PageHistory = "basket" Then LocationBar = LocationBar & "" & GetString("ContentText_Basket") & " > " ElseIf PageHistory = "search" Then LocationBar = LocationBar & "" & GetString("ContentText_Search") & " > " LocationBar = LocationBar & "" & GetString("ContentText_SearchResults") & " > " ElseIf PageHistory = "related" Then LocationBar = LocationBar & GetString("ContentText_RelatedProduct") & " > " Else LocationBar = LocationBar & "" & GetString("ContentText_Home") & " > " End If If cat <> "0" and not isnull(cat) and cat <> "" then theQuery = "SELECT PT_Name, PT_MotherProdType FROM tbl_Prodtype WHERE PT_ID = " & cat call executeSQL(theQuery,cursortype,rs_main2) If Not (RS_Main2.BOF And RS_Main2.EOF) Then PT_MotherProdType = RS_Main2("PT_MotherProdType") SectionLink = "" & rs_main2("PT_Name") & " > " & chr(13) RS_Main2.close If Not PT_MotherProdType = "0" Then theQuery = "SELECT PT_Name FROM tbl_Prodtype WHERE PT_ID = " & PT_MotherProdType Call ExecuteSQL(theQuery,cursortype,rs_main2) If Not (RS_Main2.BOF And RS_Main2.EOF) Then LocationBar = LocationBar & "" & RS_Main2("PT_Name") & " > " & chr(13) End If RS_Main2.Close End If LocationBar = LocationBar & SectionLink Else RS_Main2.Close End If End If LocationBar = LocationBar & rs_main("P_Name") response.write "" & rs_main("P_Name") & "
" & LocationBar & "" %>
<% =rs_main("P_StrapLine") %>
<% Set FSO = Server.CreateObject("Scripting.FileSystemObject") arrFileTypes = Split(Application(HASHKEYNUMBERXYZ & "allowedimages"), ",") theProductPath = Server.MapPath("../img_product/") theProductLargePath = Server.MapPath("../img_product_large/") theFile = GetFileLocation(theProductPath, Product, arrFileTypes, FSO) If theFile = "" Then strFileStatus = "" Else If gfxSpex(theProductLargePath & "\" & theFile, imgW, imgH, c, strType) = True Then Item_Parent = rs_main("P_Name") Item_Title = " (" & rs_main("PT_Name") & ")" Item_Image = server.URLencode("") strFileStatus = "" else strFileStatus = "" End if End if theFile = GetFileLocation(theProductLargePath, Product, arrFileTypes, FSO) If theFile = "" Then strFileStatus2 = "" Else If gfxSpex(theProductLargePath & "\" & theFile, imgW, imgH, c, strType) = True Then Item_Parent = rs_main("P_Name") Item_Title = " (" & rs_main("PT_Name") & ")" Item_Image = server.URLencode("") strFileStatus2 = "" & GetString("ContentText_View2") & "" & GetString("ContentText_LargeView") & "   " End if End if response.write(strFileStatus) response.write Highlight(rs_main("P_Desc"), PassedKeywords, "mednormalhighlight") %>

<% response.write(strFileStatus2) If rs_main("P_hyperlink")<>"" then %> <% WriteString("ContentText_MoreInfo") %>: " target="_new"><% =rs_main("P_hyperlink") %> <% end if %>
<% =rs_main("P_SpecTable") %>
<% 'modify product row specifics here %> <% rs_main.close bg=0 If DBType = "access" Then theQuery = "SELECT DISTINCTROW tbl_Products.P_Name, tbl_Versions.V_Price, tbl_Versions.V_CodeNumber, tbl_Versions.V_Name, tbl_Versions.V_ID, tbl_Versions.V_Desc, tbl_TaxRates.T_Taxrate, tbl_Versions.V_Live, tbl_Versions.V_Quantity, tbl_Versions.V_QuantityWarnLevel FROM (tbl_Versions INNER JOIN ((tbl_Products INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID) INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID) ON tbl_Versions.V_Product = tbl_Products.P_ID) INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE tbl_Versions.V_Live ='y' AND P_ID = " & product & " AND P_Live = 'y' AND PT_Live = 'y' ORDER BY V_Price, V_Name" ElseIf DBType = "mysql" Then theQuery = "SELECT DISTINCT tbl_Products.P_Name, tbl_Versions.V_Price, tbl_Versions.V_CodeNumber, tbl_Versions.V_Name, tbl_Versions.V_ID, tbl_Versions.V_Desc, tbl_TaxRates.T_Taxrate, tbl_Versions.V_Live, tbl_Versions.V_Quantity, tbl_Versions.V_QuantityWarnLevel FROM tbl_Versions INNER JOIN tbl_Products ON tbl_Versions.V_Product = tbl_Products.P_ID INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE tbl_Versions.V_Live ='y' AND P_ID = " & product & " AND P_Live = 'y' AND PT_Live = 'y' ORDER BY V_Price, V_Name" Else theQuery = "SELECT DISTINCT tbl_Products.P_Name, tbl_Versions.V_Price, tbl_Versions.V_CodeNumber, tbl_Versions.V_Name, tbl_Versions.V_ID, tbl_Versions.V_Desc, tbl_TaxRates.T_Taxrate, tbl_Versions.V_Live, tbl_Versions.V_Quantity, tbl_Versions.V_QuantityWarnLevel FROM (tbl_Versions INNER JOIN ((tbl_Products INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID) INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID) ON tbl_Versions.V_Product = tbl_Products.P_ID) INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE tbl_Versions.V_Live ='y' AND P_ID = " & product & " AND P_Live = 'y' AND PT_Live = 'y' ORDER BY V_Price, V_Name" End If Call ExecuteSQL(theQuery,cursortype,rs_main) do while not rs_main.EOF bg = bg + 1 numLineCount = numLineCount + 1 numPrice = Round(rs_main("V_Price"),2) numTax = rs_main("T_Taxrate")/100 numPriceExTax = Round(numPrice * (1/(1 + numTax)),2) If bg/2 = Int(bg/2) then bgcolor="mainpagetableline" else bgcolor="mainpagetableline2" end if If rs_main("V_ID")=CInt(version) then bgcolor="mainpageversionhighlight" strReturnURL = "prod.aspquestionmarkproduct=" & product & "ampersandcat=" & cat & "ampersandph=" & phclause theVersionPath = Server.MapPath("../img_version/") theVersionLargePath = Server.MapPath("../img_version_large/") %> <% rs_main.moveNext loop %>
<% WriteString("ContentText_ProductItem")%> <% WriteString("ContentText_CodeNumberSmall")%> <% WriteString("ContentText_Price") %> (<% =Application(HASHKEYNUMBERXYZ & "currencyunit") %>)  <% WriteString("ContentText_Quantity") %>               
 
<% WriteString("ContentText_RelatedProducts") %>: <% Dim FirstRelProd FirstRelProd = True Do Until rs_main2.EOF If FirstRelProd = True Then FirstRelProd = False Else Response.Write("
" & vbCrLf) Response.Write("" & rs_main2(1) & "") rs_main2.MoveNext Loop %>

<% If strShowBackLink<>"n" then %><< <% WriteString("ContentText_GoBack") %><% end if %>
<% end if rs_main.Close response.write(aryPageTemplate(1)) DataConn.Close set DataConn = nothing %>