<%@ Language=VBScript%> <%'option explicit 'Page/form name: futurecatalogueshows.asp 'Purpose : List of Future Catalogue Shows 'Date Modified: 18/07/2001 'Author :Vikas Agarwal %> <% Dim strsql Dim rs Dim strsql1 Dim rs1 Dim strsql2 Dim rs2 Dim var_cscode 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 catalogueshowcode, catalogueshowname, country " &_ "from catalogueshows_master " &_ "where catalogueshowcode in " &_ "(select catalogueshowscode from catalogueshows_schedule " &_ "group by catalogueshowscode " &_ "having convert(char(10),getdate(),112) < " &_ "convert(char(10),min(catalogueshowdate),112)) " &_ " " & whereclause1 & " " &_ "order by catalogueshowcode " strsql1 = "select distinct country from catalogueshows_master " &_ "where catalogueshowcode in (select catalogueshowscode from catalogueshows_schedule " &_ "group by catalogueshowscode " &_ "having convert(char(10),getdate(),112) < " &_ "convert(char(10),min(catalogueshowdate),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 %> Future Catalogue Shows Abroad - <%=Application("Title")%>
Home>Calendar>Program Calendar>Catalogue Shows  
Future Catalogue Shows Abroad
<%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_cscode = rs("catalogueshowcode")%> <%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("catalogueshowname")%> <% strsql2 = "select convert(char(10),catalogueshowdate,103) catalogueshowdate from catalogueshows_schedule " &_ "where catalogueshowscode = " & var_cscode & " " 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("catalogueshowdate"))%> <%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 Future Catalogue Shows Abroad
<%call pagination(iPageCount,whereclause1,var_country)%>
 
<%rs1.Close%> <% updatetable = "catalogueshows_master" updatewhereclause = " catalogueshowcode in (select max(catalogueshowscode) from catalogueshows_schedule group by catalogueshowscode having convert(char(10),getdate(),112) < convert(char(10),min(catalogueshowdate),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="futurecatalogueshows.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 %>