|
 |

|
MEMBERS |
| |
|
<%
Dim sqlQuery, page, TotalPage, totalRecord, n, qrystr, footer, sql
Dim intStart ' The record that we are starting on.
Dim intFinish,intRecord ' The record that we are finishing on.
'Dim rsresult
footer=1
n=1
page=1
totalpage=1
If Request.QueryString("NAV") = "" Then
Page = 1
Else
Page = Request.QueryString("NAV")
End If
sql="Select OrgId, OrgName, Address, WorkPhone, ResiPhone, Fax, MobileNos, ContactPerson, Designation, TypeofOrg, CatOfInd, Products, WorkAddress, EMail, HTMLLink From Party, Category where Party.CatId=" & Request.Form("category") & " and Party.CatId=Category.CatId"
keyword=Split(request.Form("product"),",")
if Request.Form("product")<>"" then
Dim Z
z=1
For Each item In keyword
if z=1 then
sql= sql + " and (Products like '%" & trim(item) & "%'"
z=2
else
sql= sql + " or Products like '%" & trim(item) & "%'"
end if
next
if z=2 then
sql=sql+")"
end if
'sql=sql + " and Products like '%" & trim(Request.Form("product")) & "%'"
end if
if Request.QueryString("mode")="search" then
Response.Cookies("nsql")=sql
else
sql=request.Cookies("nsql")
end if
set rsresult=server.CreateObject("adodb.recordset")
'response.Write(sql)
rsresult.Open sql,con,1
if rsresult.recordCount<>0 then
%>
| <%
rsresult.pagesize=5
rsresult.CacheSize = rsresult.PageSize
totalPage = rsresult.PageCount
totalRecord = rsresult.RecordCount
If CInt(Page) > CInt(TotalPage) Then Page = TotalPage
If CInt(Page) <= 0 Then Page = 1
If totalRecord > 0 Then
rsresult.AbsolutePage = Page
intStart = rsresult.AbsolutePosition
If CInt(Page) = CInt(intPageCount) Then
intFinish = totalRecord
Else
intFinish = intStart + (rsresult.PageSize - 1)
End if
End If
response.Write("Page: "&Page)
response.Write(" of "&totalPage)
'End if
'End if
If cInt(Page) > 1 Then
%>
<< Prev
<% End IF %>
<%
If cInt(Page) < cInt(TotalPage) Then
%>
| Next >>
<% End If%>
|
<%response.Write("Search results: "&rsresult.recordcount)%>
|
<%
For intRecord = 1 to rsresult.PageSize
pageCount1=PageCount1+1
%>
<%
rsresult.MoveNext
If rsresult.EOF Then Exit for
Next
else
footer=2
response.Write("
Sorry No record found for this searching criteria. Refine your search for better results.
")
End If
%> |
|