<% 'This code is copyright (c) Internet Business Solutions SL, all rights reserved. 'The contents of this file are protect under law as the intellectual property 'of Internet Business Solutions SL. Any use, reproduction, disclosure or copying 'of any kind without the express and written permission of Internet Business 'Solutions SL is forbidden. 'Author: Vince Reid, vince@virtualred.net Dim sSQL,rs,alldata,cnn,rowcounter,iNumOfPages,CurPage,Count,weburl,longdesc,currFormat1,currFormat2,currFormat3,aOption() if Trim(explicitid)<>"" then prodid=Trim(explicitid) else prodid=Trim(request.querystring("prod")) prodlist="'" & Replace(prodid,"'","''") & "'" WSP = "" OWSP = "" netnav = true if instr(Request.ServerVariables("HTTP_USER_AGENT"), "compatible") > 0 OR instr(Request.ServerVariables("HTTP_USER_AGENT"), "Gecko") > 0 then netnav = false function atb(size) if netnav then atb = CInt(size / 2 + 1) else atb = size end if end function Redim aOption(2,maxprodopts) Count=0 Set rs = Server.CreateObject("ADODB.RecordSet") Set rs2 = Server.CreateObject("ADODB.RecordSet") Set cnn=Server.CreateObject("ADODB.Connection") cnn.open sDSN alreadygotadmin = getadminsettings() Call checkCurrencyRates(currConvUser,currConvPw,currLastUpdate,currRate1,currSymbol1,currRate2,currSymbol2,currRate3,currSymbol3) if Session("clientUser")<>"" then if (Session("clientActions") AND 8) = 8 then WSP = "pWholesalePrice AS " if wholesaleoptionpricediff=TRUE then OWSP = "optWholesalePriceDiff AS " end if if (Session("clientActions") AND 16) = 16 then Session.LCID = 1033 WSP = Session("clientPercentDiscount") & "*pPrice AS " if wholesaleoptionpricediff=TRUE then OWSP = Session("clientPercentDiscount") & "*optPriceDiff AS " Session.LCID = saveLCID end if end if Session("frompage")=Request.ServerVariables("URL")&IIfVr(Trim(Request.ServerVariables("QUERY_STRING"))<>"","?","")&Request.ServerVariables("QUERY_STRING") ' Previous and next sSQL = "SELECT pId,"&getlangid("pName",1)&",pImage,"&WSP&"pPrice,pSection,pListPrice,pSell,pInStock,pExemptions,"&IIfVr(detailslink<>"","'' AS ","")&"pLargeImage,"&getlangid("pDescription",2)&","&getlangid("pLongDescription",4)&" FROM products WHERE pDisplay<>0 AND pId='"&Replace(prodid,"'","''")&"'" rs.Open sSQL,cnn,0,1,&H0001 if rs.EOF then response.write "

 
Sorry, this product is not currently available.
 

" else tslist = "" if IsNull(rs("pSection")) then catid = 0 else catid = rs("pSection") if Trim(request.querystring("cat"))<>"" AND IsNumeric(request.querystring("cat")) AND Trim(request.querystring("cat"))<>"0" then catid = request.querystring("cat") thetopts = catid topsectionids = catid isrootsection=false for index=0 to 10 if thetopts=0 then tslist = ""&xxHome&" " & tslist exit for elseif index=10 then tslist = "Loop" & tslist else sSQL = "SELECT sectionID,topSection,"&getlangid("sectionName",256)&",rootSection,sectionurl FROM sections WHERE sectionID=" & thetopts rs2.Open sSQL,cnn,0,1 if NOT rs2.EOF then if trim(rs2("sectionurl")&"")<>"" then tslist = " » " & rs2(getlangid("sectionName",256)) & "" & tslist elseif rs2("rootSection")=1 then tslist = " » " & rs2(getlangid("sectionName",256)) & "" & tslist else tslist = " » " & rs2(getlangid("sectionName",256)) & "" & tslist end if thetopts = rs2("topSection") topsectionids = topsectionids & "," & thetopts else tslist = "Top Section Deleted" & tslist rs2.Close exit for end if rs2.Close end if next nextid="" previousid="" sectionids = getsectionids(catid, false) sSQL = "SELECT products.pId FROM products LEFT JOIN multisections ON products.pId=multisections.pId WHERE (products.pSection IN (" & sectionids & ") OR multisections.pSection IN (" & sectionids & ")) AND pDisplay<>0 AND products.pId > '"&Replace(prodid,"'","''")&"' ORDER BY products.pId ASC" rs2.Open sSQL,cnn,0,1 if NOT rs2.EOF then nextid = Server.URLEncode(rs2("pId")) end if rs2.Close sSQL = "SELECT products.pId FROM products LEFT JOIN multisections ON products.pId=multisections.pId WHERE (products.pSection IN (" & sectionids & ") OR multisections.pSection IN (" & sectionids & ")) AND pDisplay<>0 AND products.pId < '"&Replace(prodid,"'","''")&"' ORDER BY products.pId DESC" rs2.Open sSQL,cnn,0,1 if NOT rs2.EOF then previousid = Server.URLEncode(rs2("pId")) end if rs2.Close saveLCID = Session.LCID prodoptions="" productdisplayscript(true) if currencyseparator="" then currencyseparator=" " updatepricescript(true) %>
<% if IsEmpty(showcategories) OR showcategories=true then %>

<%=tslist%>

 <% if nobuyorcheckout<>true then %><%=xxCOTxt%><% end if %>
<% end if alldiscounts = "" if nowholesalediscounts=true AND Session("clientUser")<>"" then if ((Session("clientActions") AND 8) = 8) OR ((Session("clientActions") AND 16) = 16) then noshowdiscounts=true end if if noshowdiscounts<>true then Session.LCID = 1033 tdt = Date() sSQL = "SELECT DISTINCT "&getlangid("cpnName",1024)&" FROM coupons LEFT OUTER JOIN cpnassign ON coupons.cpnID=cpnassign.cpaCpnID WHERE cpnNumAvail>0 AND cpnEndDate>="&datedelim&VSUSDate(tdt)&datedelim&" AND cpnIsCoupon=0 AND " sSQL = sSQL & "((cpnSitewide=1 OR cpnSitewide=2) " sSQL = sSQL & "OR (cpnSitewide=0 AND cpaType=2 AND cpaAssignment='"&rs("pID")&"') " sSQL = sSQL & "OR ((cpnSitewide=0 OR cpnSitewide=3) AND cpaType=1 AND cpaAssignment IN ('"&Replace(topsectionids,",","','")&"')))" Session.LCID = saveLCID rs2.Open sSQL,cnn,0,1 do while NOT rs2.EOF alldiscounts = alldiscounts & rs2(getlangid("cpnName",1024)) & "
" rs2.MoveNext loop rs2.Close end if if usedetailbodyformat=1 OR usedetailbodyformat="" then %> <% if previousid<>"" OR nextid<>"" then response.write "" end if rs.Close cnn.Close %>
<% if showproductid=true then response.write "
" & xxPrId & ": " & rs("pID") & "
" %>
<% response.write rs(getlangid("pName",1))&xxDot if alldiscounts<>"" then response.write " "&xxDsApp&"
" & alldiscounts & "
" else response.write "" %>
<% if NOT (Trim(rs("pLargeImage"))="" OR IsNull(rs("pLargeImage")) OR Trim(rs("pLargeImage"))="prodimages/") then %> " border="0" alt="<%=Replace(rs(getlangid("pName",1))&"","""",""")%>" /> <% elseif NOT (Trim(rs("pImage"))="" OR IsNull(rs("pImage")) OR Trim(rs("pImage"))="prodimages/") then %> " border="0" alt="<%=Replace(rs(getlangid("pName",1))&"","""",""")%>" /> <% else %>   <% end if %>

<% shortdesc = Trim(rs(getlangid("pDescription",2))) longdesc = Trim(rs(getlangid("pLongDescription",4))) if longdesc<>"" then response.write "

"&longdesc&"
" elseif shortdesc<>"" then response.write "
"&shortdesc&"
" else response.write " " end if %>

<% optionshavestock=true if IsArray(prodoptions) then response.write "
" for rowcounter=0 to UBOUND(prodoptions,2) index=0 gotSelection=false cacheThis=NOT useStockManagement do while index < (maxprodopts-1) AND aOption(0,index)<>0 if aOption(0,index)=Int(prodoptions(0,rowcounter)) then gotSelection=true exit do end if index = index + 1 loop if NOT gotSelection then aOption(2,index) = false sSQL="SELECT optID,"&getlangid("optName",32)&","&getlangid("optGrpName",16)&","&OWSP&"optPriceDiff,optType,optFlags,optStock,optPriceDiff AS optDims FROM options INNER JOIN optiongroup ON options.optGroup=optiongroup.optGrpID WHERE optGroup="&prodoptions(0,rowcounter)&" ORDER BY optID" rs2.Open sSQL,cnn,0,1 if NOT rs2.EOF then if Abs(Int(rs2("optType")))=3 then aOption(2,index)=true fieldHeight = cInt((cDbl(rs2("optDims"))-Int(rs2("optDims")))*100.0) aOption(1,index) = "" else aOption(1,index) = "" end if end if if cacheThis then aOption(0,index) = Int(prodoptions(0,rowcounter)) rs2.Close end if response.write Replace(Replace(aOption(1,index),"optnPLACEHOLDER","optn"&rowcounter),"updatepricePLACEHOLDER",IIfVr((rs("pPrice")=0 AND pricezeromessage<>"") OR noprice=true,"dummyfunc","updateprice"&Count),1,1) optionshavestock = (optionshavestock AND aOption(2,index)) next response.write "
"&rs2(getlangid("optGrpName",16))&": " if fieldHeight<>1 then aOption(1,index) = aOption(1,index) & "" else aOption(1,index) = aOption(1,index) & "" end if aOption(1,index) = aOption(1,index) & "
"&rs2(getlangid("optGrpName",16))&":
" end if %>
<% if useemailfriend then %> <%=xxEmFrnd%> <% else %>   <% end if %> <% if noprice=true then response.write " " else if cDbl(rs("pListPrice"))<>0.0 then response.write Replace(xxListPrice, "%s", FormatEuroCurrency(rs("pListPrice"))) & "
" if cDbl(rs("pPrice"))=0 AND pricezeromessage<>"" then response.write "
" & pricezeromessage & "
" else response.write "
" & xxPrice & ": " & FormatEuroCurrency(rs("pPrice")) & " " if showtaxinclusive=true AND (rs("pExemptions") AND 2)<>2 then response.write Replace(ssIncTax,"%s", "" & FormatEuroCurrency(rs("pPrice")+(rs("pPrice")*countryTax/100.0)) & " ") response.write "
" extracurr = "" if currRate1<>0 AND currSymbol1<>"" then extracurr = replace(currFormat1, "%s", FormatNumber(rs("pPrice")*currRate1, checkDPs(currSymbol1))) & currencyseparator if currRate2<>0 AND currSymbol2<>"" then extracurr = extracurr & replace(currFormat2, "%s", FormatNumber(rs("pPrice")*currRate2, checkDPs(currSymbol2))) & currencyseparator if currRate3<>0 AND currSymbol3<>"" then extracurr = extracurr & replace(currFormat3, "%s", FormatNumber(rs("pPrice")*currRate3, checkDPs(currSymbol3))) if extracurr<>"" then response.write "
" & extracurr & "
" end if end if %>
<% if nobuyorcheckout=true then response.write " " else if useStockManagement then if ((rs("pSell") AND 2)=2) then isInStock = optionshavestock else isInStock = Int(rs("pInStock")) > 0 else isInStock = Int(cStr((rs("pSell") AND 1))) <> 0 end if if isInStock then %> " /> "","?","")&Request.ServerVariables("QUERY_STRING")%>" /> <% if showquantondetail=true then response.write "" if custombuybutton<>"" then response.write custombuybutton else response.write "" else response.write ""&xxOutStok&"" end if end if %>

 
" if previousid<>"" then response.write ""","&cat="&request.querystring("cat"),"") & """>" response.write "« "&xxPrev&"" if previousid<>"" then response.write "" response.write " | " if nextid<>"" then response.write ""","&cat="&request.querystring("cat"),"") & """>" response.write ""&xxNext&" »" if nextid<>"" then response.write "" response.write "

<% else ' if usedetailbodyformat=2 %> <% rs.Close cnn.Close %>
<% if NOT (Trim(rs("pLargeImage"))="" OR IsNull(rs("pLargeImage")) OR Trim(rs("pLargeImage"))="prodimages/") then %> " border="0" alt="<%=Replace(rs(getlangid("pName",1))&"","""",""")%>" /> <% elseif NOT (Trim(rs("pImage"))="" OR IsNull(rs("pImage")) OR Trim(rs("pImage"))="prodimages/") then %> " border="0" alt="<%=Replace(rs(getlangid("pName",1))&"","""",""")%>" /> <% else %>   <% end if %>   <% if showproductid=true then response.write "
" & xxPrId & ": " & rs("pID") & "
" %>
<% response.write rs(getlangid("pName",1))&xxDot if alldiscounts<>"" then response.write " "&xxDsApp&"
" & alldiscounts & "
" else response.write "" %>
<% shortdesc = Trim(rs(getlangid("pDescription",2))) longdesc = Trim(rs(getlangid("pLongDescription",4))) if longdesc<>"" then response.write "
"&longdesc&"
" elseif shortdesc<>"" then response.write "
"&shortdesc&"
" end if if noprice=true then response.write " " else if cDbl(rs("pListPrice"))<>0.0 then response.write Replace(xxListPrice, "%s", FormatEuroCurrency(rs("pListPrice"))) & "
" if cDbl(rs("pPrice"))=0 AND pricezeromessage<>"" then response.write "
" & pricezeromessage & "
" else response.write "
" & xxPrice & ": " & FormatEuroCurrency(rs("pPrice")) & " " if showtaxinclusive=true AND (rs("pExemptions") AND 2)<>2 then response.write Replace(ssIncTax,"%s", "" & FormatEuroCurrency(rs("pPrice")+(rs("pPrice")*countryTax/100.0)) & " ") response.write "
" extracurr = "" if currRate1<>0 AND currSymbol1<>"" then extracurr = replace(currFormat1, "%s", FormatNumber(rs("pPrice")*currRate1, checkDPs(currSymbol1))) & currencyseparator if currRate2<>0 AND currSymbol2<>"" then extracurr = extracurr & replace(currFormat2, "%s", FormatNumber(rs("pPrice")*currRate2, checkDPs(currSymbol2))) & currencyseparator if currRate3<>0 AND currSymbol3<>"" then extracurr = extracurr & replace(currFormat3, "%s", FormatNumber(rs("pPrice")*currRate3, checkDPs(currSymbol3))) if extracurr<>"" then response.write "
" & extracurr & "
" end if response.write "
" end if optionshavestock=true if IsArray(prodoptions) then optionshavestock=true response.write "
" for rowcounter=0 to UBOUND(prodoptions,2) index=0 gotSelection=false cacheThis=NOT useStockManagement do while index < (maxprodopts-1) AND aOption(0,index)<>0 if aOption(0,index)=Int(prodoptions(0,rowcounter)) then gotSelection=true exit do end if index = index + 1 loop if NOT gotSelection then aOption(2,index) = false sSQL="SELECT optID,"&getlangid("optName",32)&","&getlangid("optGrpName",16)&","&OWSP&"optPriceDiff,optType,optFlags,optStock,optPriceDiff AS optDims FROM options INNER JOIN optiongroup ON options.optGroup=optiongroup.optGrpID WHERE optGroup="&prodoptions(0,rowcounter)&" ORDER BY optID" rs2.Open sSQL,cnn,0,1 if NOT rs2.EOF then if Abs(Int(rs2("optType")))=3 then aOption(2,index)=true fieldHeight = cInt((cDbl(rs2("optDims"))-Int(rs2("optDims")))*100.0) aOption(1,index) = "" else aOption(1,index) = "" end if end if if cacheThis then aOption(0,index) = Int(prodoptions(0,rowcounter)) rs2.Close end if response.write Replace(Replace(aOption(1,index),"optnPLACEHOLDER","optn"&rowcounter),"updatepricePLACEHOLDER",IIfVr((rs("pPrice")=0 AND pricezeromessage<>"") OR noprice=true,"dummyfunc","updateprice"&Count),1,1) optionshavestock = (optionshavestock AND aOption(2,index)) next if nobuyorcheckout<>true AND (showquantondetail=TRUE OR IsEmpty(showquantondetail)) then %> <% end if response.write "
"&rs2(getlangid("optGrpName",16))&": " if fieldHeight<>1 then aOption(1,index) = aOption(1,index) & "" else aOption(1,index) = aOption(1,index) & "" end if aOption(1,index) = aOption(1,index) & "
"&rs2(getlangid("optGrpName",16))&":
<%=xxQuant%>:
" else if nobuyorcheckout<>true AND (showquantondetail=TRUE OR IsEmpty(showquantondetail)) then %>
<%=xxQuant%>:
<% end if end if %>

<% if nobuyorcheckout=true then response.write " " else if useStockManagement then if ((rs("pSell") AND 2)=2) then isInStock = optionshavestock else isInStock = Int(rs("pInStock")) > 0 else isInStock = Int(cStr((rs("pSell") AND 1))) <> 0 end if if isInStock then %> " /> "","?","")&Request.ServerVariables("QUERY_STRING")%>" /> <% if custombuybutton<>"" then response.write custombuybutton else response.write "
" else response.write ""&xxOutStok&"
" end if end if if previousid<>"" OR nextid<>"" then response.write "

" if previousid<>"" then response.write ""","&cat="&request.querystring("cat"),"") & """>" response.write "« "&xxPrev&"" if previousid<>"" then response.write "" response.write " | " if nextid<>"" then response.write ""","&cat="&request.querystring("cat"),"") & """>" response.write ""&xxNext&" »" if nextid<>"" then response.write "" response.write "
" end if %>


<% if useemailfriend then %>

<%=xxEmFrnd%>

<% end if %>
<% end if ' usedetailbodyformat %>
<% end if ' rs.EOF set rs = nothing set rs2 = nothing set cnn = nothing %>