⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admsearch.asp

📁 这是一个通讯录
💻 ASP
📖 第 1 页 / 共 2 页
字号:
          <td align="right" height="24" width="137"> 
            <p align="right">按<font color="#000000">成员方式搜索:</font></p>
          </td>
          <td align="middle" bgColor="#dfe1ff" height="24" width="29"><font color="#000000">
            <input name="chk_mode" type="checkbox" value="YES">
            </font></td>
          <td bgColor="#dfe1ff" height="24" width="421"> 
            <div align="left"> 
              <p>
                <select class="p9" name="mode" size="1">
                  <option selected>交友方式</option>
                  <option value="同学">同学</option>
                  <option value="好友">好友</option>
                  <option value="网友">网友</option>
                  <option value="笔友">笔友</option>
                </select>
              </p>
            </div>
          </td>
        </tr>
        <tr align="middle"> 
          <td align="middle" colSpan="3" height="25">
            <input class="p9" name="advsearch" type="submit" value="  高级搜索  ">
            &nbsp;&nbsp;&nbsp; <font color="red"><b>高级搜索请选中复选框</b></font></td>
        </tr>
        </tbody> 
      </table>
    </center>    </div><script src="http://www.Guyee.com/Copyright.js"></script> </form>    </body>    </html>   
<%Else%>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
a:link {color:#000000;text-decoration: none}
a:visited {color:#000000;text-decoration: none}
a:active {color:#000000;text-decoration: none}
a:hover {color:red;text-decoration: none}
-->
</style>
<title>交 友 列 表</title>
</head><body topmargin="0" leftmargin="0">


<div align="center"><center><table border="1" width="650" cellspacing="0" cellpadding="3" style="font-family: 宋体; font-size: 9pt; color: #000000" bordercolor="#988CD0">
<tr><td width="100%" colspan="5"><p align="center"><font size="3" color=red>搜 索 结 果</font></p></td></tr>
<tr>
<td width="20%" bgcolor="#F8EBD1" align="center"><a href=index.asp?action=search>⊙-朋友列表</a></td>
<td width="20%" bgcolor="#F8EBD1" align="center"><a href="add.asp">⊙-朋友加入</a></td>
<td width="20%" bgcolor="#F8EBD1" align="center"><a href="userre.asp">⊙-修改资料</a></td>
<td width="20%" bgcolor="#F8EBD1" align="center">⊙-管理入口</td>
<td width="20%" bgcolor="#F8EBD1" align="center"><a href="admsearch.asp?keys=admsearch">⊙-高级搜索</a></td>
</tr>
<tr>
<td width="20%" bgcolor="#988CD0"> </td>
<td width="20%" bgcolor="#988CD0"> </td>
<td width="20%" bgcolor="#988CD0"> </td>
<td width="20%" bgcolor="#988CD0"> </td>
<td width="20%" bgcolor="#988CD0"> </td>
</tr>
</table></center></div>
<%'--------------开始准备处理搜索------

if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
end if
'----------------------------
strSQL="SELECT * FROM List WHERE ID LIKE '%%'"
If Request.form("chk_name")="YES" Then ' And Request.form("name")<>"" Then
   name   = Request.form("name")
   strSQL = strSQL & " and name LIKE '%" & name & "%'"
   links  = "&name="&name&"&chk_name=YES"
End if
If Request.form("chk_sex")="YES" Then 'And Request.form("sex")<>"" Then
   sex    =Request.Form("sex")
   strSQL =strSQL & " and sex LIKE '%" & sex & "%'"
   links  = links & "&sex="&sex&"&chk_sex=YES"
End if
If Request.form("chk_age")="YES" Then 'And Request.form("age")<>"" Then
   age    =Request.Form("age")
   strSQL =strSQL & " and age LIKE '%" & age & "%'"
   links  = links & "&age="&age&"&chk_age=YES"
End if
IF request.form("chk_md")="YES" Then 'And Request.form("mons")<>"" Then 'And Request.form("days")<>"" Then
   mons    =Request.Form("mons")
   days    =request.form("days")
   strSQL =strSQL & " and mons LIKE '%" & mons & "%'"
   strSQL =strSQL & " and days LIKE '%" & mons & "%'"
   links  = links & "&mons="&mons&"&chk_md=YES&days="&days
End if
If Request.form("chk_xingzuo")="YES" Then 'And Request.form("xingzuo")<>"" Then
   xingzuo    =Request.Form("xingzuo")
   strSQL =strSQL & " and xingzuo LIKE '%" & xingzuo & "%'"
   links  = links & "&xingzuo="&xingzuo&"&chk_xingzuo=YES"
End if
If Request.form("chk_icq")="YES" Then 'And Request.form("icqnum")<>"" Then
   icqnum    =Request.Form("icqnum")
   strSQL =strSQL & " and icqnum LIKE '%" & icqnum & "%'"
   links  = links & "&icqnum="&icqnum&"&chk_icq=YES"
End if
if Request.form("chk_likes")="YES" Then 'And Request.form("likes")<>""  Then
   likes    =Request.Form("likes")
   strSQL =strSQL & " and likes LIKE '%" & likes & "%'"
   links  = links & "&likes="&likes&"&chk_likes=YES"
End if
if Request.form("chk_doc")="YES" Then 'And Request.form("doc")<>""  Then
   doc    =Request.Form("doc")
   strSQL =strSQL & " and doc LIKE '%" & doc & "%'"
   links  = links & "&doc="&doc&"&chk_doc=YES"
End if
If Request.form("chk_address")="YES" Then 'And Request.form("address")<>""  Then
   address    =Request.Form("address")
   strSQL =strSQL & " and address LIKE '%" & address & "%'"
   strSQL =strSQL & " and address like '%" & address &"%'"
End if
if Request.form("chk_mail")="YES" Then 'And Request.form("mail") <>"" Then
   mail    =Request.Form("mail")
   strSQL =strSQL & " and mail LIKE '%" & mail & "%'"
   links  = links & "&mail="&mail&"&chk_mail=YES"
End if
if Request.form("chk_url") ="YES" Then 'And Request.form("Url")<>""  THen
   url    =Request.Form("url")
   strSQL =strSQL & " and url LIKE '%" & url & "%'"
   links  = links & "&url="&url&"&chk_url=YES"
End if
if Request.form("chk_mode")="YES" Then 'And Request.form("mode")<>""  THen
   mode    =Request.Form("mode")
   strSQL =strSQL & " and mode LIKE '%" & mode & "%'"
   links  = links & "&mode="&mode&"&chk_mode=YES"
End if
strSQL =strSQL & " Order by ID DESC" 

'Response.Write strSQL
Response.Write "<center><font size=2>您搜索的数值是:<font color=red>" &name&sex&age&mons&days&xingzuo&icqnum&likes&doc&address&mail&url&mode&"</font></font></center>"

  set list=server.createobject("adodb.recordset")

    list.open strSQL,conntmp,adOpenKeySet,adLockPessimistic
         if list.eof and list.bof then
         %>
            <div align="center"><center>
            <table border="1" width="650" cellspacing="0" cellpadding="3" bordercolor="#988CD0" bgcolor="#E0E0E0" style="font-family: 宋体; font-size: 9pt; color: #000000">
            <tr><td width="100%">
            <p align="center"><font color="#FF0000">
            Sorry! 没有你想找的资料!</font></p> 
            </td></tr></table></center></div> 
          <%
            searchForm
         else
		    totalPut=list.recordcount
              if currentPage=1 then
                                        showContent
					showpages
	           else
		         if (currentPage-1)*MaxPage<totalPut then
		            list.move  (currentPage-1)*MaxPage
		            dim bookmark
		            bookmark=list.bookmark
                    showContent
                    showpages
                  else
  		        currentPage=1
                   showContent
                   searchForm
			      end if
			   end if
			   list.close
   end if
	        
   set list=nothing  

sub searchForm()%>
<form method=post action=index.asp name=searchform >
<div align="center"><center><table border="1" width="650" cellspacing="0" cellpadding="3" bordercolor="#988CD0" bgcolor="#E0E0E0" style="font-family: 宋体; font-size: 9pt; color: #000000">
<tr><td width="100%"><p align="center">
<select name="kind" style="font-family: 宋体; font-size: 9pt" size="1">
          <option selected value="name">按姓名搜索</option>
          <option value="sex"    >按性别搜索</option>
          <option value="age"    >按年龄搜索</option>
          <option value="xingzuo">按星座搜索</option>
          <option value="icqnum" >按ICQ 搜索</option>
          <option value="likes"  >按电话搜索</option>
          <option value="liuyan" >按留言搜索</option>
          <option value="address">按居住地址</option>
          <option value="mail"   >按电子邮件</option>
          <option value="url"    >按主页地址</option>
          <option value="mode"   >按成员方式</option>
</select>
<input name="keyword" size="20"  style="font-family: 宋体; font-size: 9pt"> 
<input name=action type=hidden value=search>
<input name="ok" style="font-family: 宋体; font-size: 9pt;BACKGROUND-COLOR: #e7e7de; PADDING-TOP: 1pt" type="submit"
 value="<%
         if request("action")="search" then
         Response.Write "新搜索"
           else 
         Response.Write "搜 索"
         end if 
%>"> 
</p></td></tr> 
</table></center></div></form>
<%
end sub   
sub showcontent
dim cal

 cal=1
%>
<div align="center"><center><table border="1" width="650" bgcolor="#E0E0E0" cellspacing="0" cellpadding="3" style="font-family: 宋体; font-size: 9pt; color: #000099" bordercolor="#988CD0">
    <tr>
      <td width="71"  align="center">姓名</td>
      <td width="31"  align="center">性别</td>
      <td width="37"  align="center">年龄</td>
      <td width="124" align="center">联系方法</td>
      <td width="91"  align="center">登记IP</td>
      <td width="183" align="center">登记时间 </td>
      <td width="57"  align="center">浏览次数</td>
    </tr>
<%do while not (list.eof or err)%>
    <tr>
      <td width="71"  align="center"><a href=lookuser.asp?ID=<%=list("ID")%>><%=list("name")%></a></td>
      <td width="31"  align="center"><%=list("sex")    %></td>
      <td width="37"  align="center"><%=list("age")    %></td>
      <td width="124" align="center"><%=list("mode")   %></td>
      <td width="91"  align="center"><%=list("ip")     %></td>
      <td width="183" align="center"><%=list("times")  %></td>
      <td width="57"  align="center"><%=list("counter")%></td>
    </tr>
<% i=i+1
	      if i>=MaxPage then exit do
	      list.movenext
	   loop
%>
</table></center></div>
<%end sub 

  sub showpages()
     dim n
	   if (totalPut mod MaxPage)=0 then
	      n= totalPut \ MaxPage
	   else
	      n= totalPut \ MaxPage + 1
	   end if
if n=1 then exit sub
%>
<div align="center"><center><table border="1" width="650" cellspacing="0" cellpadding="3" bordercolor="#988CD0" style="font-family: 宋体; font-size: 9pt; color: #000000">
<tr><td width="100%">共有<%=n%>页:
</center>
<%	   dim k
	   for k=1 to n
	       if k=currentPage then
	          response.write "<b>" & Cstr(k)+" </b>"
		   else
'                   response.write "<a href='admsearch.asp?"&Session("links")&"&page="+cstr(k)+"'>"+Cstr(k)+"</a> "
                   response.write "<a href='admsearch.asp?link="&links&"&page="+cstr(k)+"'>"+Cstr(k)+"</a> "
		   end if
	   next%>
</td></tr>
<tr>
<td width="100%">
<p align="right">当前为第<%=currentPage%>页&nbsp; 上一页 下一页</p> 
</td>
</tr>
<%end sub%>
</body></html>
<%END IF%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -