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

📄 userinfo_search.asp

📁 SUZI网络订房系统
💻 ASP
字号:
<%
if request.cookies("adminok")="" then
  response.redirect "login.htm"
end if
%>
<!--#include file="conn.asp"-->
<%
bo_Class=request("Class")
set rs=server.createobject("adodb.recordset")

sqltext="select * from userb " 

    if bo_class="按会员帐号" then
       sqltext=sqltext &" where userid like '%"& request("name") &"%' order by id desc"
    elseif bo_class="按真实姓名" then
       sqltext=sqltext &" where username like '%"& request("name") &"%' order by id desc"
    elseif bo_class="按联系电话" then
       sqltext=sqltext &" where telphone like '%"& request("name") &"%' order by id desc"     
    elseif bo_class="按联系地址" then
       sqltext=sqltext &" where address like '%"& request("name") &"%' order by id desc" 
    elseif bo_class="按电子邮件" then
       sqltext=sqltext &" where email like '%"& request("name") &"%' order by id desc" 
    end if
    
rs.open sqltext,conn,1,1

%>
<html>
<head>
<title>会员信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css"></head>
<body  text="#000000">
<br>
      <div align="center">
        <center>
<%
dim MaxPerPage
MaxPerPage=20

'假如没有数据时
If rs.eof and rs.bof then 
   call showpages
   call showempty
   'response.write "<p align='center'><font color='#ff0000'>还没任何会员信息</font></p>"
   response.end
End if

'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
 Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
   checkpage=instr(1,text,mid(request("page"),i,1))
   if checkpage=0 then
      exit for 
   end if
next

If checkpage<>0 then
      If NOT IsEmpty(request("page")) Then
        CurrentPage=Cint(request("page"))
        If CurrentPage < 1 Then CurrentPage = 1
        If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
      Else
        CurrentPage= 1
      End If
      If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
   CurrentPage=1
End if

call showpages
call list

If Rs.recordcount > MaxPerPage then
   call showpages
end if

'显示帖子的子程序
Sub list()%><form method='POST' action='Userinfo_Search.asp'>
            <TABLE cellSpacing=1 cellPadding=4 width=760 bgColor=#416327 height="136">
              <TBODY>
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="10" bgcolor="#1f60a0" background="images/bg.gif" colspan="2" width="750"></TD></TR>
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="18" width="338">注册会员信息-- <input type="button" value="管理主页" onclick=" window.location='manage.asp'"  style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">                
 </TD>
                <TD class=main2  height="18" width="403">
                <p align="right">会员查询: <select name='Class' size='1' tabindex='0' style="font-size: 9pt">         
<option value='按会员帐号' selected>按会员帐号</option>
<option value='按真实姓名'>按真实姓名</option>
<option value='按联系电话'>按联系电话</option>
<option value='按联系地址'>按联系地址</option>
<option value="按电子邮件">按电子邮件</option>
</select>  
<input type='text' name='Name' size='11'  onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:18px;background-color:#f3f3f3;border:1px solid black; ">       
<input type='submit' value='查询' name='Submit' style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">                
 </TD></TR>   
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="15" colspan="2" width="750">
                  <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#1f60a0" bordercolordark="#e1f0ff" height="46">
                    <tr class=main2>
                      <td width="5%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">编号</font></td>
                      <td width="8%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">用户帐号</font></td>
                      <td width="8%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">真实姓名</font></td>
                      <td width="5%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">性别</font></td>
                      <td width="13%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">联系电话</font></td>
                      <td width="6%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">邮编</font></td>
                      <td width="27%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">联系地址</font></td>
                      <td width="13%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">电子邮件</font></td>
                      <td width="12%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">操作</font></td>
                    </tr>
<%
if not rs.eof then
  i=0
  do while not rs.eof 
%> 
                   <tr class=main2>
                      <td width="5%" align="center" height="23"><%=rs("id")%></td>
                      <td width="8%" align="center" height="23"><%=rs("userid")%></td>
                      <td width="8%" align="center" height="23"><%=rs("username")%></td>
                      <td width="5%" align="center" height="23"><%=rs("sex")%></td>
        </center>
                      <td width="13%" align="center" height="23">
                        <p align="left"><%=rs("telphone")%></td>
                      <td width="6%" align="center" height="23">
                        <p align="left"><%=rs("zip")%></td>
                      <td width="27%" align="center" height="23">
                        <p align="left"><%=rs("address")%></td>
        <center>
                      <td width="13%"  height="23"><%=rs("email")%></td>
                      <td width="12%" align="center" height="23">
                      <input type="button" value="详情" onclick=" window.location='userdetail.asp?id=<%=rs("id")%>'"  style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'"><input type="button" value="删除" onclick="if (confirm('确实要此条记录吗?')) window.location='userinfodel.asp?id=<%=rs("id")%>'" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver="this.style.backgroundColor='#FFC864'" onMouseOut="this.style.backgroundColor='#D4D0C8'"></td>
                    </tr>
<%
   i=i+1
   if i >= MaxPerpage then exit do
   rs.movenext
   loop
end if
%>

                  </table>
                </center>
                </TD></TR>
              <TR bgColor=#e1f0ff>
                <TD class=main2 width="750" height="27" colspan="2">
                  <p align="center">&nbsp;               
                </TD></TR>
              <TR bgColor=#e1f0ff>
                <TD class=main2 width="750" height="4" bgcolor="#1f60a0" background="images/bg.gif" colspan="2"></TD></TR></TBODY></TABLE><br>
<%
End sub
rs.close
conn.close
%>        
<% 
'显示空帖子的子程序
Sub showempty()%><form method='POST' action='Userinfo_Search.asp'>
            <TABLE cellSpacing=1 cellPadding=4 width=760 bgColor=#416327 height="136">
              <TBODY>
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="10" bgcolor="#1f60a0" background="images/bg.gif" colspan="2" width="750"></TD></TR>
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="18" width="338">注册会员信息-- <input type="button" value="管理主页" onclick=" window.location='manage.asp'"  style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">                
 </TD>
                <TD class=main2  height="18" width="403">
                <p align="right">会员查询: <select name='Class' size='1' tabindex='0' style="font-size: 9pt">         
<option value='按会员帐号' selected>按会员帐号</option>
<option value='按真实姓名'>按真实姓名</option>
<option value='按联系电话'>按联系电话</option>
<option value='按联系地址'>按联系地址</option>
<option value="按电子邮件">按电子邮件</option>
</select>  
<input type='text' name='Name' size='11'  onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:18px;background-color:#f3f3f3;border:1px solid black; ">       
<input type='submit' value='查询' name='Submit' style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">                
 </TD></TR>   
              <TR vAlign=top bgColor=#e1f0ff>
                <TD class=main2  height="15" colspan="2" width="750">
                  <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#1f60a0" bordercolordark="#e1f0ff" height="46">
                    <tr class=main2>
                      <td width="5%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">编号</font></td>
                      <td width="8%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">用户帐号</font></td>
                      <td width="8%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">真实姓名</font></td>
                      <td width="5%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">性别</font></td>
                      <td width="13%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">联系电话</font></td>
                      <td width="6%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">邮编</font></td>
                      <td width="27%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">联系地址</font></td>
                      <td width="13%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">电子邮件</font></td>
                      <td width="12%" bgcolor="#1f60a0" align="center" height="19"><font color="#FFFFFF">操作</font></td>
                    </tr>
                   <tr class=main2>
                      <td width="97%" align="center" height="23" colspan="9">
                      无相关信息!</td>
        </center>
        <center>
                    </tr>
                  </table>
                </center>
                </TD></TR>
              <TR bgColor=#e1f0ff>
                <TD class=main2 width="750" height="27" colspan="2">
                  <p align="center">&nbsp;               
                </TD></TR>
              <TR bgColor=#e1f0ff>
                <TD class=main2 width="750" height="4" bgcolor="#1f60a0" background="images/bg.gif" colspan="2"></TD></TR></TBODY></TABLE><br>
<%
End sub
%>        
     </div>
<div align="center">
  <center> </form>                                                                                    
<%
'显示翻页的子程序
sub showpages()%>
<table bgColor="#f8e8a0" border="0" cellPadding="0" cellSpacing="0" width="100%" >  
<tr><td >
<%
response.write "<form method=Post action='Userinfo_Search.asp'>"
%> 

<table bgColor="#1f60a0" border="0" cellPadding="0" cellSpacing="0" width="100%" height="30">  
   <tr>
    <td  bgcolor="#e1f0ff" class=main2>   
<font color="#000000">   
<p align="left">   
<%
   Response.write "<font color='#000000'>分页-</font>"   
   If currentpage > 1 Then
      response.write "<a href='Userinfo_Search.asp?&page="+cstr(1)+"'><font color='#000000'>首页</font></a><font color='#ffffff'><b>-</b></font>"  
      Response.write "<a href='Userinfo_Search.asp?page="+Cstr(currentpage-1)+"'><font color='#000000'>前页</font></a><font color='#ffffff'><b>-</b></font>"
   Else
      Response.write "<font color='#000000'>首页-</font>"
      Response.write "<font color='#000000'>前页-</font>"      
   End if
   
   If currentpage < Rs.PageCount Then
      Response.write "<a href='Userinfo_Search.asp?page="+Cstr(currentPage+1)+"'><font color='#000000'>后页</font></a><font color='#ffffff'><b>-</b></font>"
      Response.write "<a href='Userinfo_Search.asp?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾页</font></a>&nbsp;&nbsp;"
   Else
      Response.write "<font color='#000000'>后页-</font>"
      Response.write "<font color='#000000'>尾页</font>&nbsp;&nbsp;"       
   End if
   Response.write "<font color='#000000'>页次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font>&nbsp;"
   Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>条记录/页&nbsp" & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>条记录</font>&nbsp;&nbsp;"

response.write "</td><td align='right'>"
response.write "<font color='#ffffff' class=main2>转到:</font><input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
   response.write "<input class=buttonface type='submit'  value='Go'  name='cndok' style='background-color: #e1f0ff'></span>&nbsp;&nbsp;"   
%>    
</font>    
    </td>  
   </tr>
  </table>
  </center>
</td></tr>
</table>
</form>
<%end sub%>


</div>


</body>
</html>

⌨️ 快捷键说明

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