 |
Eilat Friendly Tours
Are On line 24 hours a day! Communicate to our friendly experts one on one. Ask anything about Hotels, Attractions, Tours, Diving or anything else to help you plan your vacation here in Eilat from the comfort of your own home. |
 |
|
|
<% if request("mode")="sent" then %>
Your message was sent successfuly |
<% end if %>
| MESSAGES |
 |
[Add Your Message +] |
|
|
<%
' BEGIN RUNTIME CODE
' Declare our vars
Dim iPageSize 'How big our pages are
Dim iPageCount 'The number of pages we get back
Dim iPageCurrent 'The page we want to show
Dim strOrderBy 'A fake parameter used to illustrate passing them
Dim strSQL 'SQL command to execute
Dim objPagingConn 'The ADODB connection object
Dim objPagingRS 'The ADODB recordset object
Dim iRecordsShown 'Loop controller for displaying just iPageSize records
Dim I 'Standard looping var
' Get parameters
iPageSize = 5
' You could easily allow users to change this
' Retrieve page to show or default to 1
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
If Request.QueryString("order") = "" Then
strOrderBy = "dates desc"
Else
strOrderBy = Request.QueryString("order")
End If
strSQL = "SELECT * FROM gbook where hide=1 ORDER BY " & strOrderBy & ";"
rs.PageSize = iPageSize
rs.CacheSize = iPageSize
rs.Open strSQL,,3,1
' Get the count of the pages using the given page size
iPageCount = rs.PageCount
' If the request page falls outside the acceptable range,
' give them the closest match (1 or max)
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
' Start output with a page x of n line
%>
<%
'Check page count to prevent bombing when zero results are returned!
If iPageCount = 0 Then
%>
| No messages found. Be the first to write a message! |
<%
Else
%>
| Page No <%= iPageCurrent %> of <%= iPageCount %>
|
<%
' Move to the selected page
rs.AbsolutePage = iPageCurrent
iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not rs.EOF
%>
|
<%=rs("dates")%> |
|
SENDER: <%=rs("name")%> |
|
|
<%=rs("content")%>
|
|
|
|
|
<%
' Increment the number of records we've shown
iRecordsShown = iRecordsShown + 1
' Can't forget to move to the next record!
rs.MoveNext
Loop
'End If
' Close DB objects and free variables
rs.Close
Set rs = Nothing
' Show "previous" and "next" page links which pass the page to view
' and any parameters needed to rebuild the query. You could just as
' easily use a form but you'll need to change the lines that read
' the info back in at the top of the script.
If iPageCurrent > 1 Then
%>
Back
<%
End If
' You can also show page numbers:
For I = 1 To iPageCount
If I = iPageCurrent Then
%>
<%= I %>
<%
Else
%>
<%= I %>
<%
End If
Next 'I
If iPageCurrent < iPageCount Then
%>
Next
<%
End If
' END RUNTIME CODE
%>
|
| |
|