%@ LANGUAGE="VBSCRIPT" %>
<% PageStrings = "18, 33, 55, 108, 150, 151, 152, 156, 157, 158, 159, 160, 161, 265, 266, 294, 295, 296, 648, 779, 1182, 1183, 1184, 1236, 1237" %>
<%
Set objRecordSet3 = Server.CreateObject("ADODB.Recordset")
V_ID = Request.Querystring("V_ID")
P_ID = Request.Querystring("P_ID")
PT_ID = Request.Querystring("PT_ID")
numPageStartPosition = Request.Querystring("numPageStartPosition")
strShowBackLink = Request.Querystring("strShowBackLink")
If Not isnull(V_ID) And V_ID <> "" Then strKeywords = ""
strPageHistory = Request.Querystring("strPageHistory")
strSearchCriteria = Request.Querystring("strSearchCriteria")
strKeywords = Request.Querystring("strKeywords")
If V_ID="" Then V_ID = 0
If PT_ID="" Then PT_ID = 0
If Not IsNumeric(V_ID) Then Response.Redirect("error.asp")
If Not IsNumeric(P_ID) Then
Response.Redirect("error.asp")
Else
If P_ID="" Then Response.Redirect("error.asp")
End If
If Not IsNumeric(PT_ID) And PT_ID <> "all" Then Response.Redirect("error.asp")
If numPageStartPosition = "" Or Not IsNumeric(numPageStartPosition) Then numPageStartPosition = 1
numPageStartPosition = Clng(numPageStartPosition)
blnNoShow = false
strQuery2 = "SELECT PT_Live, PT_Name" & CStr(numLanguageID) & ", P_StrapLine" & CStr(numLanguageID) & ", P_Live, P_Name" & CStr(numLanguageID) & ", P_SpecTable" & CStr(numLanguageID) & ", P_Desc" & CStr(numLanguageID) & ", P_HyperLink" & CStr(numLanguageID) & ", P_OrderVersionsBy, P_VersionDisplayType FROM (((tblCactuShopVersions INNER JOIN tblCactuShopTaxRates ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE P_ID=" & P_ID & " AND V_Live='y' AND P_Live='y' AND PT_Live='y'"
Call ExecuteSQL(strQuery2, numCursorType, objRecordSet3)
If Not (objRecordSet3.BOF And objRecordSet3.EOF) Then
P_OrderVersionsBy = objRecordSet3("P_OrderVersionsBy")
P_VersionDisplayType = objRecordSet3("P_VersionDisplayType")
blnNoShow = objRecordSet3("P_Name" & CStr(numLanguageID)) & "" = ""
strPageTitleHTML = objRecordSet3("P_Name" & CStr(numLanguageID)) & " | " & GetString("Config_Webshopname")
strMetaDescHTML = left(objRecordSet3("P_Desc" & CStr(numLanguageID)), 300)
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, "
","")
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, " ","")
strMetaDescHTML = Replace(strMetaDescHTML, "
","")
strMetaDescHTML = Replace(strMetaDescHTML, "
","")
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, "","")
strMetaDescHTML = Replace(strMetaDescHTML, vbcrlf, ". ")
End If
If Application(LICENSENUMBER & "tracking") = "y" Then
strQuery = "INSERT INTO tblCactuShopProductStats (PS_ProdNo, PS_Date, PS_IP) VALUES (" & _
P_ID & "," & strDateDelimiter & _
ReverseFormatYear(Now()) & strDateDelimiter & ",'" & _
Request.ServerVariables("HTTP_HOST") & "')"
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
End If
If Not (objRecordSet3.BOF And objRecordSet3.EOF) And Not blnNoShow Then
Select Case strPageHistory
Case "cat": strLocationBar = "" & GetString("ContentText_Categories") & ""
Case "basket": strLocationBar = "" & GetString("ContentText_Basket") & ""
Case "search"
strLocationBar = "" & GetString("ContentText_Search") & ""
strLocationBar = "" & GetString("ContentText_SearchResults") & ""
Case "related": strLocationBar = "" & GetString("ContentText_RelatedProduct") & ""
Case "wishlist": strLocationBar = "" & GetString("PageTitle_WishList") & ""
Case Else: strLocationBar = "" & GetString("ContentText_Home") & ""
End Select
strLocationBar = strLocationBar & " > "
If PT_ID <> "0" And Not isnull(PT_ID) And PT_ID <> "all" Then
strQuery = "SELECT PT_Name" & CStr(numLanguageID) & ", PT_MotherProdType FROM tblCactuShopProdtype WHERE PT_ID = " & PT_ID
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
If Not (objRecordSet.BOF And objRecordSet.EOF) Then
PT_MotherProdType = objRecordSet("PT_MotherProdType")
strSectionLink = "" & objRecordSet("PT_Name" & CStr(numLanguageID)) & " > " & chr(13)
objRecordSet.Close
numMotherID = PT_MotherProdType
Do While numMotherID > 0
strQuery = "SELECT PT_ID, PT_Name" & CStr(numLanguageID) & ", PT_MotherProdType FROM tblCactuShopProdtype WHERE PT_ID = " & numMotherID
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
If Not (objRecordSet.BOF And objRecordSet.EOF) Then
numMotherID = objRecordSet("PT_MotherProdType")
strMothers = "" & objRecordSet("PT_Name" & CStr(numLanguageID)) & " > " & strMothers
Else
numMotherID = 0
End If
objRecordSet.Close
Loop
strLocationBar = strLocationBar & strMothers & strSectionLink
Else
objRecordSet.Close
End If
End If
strLocationBar = strLocationBar & objRecordSet3("P_Name" & CStr(numLanguageID))
End If
%>
<%
Call ReadFromTemplate(strTemplateLocation, aryPageTemplate, strBasketHTML, strCategoryListHTML)
Response.Write(aryPageTemplate(0))
If objRecordSet3.RecordCount = 0 Or blnNoShow Then
%>
| <% WriteString("ContentText_ProductUnavailable") %> |
<%
Else
%>
<% Response.Write "" & objRecordSet3("P_Name" & CStr(numLanguageID)) & " " & strLocationBar & "" %>
|
<%
If objRecordSet3("P_StrapLine" & CStr(numLanguageID))<>"" Then
%>
| <%= objRecordSet3("P_StrapLine" & CStr(numLanguageID)) %> |
<%
End If
%>
<%
Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
aryFileTypes = Split(Application(LICENSENUMBER & "allowedimages"), ",")
strProductPath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products/")
strProductLargePath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products_large/")
strFileName = GetFileLocation(strProductPath, P_ID, aryFileTypes, objFileSystem)
If strFileName = "" Then
strFileStatus = ""
Else
strFileStatus = " "
End If
strFileName = GetFileLocation(strProductLargePath, P_ID, aryFileTypes, objFileSystem)
If strFileName = "" Then
strFileStatus2 = ""
Else
If gfxSpex(strProductLargePath & "\" & strFileName, imgW, imgH, c, strType) = True Then
strImage = strFileName
strImageType = "product"
strFileStatus = "" & strFileStatus & ""
strFileStatus2 = "" & GetString("ContentText_LargeView") & " "
End If
End If
Response.Write(strFileStatus)
P_Desc = objRecordSet3("P_Desc" & CStr(numLanguageID))
If Application(LICENSENUMBER & "convertdescbreaks") = "y" Then
P_Desc = replace(P_Desc, vbcrlf, " ")
End If
Response.Write(Highlight(P_Desc, strKeywords, "searchtexthighlight"))
%>
<%
Response.Write(strFileStatus2)
If objRecordSet3("P_HyperLink" & CStr(numLanguageID))<>"" Then
%>
<% WriteString("ContentText_MoreInfo") %>: " target="_new"><%= objRecordSet3("P_HyperLink" & CStr(numLanguageID)) %>
<%
End If
%>
|
<%= objRecordSet3("P_SpecTable" & CStr(numLanguageID)) %> |
|
<%
objRecordSet3.Close
numBackgroundCounter = 0
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)
If strDatabaseType = "access" Then
strQuery2 = "SELECT DISTINCTROW tblCactuShopProducts.P_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_Price, tblCactuShopVersions.V_Weight, tblCactuShopVersions.V_RRP, tblCactuShopVersions.V_CodeNumber, tblCactuShopVersions.V_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_ID, tblCactuShopVersions.V_Desc" & CStr(numLanguageID) & ", tblCactuShopTaxRates.T_Taxrate, tblCactuShopVersions.V_Live, tblCactuShopVersions.V_Quantity, tblCactuShopVersions.V_QuantityWarnLevel, " & strVersionsOrderBy & " As OrderByBit FROM (tblCactuShopVersions INNER JOIN ((tblCactuShopProducts INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID) ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopTaxRates ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID WHERE tblCactuShopVersions.V_Live ='y' AND P_ID = " & P_ID & " AND P_Live = 'y' AND PT_Live = 'y' AND V_Name" & CStr(numLanguageID) & " <> '' ORDER BY " & strVersionsOrderBy
Else
strQuery2 = "SELECT DISTINCT tblCactuShopProducts.P_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_Price, tblCactuShopVersions.V_Weight, tblCactuShopVersions.V_RRP, tblCactuShopVersions.V_CodeNumber, tblCactuShopVersions.V_Name" & CStr(numLanguageID) & ", tblCactuShopVersions.V_ID, tblCactuShopVersions.V_Desc" & CStr(numLanguageID) & ", tblCactuShopTaxRates.T_Taxrate, tblCactuShopVersions.V_Live, tblCactuShopVersions.V_Quantity, tblCactuShopVersions.V_QuantityWarnLevel, " & strVersionsOrderBy & " As OrderByBit FROM (((tblCactuShopTaxRates INNER JOIN tblCactuShopVersions ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE tblCactuShopVersions.V_Live ='y' AND P_ID = " & P_ID & " AND P_Live = 'y' AND PT_Live = 'y' AND V_Name" & CStr(numLanguageID) & " <> '' ORDER BY " & strVersionsOrderBy
End If
Call ExecuteSQL(strQuery2, numCursorType, objRecordSet3)
strReturnURL = "product.asp:::P_ID=" & P_ID & "|||PT_ID=" & PT_ID & "|||numPageStartPosition=" & numPageStartPosition
strVersionPath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_versions/")
strVersionLargePath = Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_versions_large/")
%>
<%
objRecordSet3.Close
%>
|
|
<%
strCarryOnShopping = "" & vbcrlf
strCarryOnShopping = strCarryOnShopping & " " & GetString("ContentText_CarryOnShopping") & " | " & vbcrlf
strCarryOnShopping = strCarryOnShopping & "
" & vbcrlf
strQuery = "SELECT P_ID, P_Name" & CStr(numLanguageID) & " FROM tblCactuShopRelatedProducts INNER JOIN tblCactuShopProducts ON tblCactuShopRelatedProducts.RP_ChildID = tblCactuShopProducts.P_ID WHERE RP_ParentID = " & P_ID & " AND P_Live = 'y' ORDER BY P_Name" & CStr(numLanguageID)
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
strRelatedIDs = "0"
If objRecordSet.RecordCount > 0 Then
Response.Write strCarryOnShopping
strCarryOnShopping = ""
%>
| <% WriteString("ContentText_RelatedProducts") %>: |
<%
Do Until objRecordSet.EOF
Response.Write("" & objRecordSet("P_Name" & CStr(numLanguageID)) & " ")
strRelatedIDs = strRelatedIDs & "," & objRecordSet("P_ID")
objRecordSet.MoveNext
Loop
%>
|
<%
End If
objRecordSet.Close
numPeopleWhoBought = Application(LICENSENUMBER & "peoplewhobought")
If numPeopleWhoBought > 0 Then
If Application(LICENSENUMBER & "peoplewhoboughtjustorder") = "n" Then
If strDatabaseType = "mysql" Then
strQuery = "SELECT AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & ", COUNT(*) As TotalMatches FROM (tblCactuShopInvoiceRows AS AlsoInvoiceRows INNER JOIN (tblCactuShopVersions AS AlsoVersions INNER JOIN tblCactuShopProducts AS AlsoProducts ON AlsoVersions.V_Product = AlsoProducts.P_ID) ON AlsoInvoiceRows.IR_VersionCode = AlsoVersions.V_CodeNumber) INNER JOIN (tblCactuShopOrderNumbers AS AlsoOrderNumbers INNER JOIN (((tblCactuShopVersions INNER JOIN tblCactuShopInvoiceRows ON tblCactuShopVersions.V_CodeNumber = tblCactuShopInvoiceRows.IR_VersionCode) INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopCardholderDetails ON tblCactuShopOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) ON AlsoOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) ON AlsoInvoiceRows.IR_OrderNumber = AlsoOrderNumbers.ON_ID WHERE tblCactuShopVersions.V_Product = " & P_ID & " AND AlsoVersions.V_Product NOT IN (" & strRelatedIDs & ") AND AlsoVersions.V_Product <> " & P_ID & " AND AlsoProducts.P_Name" & numLanguageID & " <> '' AND P_Live = 'y' GROUP BY AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & " ORDER BY TotalMatches DESC LIMIT 0, " & numPeopleWhoBought
Else
strQuery = "SELECT TOP " & numPeopleWhoBought & " AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & ", COUNT(*) As TotalMatches FROM (tblCactuShopInvoiceRows AS AlsoInvoiceRows INNER JOIN (tblCactuShopVersions AS AlsoVersions INNER JOIN tblCactuShopProducts AS AlsoProducts ON AlsoVersions.V_Product = AlsoProducts.P_ID) ON AlsoInvoiceRows.IR_VersionCode = AlsoVersions.V_CodeNumber) INNER JOIN (tblCactuShopOrderNumbers AS AlsoOrderNumbers INNER JOIN (((tblCactuShopVersions INNER JOIN tblCactuShopInvoiceRows ON tblCactuShopVersions.V_CodeNumber = tblCactuShopInvoiceRows.IR_VersionCode) INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopCardholderDetails ON tblCactuShopOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) ON AlsoOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) ON AlsoInvoiceRows.IR_OrderNumber = AlsoOrderNumbers.ON_ID WHERE tblCactuShopVersions.V_Product = " & P_ID & " AND AlsoVersions.V_Product NOT IN (" & strRelatedIDs & ") AND AlsoVersions.V_Product <> " & P_ID & " AND AlsoProducts.P_Name" & numLanguageID & " <> '' AND P_Live = 'y' GROUP BY AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & " ORDER BY Count(AlsoProducts.P_ID) DESC"
End If
Else
If strDatabaseType = "mysql" Then
strQuery = "SELECT AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & ", Count(AlsoProducts.P_ID) AS TotalMatches FROM (((tblCactuShopVersions INNER JOIN tblCactuShopInvoiceRows ON tblCactuShopVersions.V_CodeNumber = tblCactuShopInvoiceRows.IR_VersionCode) INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopInvoiceRows AS AlsoInvoiceRows ON tblCactuShopOrderNumbers.ON_ID = AlsoInvoiceRows.IR_OrderNumber) INNER JOIN (tblCactuShopVersions AS AlsoVersions INNER JOIN tblCactuShopProducts AS AlsoProducts ON AlsoVersions.V_Product = AlsoProducts.P_ID) ON AlsoInvoiceRows.IR_VersionCode = AlsoVersions.V_CodeNumber WHERE tblCactuShopVersions.V_Product = " & P_ID & " AND AlsoVersions.V_Product NOT IN (" & strRelatedIDs & ") AND AlsoVersions.V_Product <> " & P_ID & " AND P_Live = 'y' AND AlsoProducts.P_Name" & numLanguageID & " <> '' GROUP BY AlsoProducts.P_ID, AlsoProducts.P_Name" & Cstr(numLanguageID) & " ORDER BY TotalMatches DESC LIMIT 0, " & numPeopleWhoBought
Else
strQuery = "SELECT TOP " & numPeopleWhoBought & " AlsoProducts.P_ID, AlsoProducts.P_Name" & numLanguageID & ", Count(AlsoProducts.P_ID) AS TotalMatches FROM (((tblCactuShopVersions INNER JOIN tblCactuShopInvoiceRows ON tblCactuShopVersions.V_CodeNumber = tblCactuShopInvoiceRows.IR_VersionCode) INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopInvoiceRows AS AlsoInvoiceRows ON tblCactuShopOrderNumbers.ON_ID = AlsoInvoiceRows.IR_OrderNumber) INNER JOIN (tblCactuShopVersions AS AlsoVersions INNER JOIN tblCactuShopProducts AS AlsoProducts ON AlsoVersions.V_Product = AlsoProducts.P_ID) ON AlsoInvoiceRows.IR_VersionCode = AlsoVersions.V_CodeNumber WHERE tblCactuShopVersions.V_Product = " & P_ID & " AND AlsoVersions.V_Product NOT IN (" & strRelatedIDs & ") AND AlsoVersions.V_Product <> " & P_ID & " AND AlsoProducts.P_Name" & numLanguageID & " <> '' AND P_Live = 'y' GROUP BY AlsoProducts.P_ID, AlsoProducts.P_Name" & Cstr(numLanguageID) & " ORDER BY Count(AlsoProducts.P_ID) DESC"
End If
End If
Call ExecuteSQL(strQuery,numCursorType, objRecordSet)
If objRecordSet.RecordCount > 0 Then
Response.Write strCarryOnShopping
strCarryOnShopping = ""
%>
| <% WriteString("ContentText_PeopleWhoBought") %>: |
<%
i = 0
Do Until objRecordSet.EOF Or i = numPeopleWhoBought
i = i + 1
Response.Write("" & objRecordSet(1) & " ")
objRecordSet.MoveNext
Loop
%>
|
<%
End If
objRecordSet.Close
End If
numTryTheseCategories = Application(LICENSENUMBER & "trythesecategories")
If numTryTheseCategories > 0 Then
strQuery = "SELECT tblCactuShopProdtype.PT_ID, tblCactuShopProdtype.PT_MotherProdType, tblCactuShopProdtype.PT_Name" & CStr(numLanguageID) & " FROM tblCactuShopProductProdTypeLink INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE tblCactuShopProductProdTypeLink.PPT_ProductID = " & P_ID & " AND PT_Live = 'y'"
If PT_ID <> "all" Then strQuery = strQuery & " AND PT_ID <> " & PT_ID
Call ExecuteSQL(strQuery,numCursorType, objRecordSet)
If objRecordSet.RecordCount > 0 Then
Response.Write strCarryOnShopping
strCarryOnShopping = ""
%>
| <% WriteString("ContentText_TryTheseCategories") %>: |
<%
i = 0
Do Until objRecordSet.EOF Or i = numTryTheseCategories
i = i + 1
PT_MotherProdType = objRecordSet("PT_MotherProdType")
PT_ID = objRecordSet("PT_ID")
strSectionLink = "" & objRecordSet("PT_Name" & CStr(numLanguageID)) & "" & chr(13)
numMotherID = PT_MotherProdType
strMothers = ""
Do While numMotherID > 0
strQuery = "SELECT PT_Name" & CStr(numLanguageID) & ", PT_MotherProdType FROM tblCactuShopProdtype WHERE PT_ID = " & numMotherID
Call ExecuteSQL(strQuery, numCursorType, objRecordSet3)
If Not (objRecordSet3.BOF And objRecordSet3.EOF) Then
numMotherID = objRecordSet3("PT_MotherProdType")
strMothers = "" & objRecordSet3("PT_Name" & CStr(numLanguageID)) & " > " & strMothers
Else
numMotherID = 0
End If
objRecordSet3.Close
Loop
Response.Write "" & strMothers & strSectionLink & " "
objRecordSet.MoveNext
Loop
%>
|
<%
End If
objRecordSet.Close
End If
%>
<%
If strShowBackLink <> "n" Then
%>
<< <% WriteString("ContentText_GoBack") %>
<%
End If
%>
|
<%
End If
Response.Write(aryPageTemplate(1))
objDataConn.Close
Set objDataConn = Nothing
%>