%@ Language=VBScript %> <%Option Explicit%> <% if session("LastNameOnTop") & "" = "" AND session("UserID") & "" <> "" then%> <%end if dim CategID, SubCategID, MainCategs, MainCategDescr, SubCategs, SubCategDescr, a, i dim oRs, oConn, SQL, DataExist, ProdID, RelProdExist dim tmplang, PageNo, totalRows, Data, RelData, RelRec, RelRecExist dim starting, ending, Discount, ProdCategID,ProdPhoto, ProdPhArray set oConn = Server.CreateObject("ADODB.Connection") oConn.open Application("ConStr") set oRs = Server.CreateObject("ADODB.Recordset") MainCategs = Application("ProdCategs"&lang) SubCategs = Application("ProdSubCategs"&lang) CategID = Request.Form("CategID") SubCategID = Request.Form("SubCategID") ProdID = Request.Form("ProdID") ProdCategID = Request.Form("ProdCategID") ProdPhoto = Request.Form("ProdPhoto") if ProdID = "" then Response.Redirect("error.asp") end if '---- Get User Discount in Category ------------------------ if session("UserID") & "" <> "" then If not ProdCategID="" then SQL = "Select Discount from UserDiscount where UserID=" & session("UserID") & " AND ProdCategID=" & ProdCategID If not CategID="" then SQL = "Select Discount from UserDiscount where UserID=" & session("UserID") & " AND ProdCategID=" & CategID oRs.open SQL, oConn, 3,1,1 if oRs.EOF = false then Discount = oRs("Discount") else Discount = 0 end if oRs.close else Discount = 0 end if '---- Get User Discount in Category ------------------------ SQL = "ShowProduct " & ProdID & ", '"& lang & "'" oRs.open SQL, oConn, 0,1,1 if oRs.EOF = false then DataExist = 1 Data = oRs.GetRows() oRs.close CategID = Data(16,0) SubCategID = Data(17,0) '==== Relative Products ======== if lang ="GR" then lang="" SQL = "Select TOP 3 ProdProd.ProdRelID, ProdDescr.ProdDescr"&lang&", IsNull(Product.ProdThumbs,'default.jpg') as ProdThumbs from ProdProd "&_ "LEFT OUTER JOIN Product on Product.ProdID = ProdProd.ProdRelID "&_ "LEFT OUTER JOIN ProdDescr on ProdDescr.ProdDescrID = Product.ProdDescrID "&_ "where ProdProd.ProdID = " & Data(0,0) oRs.open SQL, oConn, 3,1,1 if oRs.EOF = false then RelProdExist = 1 RelData = oRs.GetRows() end if oRs.close '==== Relative Recipes ======== SQL = "Select ProdRec.RecipeID, Recipe.RecipeName, Recipe.RecipeThumbs from ProdRec "&_ " LEFT OUTER JOIN Recipe on Recipe.RecipeID = ProdRec.RecipeID "&_ " where ProdID="& Data(0,0) oRs.open SQL, oConn, 3,1,1 if oRs.EOF = false then RelRecExist = 1 RelRec = oRs.GetRows() dim RecPhotos, tempid, SplitRecPhotos, Splittempid for i=0 to ubound(RelRec,2) if RelRec(2,i) & "" <> "" then RecPhotos = RecPhotos & RelRec(2,i) & "," tempid = tempid & RelRec(0,i) & "," end if next if RecPhotos & "" <> "" then SplitRecPhotos = split(RecPhotos,",") Splittempid = split(tempid,",") a = ubound(SplitRecPhotos) randomize a=Int((a * Rnd)+1) RecPhotos = SplitRecPhotos(a-1) tempid = Splittempid(a-1) else RecPhotos = "default.jpg" end if end if oRs.close else oRs.close end if GoToPage = "product.asp?ProdID="&ProdID menu = "1" if SubCategID = null or SubCategID & "" = "" then SubCategID = 0 end if %>