%@ 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, MainDataExist, ShowLeft, LeftProdID dim tmplang, PageNo, totalRows, Data, totalPages, tens, Discount dim starting, ending, GiftProdID, ItemsRemove, arrThumbnails 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") PageNo = Request("PageNo") : if PageNo & "" = "" then PageNo = 1 tens = Request("tens") : if tens & "" = "" then tens = 1 GiftProdID = Request.Form("GiftProdID") ItemsRemove = Request.Form("ItemsRemove") if CategID="" OR CategID="" then dim errmsg Response.Redirect("error.asp") end if '---- Get User Discount in Category ------------------------ if session("UserID") & "" <> "" 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 ------------------------ '--- Getting Product to show off on the left side ------ SQL = "LeftProduct1 " & templang & "," & CategID & "," & SubCategID oRs.open SQL, oConn, 0,1,1 if oRs.EOF = false then ShowLeft = oRs.GetRows() LeftProdID = ShowLeft(0,0) DataExist = 1 else oRs.close SQL = "LeftProduct2 " & templang & "," & CategID & "," & SubCategID oRs.open SQL, oConn, 0,1,1 if oRs.EOF = false then ShowLeft = oRs.GetRows() LeftProdID = ShowLeft(0,0) DataExist = 1 end if end if oRs.close 'Split tis fwtografies If DataExist = 1 Then Dim arrPhotos arrPhotos = Split(ShowLeft(3,0),",") ShowLeft(3,0) = arrPhotos(0) End If if lang = "GR" then tmplang = "" else tmplang = "EN" SQL = "ShowProds '" & tmplang & "','" & CategID & "','" & SubCategID & "','" & LeftProdID & "', " & Discount &", " & PageSize & ", " & PageNo oRs.open SQL, oConn, 0, 1, 1 if oRs.state=0 then oRs.open SQL, oConn, 3, 1, 1 if oRs.EOF = false then totalRows = oRs("TotalRecs") if totalRows = 0 then MainDataExist = 0 else totalRows = oRs("TotalRecs") MainDataExist = 1 Data = oRs.GetRows() totalPages = totalRows \ PageSize if totalRows mod PageSize > 0 then totalPages = totalPages + 1 end if oRs.close starting = ((tens-1)*10)+1 : ending = starting + 9 GoToPage = "subcategGift.asp?CategID="&CategID&"_subCategID="&SubCategID menu = "1" %>