<% if trim(request("id")) = "" then response.redirect "gallery.asp" id = trim(request("id")) if isnumeric(trim(id)) = false then response.redirect "gallery.asp" EMsg = "No Photo Gallery found" set rs = Server.CreateObject("ADODB.Recordset") ''''' Code for paging rs.CursorLocation = adUseClient rs.PageSize = 10 currentPage=trim(Request("currentPage")) if currentPage = "" or isNumeric(currentPage) = False then currentPage = 1 ''''' End Code for paging strSQL = "select a.photoid, a.heading, a.photonm from photos a where galid = "& id &" and a.display = 'Y' order by a.logdate desc" 'response.write strSQL 'response.end rs.Open strSQL, con, 3, 3 if not rs.EOF Then ''' Paging if Cint(currentPage)=0 or Cint(currentPage) > rs.PageCount then rs.AbsolutePage = rs.PageCount currentPage = rs.PageCount else rs.AbsolutePage = Cint(currentPage) end if galArr = rs.GetRows() if isEmpty(galArr) = False Then if UBound(galArr,2) >= (rs.PageSize-1) then toctr = (rs.PageSize-1) else toctr = UBound(galArr,2) end if end if '' End Paging end if %> Art of Good Drivers - Ontario Driving License, Driving School, Driver Training, Mississauga                   Photo Gallery                   Testimonials
Photo Gallery
<% if isEmpty(galArr)=False Then %> <%curpic = 1 for i = 0 To toctr if curpic = 1 then response.write "" %> <% curpic = curpic + 1 if i = toctr and curpic < 4 then for j = curpic to 4 response.write "" next curpic=4 end if if curpic = 4 then response.write "" curpic = 1 end if next %> <% if rs.pagecount > 1 then %> <% end if %> <% else %> <% end if %>
<% response.write "" response.write "

" & Trim(galArr(1,i)) & "

"%>

<% response.write ""%>
<%=Trim(galArr(1,i))%>

 
Page <%=currentPage & " of " & rs.PageCount&" -"%> <% for p = 1 to rs.PageCount if cint(currentpage) <> cint(p) then %> <%=p%>  <% else Response.Write "[" & p & "] " end if next %>
<%=EMsg%>