<%@Language=VBScript%> <% Dim oRS Dim strSQLNew Dim oTemplate 'now get recordset from clsmydb set mBotanic=new clsmydb '******************************************************************************* 'now start query 'make a selection from parameter form maxRes=500 cSize=5 if (Request.QueryString("BotanicName")="") and (Request.QueryString("GenusName")="") then loadContent= "Error retreiving data or you dont enter some keyword" loadContent=loadContent & "
Press Back to Return" else if (Request.QueryString("BotanicName")<>"" OR Request.QueryString("GenusName")<>"") then if not (Request.QueryString("BotanicName")="") then 'if method post change it strSQLNew="SELECT SpID, taxa, SpeciesName" strSQLNew=strSQLNew & " FROM qryBotanicNames" strSQLNew=strSQLNew & " WHERE taxa LIKE '%" & Ucase(Request.QueryString("BotanicName")) & "%'" 'if method post change it strSQLNew=strSQLNew & " ORDER BY taxa;" set oRS=mBotanic.GetList(strSQLNew,maxRes,cSize) elseif not (Request.QueryString("GenusName")="")then 'if method post change it strSQLNew="SELECT SpID, taxa, SpeciesName" strSQLNew=strSQLNew & " FROM qryBotanicNames" strSQLNew=strSQLNew & " WHERE Genus Like '" & Request.QueryString("GenusName") & "'" strSQLNew=strSQLNew & " ORDER BY taxa" set oRS=mBotanic.GetList(strSQLNew,maxRes,cSize) end if 'after make query now fill the content currentPage=Request.QueryString("whichpage") 'if method post change it If currentPage="" Then currentPage=1 End If pageSize=Request.QueryString("pagesize") 'if method post change it If pageSize="" Then pageSize=10 End If loadContent="

Botanic names

" loadContent=loadContent & "
" if (oRS.BOF and oRS.EOF) then loadContent=loadContent & "

No botanic names were found for your search.

" 'Response.End() else 'now count total of recordset oRS.MoveFirst Do while not oRS.Eof TotalRec=TotalRec+1 oRS.MoveNext Loop if TotalRec >=1 then loadContent=loadContent & "" loadContent=loadContent & "" else loadContent=loadContent & "

No botanic names were found for your search.

" end if end if loadContent=loadContent & "
" oRS.MoveFirst oRS.PageSize=pageSize PageCount = CInt(oRS.PageCount) If PageCount > CInt(maxRes / PageSize) Then maxCount = CInt(maxRes / PageSize) Else maxCount = PageCount End If oRS.AbsolutePage=currentPage loadContent=loadContent & "

Your search found " & TotalRec & " botanic names. The current name is listed for each botanic name. Click on the current name for information on species.

" loadContent=loadContent & "

Page " & currentPage & " of " & maxCount & "

" loadContent=loadContent & "" loadContent=loadContent & "" loadContent=loadContent & "" loadContent=loadContent & "" loadContent=loadContent & "" TotalRes=0 Do while not oRS.Eof and TotalRes < oRS.PageSize loadContent=loadContent & "" loadContent=loadContent & "" loadContent=loadContent & "" loadContent=loadContent & "" oRS.MoveNext TotalRes=TotalRes+1 Loop loadContent=loadContent & "
" loadContent=loadContent & "Synonim name" loadContent=loadContent & "" loadContent=loadContent & "Current name" loadContent=loadContent & "
" & oRS.fields("taxa") & "" & oRS.fields("SpeciesName") & "
" loadContent=loadContent & "
" loadContent=loadContent & "
" if not (Request.QueryString("BotanicName")="") then pad = "0" Scriptname = Request.ServerVariables("script_name") For pgCounter=1 to maxCount If pgCounter>=10 then pad="" ref="" & pad & pgcounter & "  " loadContent=loadContent & ref & " " Next elseif not (Request.QueryString("GenusName")="")then pad = "0" Scriptname = Request.ServerVariables("script_name") For pgCounter=1 to maxCount If pgCounter>=10 then pad="" ref="" & pad & pgcounter & "  " loadContent=loadContent & ref & " " Next else loadContent=loadContent & "error raised! please contact the admin" end if If PageCount > CInt(maxRes / PageSize) Then loadContent=loadContent & "
" loadContent=loadContent & "You will see only the first " & maxRes & " of Data. " loadContent=loadContent & "Please specify better the names you're interested in, or " loadContent=loadContent & "use the Detailed Search Menu" loadContent=loadContent & "
" End If set oRS=nothing '******************************************************************************* else loadContent=loadcotent & "Error retreiving data or you dont enter some keyword" loadContent= loadcontent & "
Press Back to Return" 'Response.End() end if end if set mBotanic = nothing '******************************************************************************* 'now assign for template set oTemplate = new template_cls const TMPLDIR = "../templates/tmpl/" with oTemplate .TemplateFile = TMPLDIR & "main.html" .AddToken "title", 1, "List Botanic Name" .AddToken "content", 1,"" & loadContent & "" .parseTemplateFile end with set oTemplate = nothing 'end of this job %>