%@ Language=VBScript %> <%Option Explicit%> <% if session("LastNameOnTop") & "" = "" AND session("UserID") & "" <> "" then%> <%end if dim Access, newcateg,oConn,oRs,sql,whereclause dim searchtitlemeso,searchdate dim prodsubcateg,i,House,showdim dim arrdate,searchingdate GoToPage = "pubs.asp" menu = "4" newcateg = 3 set oConn = Server.CreateObject("ADODB.Connection") oConn.open Application("ConStr") set oRs = Server.CreateObject("ADODB.Recordset") '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 showdim=request.form("showdim") if showdim="1" then '----------------------------------------anazitisi dimosievmaton-------------------------------- '===================building whereclause================================== whereclause = "" searchtitlemeso = Replace(Request("searchtitlemeso"),"'","''") searchdate = Request("searchdate") if searchtitlemeso & "" <> "" then whereclause =" WHERE (RTitle like ''%" & searchtitlemeso & "%'' OR RTitleEN like ''%" & searchtitlemeso & "%''OR RMeso like ''%" & searchtitlemeso & "%'' OR RMesoEN like ''%" &searchtitlemeso & "%'')" end if if searchdate & "" <> "" then arrdate=split(searchdate,"-") searchingdate=arrdate(2) & "/" & arrdate(1) & "/"&arrdate(0) if whereclause & ""<>"" then whereclause=whereclause & " AND RDate =convert(SmallDateTime,''"& searchingdate &"'',120) " else whereclause =" WHERE RDate = convert(SmallDateTime,''"& searchingdate &"'',120)" end if end if '===================sigentrosi dimosievmaton 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 = "SearchDim '" & 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 %>