%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsDesigns__MMColParam
rsDesigns__MMColParam = "1"
If (Request.QueryString("Web_Budget") <> "") Then
rsDesigns__MMColParam = Request.QueryString("Web_Budget")
End If
%>
<%
Dim rsDesigns
Dim rsDesigns_numRows
imagepathLO = "Renderings_LO/"
imagepathMD = "Renderings_MD/"
imagepathHI = "Renderings_HI/"
imagepathTH = "Renderings_TH/"
imagepathZIP = "Renderings_ZIP/"
'code added by rohit for paging
'declare variables
Dim Currpage, pageLen, lastNumber, PageRem, PageTen
Dim connection, sSQL, sConnString, next10, prev10, P
Dim RSPrevPage, RSNextPage, start
'Get the current page the user is on, if it's the first time they
'visit and the variable 'PageNo' is empty, then 'CurrPage' gets set to 1
'Else the current page variable 'CurrPage' is set to the page number requested
If IsEmpty(Request.Querystring("PageNo")) then
CurrPage = 1
Else
CurrPage = Cint(Request.Querystring("PageNo"))
End If
'the two functions below return the next 10 and prev 10 page number
Function getNext10(num)
pageLen = len(num)
If pageLen = 1 Then
next10 = 10
Else If pageLen>1 Then
pageRem = 10
pageTen = right(num, 1)
next10 = num + pageRem - pageTen
End If
End If
getNext10 = next10
End Function
Function getPrev10(num)
pageLen = len(num)
If pageLen = 1 then
prev10 = 1
Else If pageLen>1 then
lastNumber = right(num, 1)
prev10 = num - lastNumber - 10
End If
End If
If prev10 = 0 then
prev10 = 1
End If
getPrev10 = prev10
End Function
Set rsDesigns = Server.CreateObject("ADODB.Recordset")
rsDesigns.ActiveConnection = MM_AbexDesignsNew_STRING
rsDesigns.Source = "SELECT * FROM Table_Renderings WHERE Web_Budget = '" + Replace(rsDesigns__MMColParam, "'", "''") + "' ORDER BY Project_Sort DESC"
rsDesigns.CursorType = 0
rsDesigns.CursorLocation = 3
rsDesigns.LockType = 1
rsDesigns.Open()
if request("pagesize") = "" then
rsDesigns.PageSize = 25
else
rsDesigns.PageSize = request("pagesize")
end if
If not rsDesigns.EOF Then
rsDesigns.AbsolutePage = CurrPage
End if
next10 = getNext10(CurrPage)
prev10 = getPrev10(CurrPage)
rsDesigns_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 25
Repeat1__index = 0
rsDesigns_numRows = rsDesigns_numRows + Repeat1__numRows
%>
Search results for budget $<%= Request.QueryString("Web_Budget") %>...
<%
RSPrevPage = CurrPage -1
RSNextPage = CurrPage + 1
If Next10 > rsDesigns.PageCount Then
Next10 = rsDesigns.PageCount
End If
If prev10 = 1 AND next10 - 1 < 10 Then
start = 1
Else
start = Next10 - 10
If right(start, 1) > 0 Then
start = replace(start, right(start, 1), "0")
start = start + 10
End If
End If
%>
Record Per Page
<%
'This checks to make sure that there is more than one page of results
If rsDesigns.PageCount > 1 Then
'Work out whether to show the Previous 10 '<<'
'If currpage > 1 Then
response.write("« ")
'End If
'Work out whether to show the Previous link '<'
If NOT RSPrevPage = 0 then
response.write("< ")
End If
'Loop through the page number navigation using P as our loopcounter variable
For P = start to Next10
If NOT P = CurrPage then
response.write("" & P & " ")
Else
'Don't hyperlink the current page number
response.write(" " & P & " ")
End If
Next
'this does the same as the "previous" link, but for the "next" link
If NOT RSNextPage > rsDesigns.PageCount Then
response.write("> ")
End If
'Work out whether to show the Next 10 '>>'
'If NOT Next10 = rsDesigns.PageCount Then
response.write(" »")
'End If
End If%>
<%Response.write "Now Displaying" & CurrPage*rsDesigns.PageSize + 1 - rsDesigns.PageSize & " to "
if CurrPage*rsDesigns.PageSize > rsDesigns.recordcount then
response.write rsDesigns.recordcount
else
response.write CurrPage*rsDesigns.PageSize
end if
response.write " of " & rsDesigns.recordcount & " Records "%>
<%
'While ((Repeat1__numRows <> 0) AND (NOT rsDesigns.EOF))
Do Until cint(rsDesigns.AbsolutePage) <> cint(CurrPage) OR rsDesigns.Eof
%>
<%
'This checks to make sure that there is more than one page of results
If rsDesigns.PageCount > 1 Then
'Work out whether to show the Previous 10 '<<'
'If currpage > 1 Then
response.write("« ")
'End If
'Work out whether to show the Previous link '<'
If NOT RSPrevPage = 0 then
response.write("< ")
End If
'Loop through the page number navigation using P as our loopcounter variable
For P = start to Next10
If NOT P = CurrPage then
response.write("" & P & " ")
Else
'Don't hyperlink the current page number
response.write(" " & P & " ")
End If
Next
'this does the same as the "previous" link, but for the "next" link
If NOT RSNextPage > rsDesigns.PageCount Then
response.write("> ")
End If
'Work out whether to show the Next 10 '>>'
'If NOT Next10 = rsDesigns.PageCount Then
response.write(" »")
'End If
End If%>
<%Response.write "Now Displaying" & CurrPage*rsDesigns.PageSize + 1 - rsDesigns.PageSize & " to "
if CurrPage*rsDesigns.PageSize > rsDesigns.recordcount then
response.write rsDesigns.recordcount
else
response.write CurrPage*rsDesigns.PageSize
end if
response.write " of " & rsDesigns.recordcount & " Records "%>