% '// if trim(Session("data")) = "" then response.redirect "adminlogin.asp" '// if trim(Session("UserName"))="" then response.redirect "adminlogin.asp" 'sVillage = request.querystring("village") 'sMandal = request.querystring("mandal") 'sDistrict = request.querystring("district") 'sState = request.querystring("state") sVillage = request("village") 'sMandal = request("mandal") sDistrict = request("district") sState = request("state") ' response.write(sVillage) Dim string string="SELECT VILLAGE, MANDAL, DISTRICT, STATE FROM HISTORYALL WHERE " if(Len(sVillage)>0) then string=string& " VILLAGE LIKE '"&sVillage&"%' " end if 'if(Len(sMandal)>0) then ' string=string& " AND MANDAL LIKE '"&sMandal&"%' " 'end if if(Len(sDistrict)>0) then if(Len(sVillage)>0) then string=string& " AND " end if string=string& " DISTRICT LIKE '"&sDistrict&"%' " end if if(Len(sState)>0) then if(Len(sVillage)>0) then string=string& " AND STATE LIKE '"&sState&"%'" elseif(Len(sDistrict)>0) then string=string& " AND STATE LIKE '"&sState&"%'" else string=string& " STATE LIKE '"&sState&"%' " end if end if if(Len(sVillage)<1) then if(Len(sMandal)<1) then if(Len(sDistrict)<1) then if(Len(sState)<1) then string="SELECT VILLAGE, MANDAL, DISTRICT, STATE FROM HISTORYALL " end if end if end if end if ' response.write(string) %> <% Function GetPreviousStart(nStart) Dim nPrevStart if cint(nStart) > NUMBERTOSHOW then nPrevStart=nStart - NUMBERTOSHOW else nPrevStart=1 end if GetPreviousStart = nPrevStart End Function Function GetNextStart(nStart) GetNextStart = nStart + NUMBERTOSHOW End Function Function MoveToPosition(rsResults,nStart) Dim Successful Dim i Successful=False if not rsResults.eof and not rsResults.bof then if nStart >= 1 then for i = 1 to nStart - 1 if not rsResults.eof then rsResults.movenext else ShowLastSet exit for end if next Successful = True end if end if MoveToPosition = Successful End Function Sub ShowLastSet() Dim i for i = 1 to NUMBERTOSHOW-1 if not rsResults.bof then rsResults.moveprevious else exit for end if next End Sub '**************************************************************** 'Set up the database here using "rsResults" as the recordset '**************************************************************** Set DataCmd = Server.CreateObject("ADODB.Command") DataCmd.ActiveConnection = Session("data") DataCmd.CommandType = adCmdText DataCmd.CommandText = string Set rsResults = Server.CreateObject("ADODB.Recordset") rsResults.Open DataCmd NUMBERTOSHOW = 10 'comment this line out if the user is allowed to choose the number shown if not isnumeric(NUMBERTOSHOW) then response.write"You must set the number to show to be greater than 0. Try again." response.end end if if NUMBERTOSHOW<=0 then response.write"You must set the number to show to be greater than 0. Try again." response.end end if if request.form("PREVIOUS").count>0 then if not isempty(session("PREVSTART")) then gnStart = session("PREVSTART") else 'session variable timed out gnStart = 1 end if elseif request.form("NEXT").count>0 then if not isempty(session("NEXTSTART")) then gnStart = session("NEXTSTART") else 'session variable timed out gnStart = 1 end if else gnStart = 1 end if if MoveToPosition(rsResults,gnStart) then %>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Donate | History | Concept | Resources | Projects | know your village | Login | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|