%@ Language=VBScript %> <%Option Explicit%> <% if session("LastNameOnTop") & "" = "" AND session("UserID") & "" <> "" then%> <%end if dim Access, newcateg,oConn,oRs,sql,whereclause dim searchtitle,searchsubcateg,searchhouse dim prodsubcateg,i,House,showphotos GoToPage = "photos.asp" menu = "4" newcateg = 2 set oConn = Server.CreateObject("ADODB.Connection") oConn.open Application("ConStr") set oRs = Server.CreateObject("ADODB.Recordset") '===========================drop downs=========================================== if lang = "GR" then prodsubcateg=Application("ProdSubCategsGR") else prodsubcateg=Application("ProdSubCategsEN") end if 'to select ginetai sto global asa SQL = "Select ProdHouseID, ProdHouseDescr,ProdHouseDescrEN from ProdHouse" oRs.open SQL, oConn, 3,1,1 if oRs.EOF = false then House = oRs.GetRows() end if oRs.close 'elegxos an o xristis einai dimosiografos me dikaioma prosvasis if Session("UserID") & "" <> "" then SQL = "Select UCategID, UAccess from [User] where UID=" & session("UserID") oRs.open SQL, oConn, 3,1,1 if oRs.EOF = false then if oRs("UCategID")=7 AND oRs("UAccess") = true then Access = 1 else Access = 0 else Response.Redirect "account.asp" end if oRs.close end if showphotos=request.form("showphotos") if showphotos="1" then '----------------------------------------anazitisi fotos-------------------------------- '===================building whereclause================================== whereclause = "" searchtitle = Replace(Request("searchtitle"),"'","''") searchsubcateg = Request("subcateg") searchhouse = Request("houseid") if searchtitle & "" <> "" then whereclause =" WHERE (Phtitle like ''%" & searchtitle & "%'' OR PHTitleEN like ''%" & searchtitle & "%'')" end if if searchsubcateg & "" <> "" then if whereclause & ""<>"" then whereclause=whereclause & "AND PhCategID = '" & searchsubcateg & "' " else whereclause =" WHERE PhCategID = " & searchsubcateg & " " end if end if if searchhouse & "" <> "" then if whereclause & ""<>"" then whereclause=whereclause & "AND PhHouseID = " & searchhouse & " " else whereclause =" WHERE PhHouseID = " & searchhouse & " " end if end if '===================sigentrosi fotos apo ti vasi============== dim pageno,Tens PageNo = Request("PageNo") : if PageNo & "" = "" then PageNo = 1 'numero proigumenis selidas Tens = Request("tens") : if Tens & "" = "" then Tens = 1 'dekada proigumenis selidas dim totalRows,MainDataExist,totalPages,starting,ending SQL = "SearchPhotos '" & whereclause & "', '" & PageSize &"', " & PageNo oRs.open SQL, oConn, 0, 1, 1 if oRs.EOF = false then totalRows = oRs("TotalRecs") if totalRows = 0 then MainDataExist = 0 else totalRows = oRs("TotalRecs") 'sinolo foto sti vasi MainDataExist = 1 totalPages = totalRows \ PageSize 'arithmos selidon gia emfanisi if totalRows mod PageSize > 0 then totalPages = totalPages + 1 end if starting = ((tens-1)*10)+1 : ending = starting + 9 ',megistos arithmos selidon oi 10 end if %>