<% 'results per page constant Const NumPerPage = 20 If request.QueryString("page") = "" then CurrentPage = 1 'We're on the first page if request.querystring("ref") <> "" then use_ref = 1 session("use_ref") = request.querystring("ref") end if if request.querystring("key") <> "" then use_key = 1 session("use_key") = request.querystring("key") end if Else CurrentPage = CInt(request.QueryString("page")) End If dim sSQL strDBPath = Server.MapPath("/App_Data/brittons.mdb") Set cnnSimple = Server.CreateObject("ADODB.Connection") cnnSimple.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strDBPath & "; PWD=" Set rs = Server.CreateObject("ADODB.Recordset") if use_ref = 1 then sSQL = "SELECT * FROM Watches WHERE REF_NO = '" & session("use_ref") & "'" 'just show one from ref number else sSQL = "SELECT * FROM Watches ORDER by REF_NO DESC" 'show all ordered end if if use_key = 1 then sSQL = "SELECT * FROM Watches WHERE (make LIKE '%" & session("use_key") & "%' OR description LIKE '%" & session("use_key") & "%' OR ref_no LIKE '%" & session("use_key") & "%')" 'just show from keyword only else sSQL = "SELECT * FROM Watches ORDER by REF_NO DESC" 'show all ordered end if rs.Open sSQL, cnnSimple, 1, 1 Dim recCount, Count If Not rs.EOF Then rs.MoveLast recCount = rs.RecordCount rs.MoveFirst rs.PageSize = NumPerPage TotalPages = rs.PageCount rs.AbsolutePage = CurrentPage End If Dim v, RangeStart, RangeEnd RangeStart = ((rs.PageSize * CurrentPage) - rs.PageSize) + 1 v = recCount - (rs.PageSize * (CurrentPage - 1)) If v < rs.PageSize then RangeEnd = rs.PageSize * (CurrentPage - 1) + v Else RangeEnd = rs.PageSize * CurrentPage End if %>

 

<%if (use_ref = 0 and use_key = 0) then%>

Latest Watch Additions

<%end if%>

 

 

Displaying <%=RangeStart%> - <%=RangeEnd%> of <%=recCount%> Below:

<%If Not CurrentPage = 1 Then %> Goto Previous Page <%Else%> <%End If%>  |  <%If Not CurrentPage = TotalPages Then %> Goto Next Page <%Else%> <%End If%>



<%Do While Not rs.EOF AND Count < rs.PageSize%>

 

<%If rs.fields("ADD01").value <> "" then%> <%end if%>
s.jpg" border="0" cellpadding="0" cellspacing="0" width="100" height="200">
<%If (rs.fields("OUR_PRICE").value <> "" OR rs.fields("OUR_PRICE").value = "999999") then%>

.jpg" target="_blank" title="Click Me for a Closer Look!">

<%else%>

.jpg" target="_blank" title="Click Me for a Closer Look!">

<%end if%>

 

<%=rs.fields("GENDER").value%> <%=ucase(rs.fields("MAKE").value)%> (Circa <%=rs.fields("CIRCA").value%>)


    OUR PRICE: <%If rs.fields("OUR_PRICE").value <> "" then%> <%If rs.fields("OUR_PRICE").value = "999999" then%> POA <%else%> ', 0, 0, 600, 170, 0, 0, 0, 0, 0)" target="_self"><%=rs.fields("OUR_PRICE").value%> <%end if%> <%else%> SOLD <%end if%>
    NEW COST*: <%If rs.fields("NEW_COST").value <> "" then %>', 0, 0, 600, 170, 0, 0, 0, 0, 0)" target="_self"><%=rs.fields("NEW_COST").value%><% else response.write "N/A" end if %>
    SAVING: <%If ((rs.fields("OUR_PRICE").value <> "" AND rs.fields("OUR_PRICE").value <> "999999") AND rs.fields("NEW_COST").value <> "") then response.write int(100 - (100 / (rs.fields("NEW_COST").value / rs.fields("OUR_PRICE").value))) & "%" else response.write "N/A"%>
    REF #: <%=rs.fields("REF_NO").value%>
    HEAD: <%=rs.fields("HEAD_MATERIAL").value%>
    STRAP: <%=rs.fields("STRAP").value%>
    POWER: <%=rs.fields("POWER").value%>
    CONDITION: <%=rs.fields("CONDITION").value%>

<%If rs.fields("GENDER").value = "Gents" then%>

<%end if%> <%If rs.fields("GENDER").value = "Ladies" then%>

<%end if%> <%If rs.fields("GENDER").value = "Unisex" then%>

<%end if%>

mm (<%=int((rs.fields("HEAD_SIZE").value / 25.4) * 100) / 100%> inches)">.gif" width="40" height="40" border="0">

<% feet = replace(rs.fields("WATER").value, "m", "") if left(feet, 1) >= "1" AND left(feet, 1) <= "9" then feet = " (" & int(feet * 3.30) & " feet)" else feet = "" %>

">.gif" width="40" height="40" border="0">

 

    ADDTIONAL IMAGES:
<%If rs.fields("ADD01").value <> "" then%>    _ADD01.jpg" target="_blank">Click here to view Additional Image 1<%end if%> <%If rs.fields("ADD02").value <> "" then%>
    _ADD02.jpg" target="_blank">Click here to view Additional Image 2<%end if%> <%If rs.fields("ADD03").value <> "" then%>
    _ADD03.jpg" target="_blank">Click here to view Additional Image 3<%end if%> <%If rs.fields("ADD04").value <> "" then%>
    _ADD04.jpg" target="_blank">Click here to view Additional Image 4<%end if%> <%If rs.fields("ADD05").value <> "" then%>
    _ADD05.jpg" target="_blank">Click here to view Additional Image 5<%end if%> <%If rs.fields("ADD06").value <> "" then%>
    _ADD06.jpg" target="_blank">Click here to view Additional Image 6<%end if%> <%If rs.fields("ADD07").value <> "" then%>
    _ADD07.jpg" target="_blank">Click here to view Additional Image 7<%end if%> <%If rs.fields("ADD08").value <> "" then%>
    _ADD08.jpg" target="_blank">Click here to view Additional Image 8<%end if%> <%If rs.fields("ADD09").value <> "" then%>
    _ADD09.jpg" target="_blank">Click here to view Additional Image 9<%end if%> <%If rs.fields("ADD10").value <> "" then%>
    _ADD10.jpg" target="_blank">Click here to view Additional Image 10<%end if%>



<% rs.MoveNext Count = Count + 1 response.flush Loop %>

 

 

<%If Not CurrentPage = 1 Then %> Goto Previous Page <%Else%> <%End If%>  |  <%If Not CurrentPage = TotalPages Then %> Goto Next Page <%Else%> <%End If%>



 


<% rs.close Set rs = Nothing cnnSimple.Close Set cnnSimple = Nothing %>