📄 adminuser.asp
字号:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临本图书馆</title>
<Link href="Css.css" rel=stylesheet>
</HEAD>
<!--#include file="Conn.asp"-->
<BODY>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60" align="center"><img src="Images/title.jpg" width="283" height="51">
</td>
</tr>
<% If Session("admin") <> "" Then %>
<tr>
<td height="25" ><table width="780" border="0" bgcolor="#EFEFEF" align="center" cellpadding="0" cellspacing="0" style="border-color:#000000;border-top-style: solid;border-top-width: 1">
<tr>
<td height="25" bgcolor="#EFEFEF"> <a href="Default.asp">首页 </a>|<a href="AdminBorrow.asp"> 借书管理 </a>|<a href="AdminPublish.asp"> 出版社管理 </a>|<a href="AdminBook.asp"> 图书管理 </a>|<a href="AdminUser.asp"> 用户管理 </a>|<a href="ModifyAdmin.asp"> 修改密码 </a>|<a href="Logout.asp"> 退出 </a>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="780" border="0" align="center" cellpadding="0" cellspacing="0" style="border-color:#000000;border-bottom-style: solid;border-bottom-width: 1;border-top-style: solid;border-top-width: 1">
<tr bgcolor="#FFFFFF">
<form name="form1" method="post" action="AdminUser.asp?action=Find">
<td height="25" background="Images/bg.gif" bgcolor="#FFFFFF"><img src="Images/find.gif" width="12" height="13">选择查询方式:
<select name="select">
<option value="name" selected>用户名</option>
<option value="id" selected>用户编号</option>
<option value="department" selected>工作单位</option>
</select>
<input name="key" type="text" size="12">
<input type="submit" name="Submit" value="查询">(请先输入查询关键字)
</td>
</form>
</tr>
</table></td>
</tr>
<tr>
<td height="25" align="right">
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#44608A">
<tr align="center" >
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><B>用户名</B></td>
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><B>性别</B></td>
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><B>电子邮箱</B></td>
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><B>QQ号</B></td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF"><B>用户注册时间</B></td>
<td width="14%" height="25" align="center" bgcolor="#FFFFFF"><B>用户电话</B></td>
<td width="13%" height="25" align="center" bgcolor="#FFFFFF"><B>工作单位</B></td>
<td width="12%" height="25" align="center" bgcolor="#FFFFFF"><B>身份证号码</B></td>
<td width="9%" height="25" align="center" bgcolor="#FFFFFF"><B>操作</B></td>
</tr>
<%
Set Rs = Server.CreateObject("ADODB.Recordset")
If Request("action") = "Find" Then
key = Trim(Request("key"))
If Request("select") = "name" Then
Sql = "Select * From userInfo Where name Like '%"&key&"%' Order By reg_time Desc"
ElseIf Request("select") = "id" Then
Sql = "Select * From userInfo Where id Like '%"&key&"%' Order By reg_time Desc"
ElseIf Request("select") = "department" Then
Sql = "Select * From userInfo Where department Like '%"&key&"%' Order By reg_time Desc"
Else
Response.Write "<Script>alert('查询错误!');</Script>"
Response.End
End If
Else
Sql = "Select * From userInfo Order By reg_time Desc"
End If
Rs.Open Sql,conn,3,3
If IsNumeric(Request("Page"))=false Or Request("Page")="" Then
Page=1
Else
Page=CInt(Request("Page"))
End if
Rs.PageSize=10
If Rs.EOF Or Rs.BOF Then
Response.Write "<tr><td height='25' align='center' bgcolor='#FFFFFF' colspan='9'>没有搜索到相关的用户!</td></tr>"
Else
myPageSize=Rs.PageSize
Rs.AbsolutePage=Page
Do While not Rs.Eof And myPageSize>0
%>
<tr align="center">
<td height="25" align="center" bgcolor="#FFFFFF"><% =Rs("name") %></td>
<td height="25" width="8%" align="center" bgcolor="#FFFFFF">
<%
If Rs("gender") = 1 Then
Response.Write "男"
Else
Response.Write "女"
End If
%>
</td>
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("email") %></td>
<td width="8%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("qq") %></td>
<td width="20%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("reg_time") %></td>
<td width="14%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("tel")%></td>
<td width="13%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("department")%> </td>
<td width="12%" height="25" align="center" bgcolor="#FFFFFF"><% =Rs("number") %> </td>
<td width="9%" height="25" align="center" bgcolor="#FFFFFF">
<a href="javascript:if(window.confirm('你确实要删除此版块吗?') == true){window.location ='DeleteUser.asp?id=<%=Rs("id")%>';}"><img src="Images/delete.jpg" width="15" height="15" border="0">删除</a></td>
</tr>
<% myPageSize=myPageSize-1
i=i+1
Rs.MoveNext
Loop
%>
<tr>
<td height="25" align="left" colspan="9" bgcolor="#FFFFFF"> 用户总数:<b><%=Rs.RecordCount%></b>个
每页显示:<b><%=Rs.PageSize%></b>个
第 <font color=#ff0000><b><%=Page%></b></font> 页/共 <font color=#ff0000><b><%=Rs.PageCount%></b></font> 页
<%
If Page > 1 Then
Response.Write "<a href='AdminUser.asp?Page=1' title='首页'><font face=webdings>" & 9 & "</font></a>"
Response.Write " <a href='AdminUser.asp?Page="&Page-1&"' title='上一页'><font face=webdings>" & 7 & "</font></a>"
End If
If Rs.PageCount <= 4 Then
For j = 1 To Rs.PageCount
Response.Write " <a href='AdminUser.asp?Page="&j&"'>" & j & "</a>"
Next
Else
For j = 1 To 4
Response.Write " <a href='AdminUser.asp?Page="&j&"'>" & j & "</a>"
Next
If Page < Rs.PageCount Then
Response.Write " <a href='AdminUser.asp?Page="&Page+1&"' title='下一页'><font face=webdings>" & "8" & "</a></font>"
End If
Response.Write " <a href='AdminUser.asp?Page="&Rs.PageCount&"' title='最后页'><font face=webdings>:</font></a>"
End If
%> </td>
</tr>
<% End If
Rs.Close
Set Rs=nothing
Conn.close
Set Conn=nothing
%>
</table></td>
</tr>
<% Else %>
<tr>
<td height="50" align="center"><font color="ff0000">对不起,请不要非法登录!</font></td>
</tr>
<%End If%>
</table>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -