<% dbdir=Server.MapPath("/Data/Products.mdb") set Conn=Server.CreateObject("ADODB.Connection") Conn.Open "DBQ="& dbDir &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;pwd=" %> Aφοί Μάντη - Ορθοπεδικά
<% set rs2=Server.CreateObject("ADODB.Recordset") set rs2.ActiveConnection=Conn rs2.CursorType=3 rs2.LockType=1 RS2.Open "SELECT * FROM TblPhoto WHERE onOffer=true" %>
<% set rsPhoto=Server.CreateObject("ADODB.Recordset") set rsPhoto.ActiveConnection=Conn rsPhoto.CursorType=3 rsPhoto.LockType=1 rsPhoto.Open "SELECT * FROM TblPhoto WHERE onOffer=true" totalProducts=rsPhoto.RecordCount 'we see how many are the products currentPage=Request("p") 'we take the current page howMany=6 if currentPage="" then 'if the current page don't exist then currentPage=0 'we set the current page to 0 gotoRec=0 'and we tell that we want to go to record 0 i=gotoRec else currentPage=currentPage-1 'if the current page exists we set it to what we took minus 1 because we count from 0 gotoRec=currentPage*howMany 'and we tell that we want to go to record currentPage*4 because i=gotoRec 'we see 4 products each time end if If not rsPhoto.eof then 'if the products are more than 0 then we go to the desired record rsPhoto.move gotoRec,0 if not totalProducts=0 then 'if the products are more than 0 then we can find how many totalPages=int(totalProducts/howMany) 'pages we will need if we want to show all the product spareproducts=totalProducts mod howMany 'four at each time if not spareproducts=0 then totalPages=totalPages+1 end if end if end if %> <% counter=0 do while i <% if counter mod 3 = 0 then %> <% end if %> <% rsphoto.movenext if not rsPhoto.eof then ' Response.Write("


") end if i=i+1 end if loop %>
')"> .jpg" border="0" style="border:1px solid black">
  • <%=rsPhoto("Code")%> / <%=rsPhoto("Title")%>
  • <% for pageCounter=1 to totalPages if not pageCounter=currentPage+1 then %> <%= pageCounter%> <% else %> <%= pageCounter%> <% end if if not pageCounter=totalPages then Response.Write(" | ") end if next %>
    Δείτε τα προϊόντα