if request.cookies("okadmin")="" then
response.redirect "../7dilogin.asp"
end if
%>
dim MaxPerPage
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
name=trim(request("keyword"))
name=replace(name,"'","''")
if name="" then
response.write"查找项目不能为空,请重输入查找的信息然后点击“查询”"
response.end
else
sql="select * from gq where subject Like '%"& name &"%' or memo like '%"& name &"%' or phone like '%"& name &"%' or address like '%"& name &"%' or code like '%"& name &"%' or name like '%"& name &"%' or email Like '%"& name &"%'or gs Like '%"& name &"%'order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
end if
if rs.eof then
response.write"没有你要查找的信息,请返回重查。"
response.end
else
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
rs.pagesize=10 '每页显示的记录数量
totalPut=rs.recordcount '记录总数
totalPage=rs.pagecount
MaxPerPage=rs.pagesize
if currentpage currentpage=1
end if
if currentpage>totalPage then
currentpage=totalPage
end if
if currentPage=1 then
showpages
showContent
showpages1
else
if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移动到开始显示的记录位置
showpages
showContent
showpages1
else
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i,j
%>
do while not (rs.eof or err)
if i mod 2 0 then %>
【】
【】
(?)(地区)
(?)【详细信息...】
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
i=i+1
rs.movenext
loop
%>
sub showpages()
%>
共查询到页/条信息
end sub
sub showpages1()
dim n
n=totalPage
%>
If currentPage 1 Then
Response.Write " 第一页 "
Response.Write " 上一页 "
End If
If currentPage rs.PageCount Then
Response.Write " 下一页 "
Response.Write " 最后一页 "
End If
%>第页/共页 for i=1 to n
response.write " if currentpage=i then
response.write " selected"
end if
response.write ">"& i &""
next
response.write ""
response.write ""
response.write " "
%>