<%@ Language=VBScript%> <%'option explicit 'Page/form name: pastseminar.asp 'Purpose : List of Past Seminars / Workshops 'Date Modified: 18/07/2001 'Author :Vikas Agarwal %> <% Dim strsql Dim rs Dim strsql1 Dim rs1 Dim strsql2 Dim rs2 Dim var_swcode Dim var_country 'Declare variables for pagination 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 iRecordsShown 'Loop controller for displaying just iPageSize records Dim whereclause1 'The where clause parameter to be passed in query string Dim I 'Standard looping var function selected (firstval, secondval) if firstval = secondval then selected = " SELECTED" end if end function iPageSize = Cint(Application("numrecords"))' set page size 'iPageSize = 10 ' could be changed If Request.QueryString("pgno") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("pgno")) End If If Request.QueryString("wherestring") = "" Then var_country = trim(Request.Form("country")) if var_country = "all" then whereclause1 = "" end if if var_country <> "" and var_country <> "all" then whereclause1 = " and country = '" & var_country & "'" else whereclause1 = "" end if else whereclause1 = Request.QueryString("wherestring") var_country = Request.QueryString("country") End If strsql = "select seminarcode, seminarname, country " &_ "from seminar_master " &_ "where seminarcode in " &_ "(select seminarcode from seminar_schedule " &_ "group by seminarcode " &_ "having convert(char(10),getdate(),112) > " &_ "convert(char(10),max(seminardate),112)) " &_ " " & whereclause1 & " " &_ "order by seminarcode " strsql1 = "select distinct country from seminar_master " &_ "where seminarcode in (select seminarcode from seminar_schedule " &_ "group by seminarcode " &_ "having convert(char(10),getdate(),112) > " &_ "convert(char(10),max(seminardate),112)) " set rs = server.CreateObject("ADODB.Recordset") set rs1 = server.CreateObject("ADODB.Recordset") set rs2 = server.CreateObject("ADODB.Recordset") ' set the page size rs.PageSize = iPageSize 'set the cache size rs.CacheSize = iPageSize on error resume next rs.Open strsql, objconn,3,3 if err.number <> 0 then Response.Redirect "/inc/commoninc/error.asp?errorno=err.number" Response.End end if on error goto 0 on error resume next rs1.Open strsql1, objconn if err.number <> 0 then Response.Redirect "/inc/commoninc/error.asp?errorno=err.number" Response.End end if on error goto 0 ' Get the count of the pages using the given page size iPageCount = rs.PageCount %> Past Seminars / Workshops - <%=Application("Title")%>
Home>Calendar>Program Calendar>Seminars  
Past Seminars / Workshops
<%If iPageCount <> 0 Then rs.AbsolutePage = cint(iPageCurrent) iRecordsShown = 0 if not rs.EOF and not rs.BOF then do while not rs.EOF and iRecordsShown < iPageSize var_swcode = rs("seminarcode")%> <%iRecordsShown = iRecordsShown + 1 rs.movenext loop end if end if if rs.EOF and rs.BOF and ipagecount = 0 then rs.close%> <%end if%>
Name and Date(s) *
<%=rs("seminarname")%> <% strsql2 = "select convert(char(10),seminardate,103) seminardate from seminar_schedule " &_ "where seminarcode = " & var_swcode & " " on error resume next rs2.Open strsql2, objconn if err.number <> 0 then Response.Redirect "/inc/commoninc/error.asp?errorno=err.number" Response.End end if on error goto 0%>
<%if not rs2.EOF and not rs2.BOF then rs2.MoveFirst do while not rs2.EOF %> <%=trim(rs2("seminardate"))%> <%if not rs2.EOF then rs2.MoveNext%> <%end if%> <%if not rs2.EOF then%> <%end if%> <%loop end if rs2.Close%>
<%=rs("country")%>
There are no Past Seminars / Workshops
<%call pagination(iPageCount,whereclause1,var_country)%>
* Participation on first come first basis. Date subject to change.
 
<%rs1.Close%> <% updatetable = "seminar_master" updatewhereclause = " seminarcode in (select max(seminarcode) from seminar_schedule group by seminarcode having convert(char(10),getdate(),112) > convert(char(10),max(seminardate),112))" %> <% Function pagination(rsmaxpages,keywords,pass_country) Dim intstartpage ' starting page Dim intendpage ' Ending Page Dim intPageNo 'intpageno the Current Page No. Dim Maxpages ' set it to the recordset.pagecount Dim Maxpageset ' set it to one set Dim pagestring ' set it to pagestring ' Setting Maxpages = Recordset Maxpages maxpages=rsmaxpages ' If pgno is not there is querystring then set it to 1 if len(trim(Request("pgno"))) > 0 then intpageno=Request("pgno") else intpageno=1 end if ' Defining the PageString Here ' Change this pagestring="pastseminar.asp?wherestring=" & Server.URLEncode(keywords) & "&country=" & Server.URLEncode(pass_country) & "&pgno=" ' Defining the MaxPageSet Here ' Change This maxpageset=10 'Initializing maxpages to the Record ' Change the Recordset Name maxpages = rsmaxpages if ((intpageno/maxpageset)=(intpageno\maxpageset)) then if (Cint(intendpage)>=Cint(maxpages)) then intendpage=maxpages else intendpage = ((maxpageset)*(intpageno\maxpageset)) intstartpage = intendpage-maxpageset+1 end if else intstartpage = ((maxpageset)*(intpageno\maxpageset))+1 intendpage = intstartpage+maxpageset-1 end if ' For Restricting the records in case the maxpageset is more than the maxpages if maxpageset > maxpages then intendpage = maxpages end if ' For Restricting the records in case the intendpage is more than the maxpages if intendpage > maxpages then intendpage = maxpages end if if (Cint(intstartpage)" if not(Cint(intpageno)=1) then Response.write "" & "«Prev" & "" & "  " end if For I = Cint(intstartpage) to Cint(intendpage) if Not (maxpages=1) then if (I = Cint(intpageno)) then ' if it is the current page disable the Link Response.write I & "  " else Response.write "" & I & "" & "  " end if End if Next ' Next Processing if not(Cint(intpageno)>=Cint(maxpages)) then Response.write "" & "Next »" & "" & "  " end if Response.write "" End if end function %>