📄 alladmin.asp
字号:
<!-- #include file="conn.asp" -->
<style type="text/css">
<!--
.style1 {font-size: 14px}
.style2 {font-size: 14px}
-->
</style>
<%
if session("admin")="" then
Response.write("<center>使用错误,请先登陆")
Response.End
end if
%>
<%
'ShowPage子程序负责设置表格颜色及插图,然后显示PageNo参数所指定的页次的所有记录
Sub ShowPage(RS, PageNo)
'设置表格背景颜色及插图文件,同时加上Randomize使每次产生不同顺序的图形文件
ReDim Fig(RS.PageSize - 1 ), BG(RS.PageSize - 1 )
Randomize
For I = 0 to RS.PageSize - 1
Fig(I) = INT(RND * 9) + 1 & ".gif"
Next
BG(0) = "#D9D9FF"
BG(1) = "#FFCAEE"
BG(2) = "#FFFFCC"
BG(3) = "#B9EEB9"
BG(4) = "#B9E9FF"
'显示留言并加以格式化
Response.Write "<form name='form1' method='post' ><table width='100%' border='0' cellpadding='1' cellspacing='1'>"
Response.Write "<tr>"
Response.Write "<td><font color='#DB7093' size='4' face='幼圆'></font></td>"
Response.Write "<td><font color='#DB7093' size='4' face='幼圆'>管理员</font></td>"
Response.Write "<td><font color='#DB7093' size='4' face='幼圆'>管理员ID</font></td>"
Response.Write "<td><font color='#DB7093' size='4' face='幼圆'>用户类型</font></td>"
Response.Write "<td><font color='#DB7093' size='4' face='幼圆'>注册时间</font></td>"
RS.AbsolutePage = PageNo
For I = 1 To RS.PageSize
Response.Write "<TR BGCOLOR=" & BG(I - 1) & ">"
Response.Write "<TD WIDTH='10%'><input type='checkbox' name='adminId' id='adminID' value="&rs("adminID")&"></TD>"
Response.Write "<TD><span class='style1'>"&rs("admin")&"</td>"
Response.Write "<TD><span class='style1'>"&rs("adminid")&"</td>"
if rs("flag")=3 then
Response.Write "<TD><span class='style1'>管理员</td>"
else if rs("flag")=2 then
Response.Write "<TD><span class='style1'>公司/单位用户</td>"
end if
end if
Response.Write "<TD><span class='style1'> "&rs("regtime")&"</td>"
RS.MoveNext
If RS.EOF Then Exit For '若到记录结尾就结束For循环
Next
Response.Write "<tr bgcolor='#FFFFFF'><td colspan='2'><input name='actions' type='radio' value='del' checked><span class='style1'>删除所选的用户</span><input type='submit' name='Submit' value='执行操作'><input name='action' type='hidden' id='action' value='dell'></td></tr>"
Response.Write "</TABLE></form>"
if request.Form("action")="dell" then
Dim Num,rss
if request.Form("actions")="del" then
Num=request.form("adminID").count
for i=1 to Num
set Rss = conn.execute("select * from admin where adminid<>"&session("adminid")&" and adminID="&Request.form("adminid")(i))
conn.execute("Delete From message Where From='"&Rss("admin")&"'")
conn.execute("Delete From message Where to='"&Rss("admin")&"'")
conn.execute("Delete from admin where adminid<>"&session("adminid")&" and adminID="&Request.form("adminid")(i))
Next
Response.Redirect("alladmin.asp?=删除成功")
Response.End
end if
end if
End Sub
%>
<HTML>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<BODY>
<CENTER>
</CENTER>
<%
set RS=server.CreateObject("adodb.recordset")
sql="select * from admin where adminid<>"&session("adminid")&" order by adminID desc"
RS.open sql,conn,1,3
If RS.EOF Then
Response.Write "<CENTER><P>目前还没有任何用户!</P>" & _
"<P><A HREF='../main.asp'>返回系统首页</A></P></CENTER>"
Else
'设置分页大小,您可视实际情况设置其他数值
RS.PageSize = 5
'显示页次超链接
PageNo = Request("PageNo") '读取浏览者所点取的页次超链接
Response.Write "<span class='style1'>[ "
For I = 1 To RS.PageCount
If I = CInt(PageNo) Then '若到浏览者所点取的页次超链接,便不再当成超链接
Response.Write I & " | "
Else
Response.Write "<A HREF='alladmin.asp?PageNo=" & I & "'>第" & _
I & "页</A>" & " | " '超链接到alladmin.asp并将页次当成参数传送
End If
Next
Response.Write "]<HR><center>所有所有注册用户 <a href='main.htm'>返回首页</a> <a href='../search/searchcom.htm' target='_blank'>搜索公司/单位</a> <a href='../search/searchuser.htm' target='_blank'>搜索个人用户</a></span><br><br>"
%>
<%
'根据页次调用ShowPage子程序来显示留言,若没有指定页次,就显示第1页
If PageNo <> "" Then
ShowPage RS, PageNo
Else
ShowPage RS, 1
End If
'关闭数据库连接并释放对象
RS.Close
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>
<%end if%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center" class="style1"><br>
<br>
以上为所有管理员<br>
<br>
<a href="main.htm">返回首页</a><br>
</div></td>
</tr>
</table>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -