% ACTION = Request.Form("ACTION") %> <% Session("ConnGuestBook_ConnectionString") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("..\..\db\seminars.mdb") Session("ConnGuestBook_ConnectionTimeout") = 15 Session("ConnGuestBook_CommandTimeout") = 30 Session("ConnGuestBook_RuntimeUserName") = "admin" Session("ConnGuestBook_RuntimePassword") = "" %> <% ACTION = Request.Querystring("ACTION") %> <% PAGE = CInt(Request.Querystring("PAGE")) %> <% RCOUNT = CInt(Request.Querystring("RCOUNT")) %> <% If RCOUNT = "" Then %> <% RCOUNT = "0" %> <% End If %> <% Dim CmdShowEntries Dim MySQL, strSort strSort=Request("lstSort") If strSort="" then strSort="DateFrom" End If '** Get initial recordset Set CmdShowEntries = Server.CreateObject("ADODB.Recordset") MySQL = "SELECT * FROM Seminar WHERE Approve=False ORDER BY " & strSort & " DESC" CmdShowEntries.Open MySQL,Session("ConnGuestBook_ConnectionString"), 3 %> <% HOWMANY = 10 %> <% '** Determine Page Size CmdShowEntries.PageSize = HOWMANY %> <% If ACTION = "FORWARD" Then %> <% PAGE = PAGE + 1 %> <% RCOUNT = RCOUNT + HOWMANY %> <% For DACOUNT = 1 To RCOUNT %> <% CmdShowEntries.MoveNext %> <% Next %> <% End If %> <% If ACTION = "BACK" Then %> <% PAGE = PAGE - 1 %> <% RCOUNT = RCOUNT - HOWMANY %> <% If RCOUNT <> 0 Then %> <% For DACOUNT = 1 To RCOUNT %> <% CmdShowEntries.MoveNext %> <% Next %> <% End If %> <% End If %> <% If RCOUNT = "0" Then %> <% PAGE = 1 %>
<% If CmdShowEntries.RecordCount > 1 or CmdShowEntries.RecordCount = 0 Then %> <% =CmdShowEntries.RecordCount %> Seminars Found <% Else %> <% =CmdShowEntries.RecordCount %> Seminars Found <% End If %> <% If CmdShowEntries.RecordCount <> 0 And HOWMANY < CmdShowEntries.RecordCount Then %> , Showing First <% = HOWMANY %> <% End If %>
<% End If %> <% If NOT CmdShowEntries.RecordCount = 0 Then %>
| <%= CmdShowEntries("Country") %><%= ", " & CmdShowEntries("City") %> | <%= CmdShowEntries("DateFrom") & " - " & CmdShowEntries("DateTo")%> | |
<%=CmdShowEntries("Speaker")%> |
||
| " class="smallfont">Edit - " class="smallfont">Delete | ||
| <% If RCOUNT > 0 Then %> <% End If %> | <% If PAGE = CmdShowEntries.PageCount Then %> <% Else %> <% End If %> <%CmdShowEntries.Close set cmdShowEntries=Nothing%> |