关于分页显示


 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询</title>
</head>

<body>
<!--#include file="conn.asp"-->
<%dim word,page,searchbiao,keyword
response.Cookies("word")=request("word")
response.Cookies("keyword")=request("keyword")
response.Cookies("searchbiao")=request("searchbiao")
response.cookies("page")=request("page")
if request("word")="" or request("word")="" or request("searchbiao")="" then
response.write "请输入完整的资料"
else

word=request("word")
searchbiao=request("searchbiao")
keyword=request("keyword")
page=request("page")
select case searchbiao
case "成长"
sql="select * from 成长 "
case "估值"
sql="select * from 估值 "
case "客户资料"
sql="select * from 客户资料 "
case "每日"
sql="select * from 每日 "
end select
select case keyword
case "1"
sql=sql&"where 姓名  like '%"&word&"%'"
case "2"
sql=sql&"where 业务员 like '%"&word&"%'"
case "3"
sql=sql&"where 电话  like '%"&word&"%'"
'case "4"
'sql=sql&"where 录入人 like '%"&word&"%'"
case "5"
sql=sql&"where 录入时间 like '%"&word&"%'"
case "6"
sql=sql&"where 备注  like '%"&word&"%'"
case "7"
sql=sql&"where 邮箱 like '%"&word&"%'"
case "8"
sql=sql&"where 地址 like '%"&word&"%'"
end select

set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
page=int(request("page"))
pages=rs.pagecount
rs.pagesize=10
if page<=0 or page="" then page=1
rs.AbsolutePage=page
%>
<form action="research11.asp" method="post" target="_self">
  <p align="center">
    <select name="keyword" class="select">
 <% if keyword="" then%>
  <option value="" selected> 请输入选择想要查询的关键字</option>
 <% else%>
  <option value="" > 请输入选择想要查询的关键字</option>
 <%end if %>
 <%if keyword="1" then%>
      <option value="1" selected>姓名</option>
   <%else%>
   <option value="1" >姓名</option>
   <%end if%>
   <% if keyword="2" then%>
      <option value="2" selected>业务员</option>
   <%else%>
    <option value="2" >业务员</option>
    <%end if%>
    <%if keyword="3" then%>
   <option value="3" selected>电话</option>
   <%else%>
   <option value="3" >电话</option>
   <%end if%>
   <%if keyword="8" then%>
      <option value="8" selected>地址</option>
   <%else%>
    <option value="8" >地址</option>
    <%end if%>
    <%if keyword="5" then%>
      <option value="5" selected>录入时间</option>
   <%else%>
   <option value="5" >录入时间</option>
   <%end if%>
   <%if keyword="6" then%>
      <option value="6" selected>备注</option>
   <%else%>
    <option value="6" >备注</option>
    <%end if%>
    <%if keyword="7" then%>
      <option value="7" selected>E-mail</option>
   <%else%>
    <option value="7" >E-mail</option>
    <%end if%>
    </select>
    <select name="searchbiao" class="select2">
 <% if searchbiao="" then%>
 <option value="" selected>请选择表</option>
 <%else%>
 <option value="" >请选择表</option>
 <%end if%>
 <%if searchbiao="客户资料"then %>
      <option value="客户资料" selected>客户资料</option>
      <%else%>
   <option value="客户资料" >客户资料</option>
   <%end if%>
   <%if searchbiao="每日" then%>
   <option value="每日" selected>每日</option>
   <%else%>
   <option value="每日" >每日</option>
   <%end if%>
   <%if searchbiao="成长" then %>
      <option value="成长" selected>成长</option>
   <%else%>
   <option value="成长">成长</option>
   <%end if%>
   <%if searchbiao="估值" then %>
      <option value="估值" selected>估值</option>
   <%else%>
     <option value="估值">估值</option>
  <%end if%>
    </select>
 
    <input name="word" type="text" value="<%=word%>">
 <input type="submit" value="查询">
</form>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td width="74" bgcolor="#FFFFFF" height="23" background="images/bg1.gif">
        <p align="center"><strong>姓名</strong></td>
 
      <td width="50" align="center" background="images/bg1.gif" bgcolor="#FFFFFF"><div align="center"><strong>性别</strong></div></td>
      <td width="101" bgcolor="#FFFFFF" height="23" background="images/bg1.gif" align="center" valign="middle"><strong>电话</strong></td>
      <td width="171" bgcolor="#FFFFFF" height="23" background="images/bg1.gif" align="center" valign="middle"><strong>地址</strong></td>
      <td width="64" bgcolor="#FFFFFF" height="23" background="images/bg1.gif" align="center" valign="middle"><strong>业务员</strong></td>

   <td width="86" bgcolor="#FFFFFF" background="images/bg1.gif" align="center" valign="middle"><strong>录入时间</strong></td>
      <td width="126" bgcolor="#FFFFFF" height="23" background="images/bg1.gif" align="center" valign="middle"><strong>备注</strong></td>
      <td width="64" bgcolor="#FFFFFF" background="images/bg1.gif" align="center" valign="middle"><strong>join</strong></td>
   
   
      <td width="64" bgcolor="#FFFFFF" height="23" background="images/bg1.gif" align="center" valign="middle"><b>管理</b></td>
  
    </tr>


  <% if rs.eof and rs.bof then
response.write "暂时没有任何资料记录!"
%>

 

<% else %>

<% if rs.pagesize<rs.recordcount then
for j=1 to rs.PageSize%>
<tr>
<td width="54" bgcolor="#FFFFFF" height="20" align="center"><%=rs("姓名")%></td>
      <td width="30" bgcolor="#FFFFFF" align="center" title="录入时间是:<%=rs("录入时间")%>"><%=rs("性别")%></td>
      <td width="101" bgcolor="#FFFFFF" height="20" align="center"><%=rs("电话")%></td>
      <td width="171" bgcolor="#FFFFFF" height="20"><div align="center"><%=rs("地址")%></div></td>
      <td width="64" bgcolor="#FFFFFF" height="20" align="center"><%=rs("业务员")%></td>

   <td width="86" bgcolor="#FFFFFF" height="20" align="center"><%=rs("录入时间")%></td>
      <td width="126" height="20" align="center" bgcolor="#FFFFFF"><div align="center"></div>       
        <div align="center"><%=rs("备注")%></div></td>
   <td width="66" bgcolor="#FFFFFF" height="20" align="center">
   <%if session("flag")=true then%>
   <a href=adpassm.asp?id=<%=rs("电话")%>><font color="blue">join</font></a></td>
      <%end if%>
      <td width="64" bgcolor="#FFFFFF" height="20" align="center">
    
   <a href="editsear.asp?id=<%=rs("id")%>&searchbiao=<%=searchbiao%>">编</a>|<a href="delsearch.asp?id=<%=rs("id")%>&searchbiao=<%=searchbiao%>"><font color="red">删</font></a>
    </td>
  </tr>
<%rs.movenext%>

<%  next%>
<% else
for i=1 to rs.recordcount%>
<tr>
<td width="54" bgcolor="#FFFFFF" height="20" align="center"><%=rs("姓名")%></td>
      <td width="30" bgcolor="#FFFFFF" align="center" title="录入时间是:<%=rs("录入时间")%>"><%=rs("性别")%></td>
      <td width="101" bgcolor="#FFFFFF" height="20" align="center"><%=rs("电话")%></td>
      <td width="171" bgcolor="#FFFFFF" height="20"><div align="center"><%=rs("地址")%></div></td>
      <td width="64" bgcolor="#FFFFFF" height="20" align="center"><%=rs("业务员")%></td>

   <td width="86" bgcolor="#FFFFFF" height="20" align="center"><%=rs("录入时间")%></td>
      <td width="126" height="20" align="center" bgcolor="#FFFFFF"><div align="center"></div>       
        <div align="center"><%=rs("备注")%></div></td>
   <td width="66" bgcolor="#FFFFFF" height="20" align="center">
   <%if session("flag")=true then%>
   <a href=adpassm.asp?id=<%=rs("电话")%>><font color="blue">join</font></a></td>
      <%end if%>
      <td width="64" bgcolor="#FFFFFF" height="20" align="center">
    
  <a href="editsear.asp?id=<%=rs("id")%>&searchbiao=<%=searchbiao%>">编</a>|<a href="delsearch.asp?id=<%=rs("id")%>&searchbiao=<%=searchbiao%>"><font color="red">删</font></a>
    </td>
  </tr>
<% rs.movenext
next
end if %>
<% for i=1 to pages %>

<%next%>
<p align="cent<p align="center">
<a href="research11.asp?page=1">首页</a>&nbsp;
<a href="research11.asp?page=<%=page-1%>">前一页</a>&nbsp;
<a href="research11.asp?page=<%=page+1%>">后一页</a>&nbsp;
<a href="research11.asp?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=page%>页一共有<%=rs.pagecount%>页</p>

<%rs.close
set rs=nothing
%>
<%end if%>

<%end if %>
<p align="center"><a href="index.asp">返回网站首页</a></p>

  </p>
<p align="center">

</body>      
      
</html>      
</body>