<!--#include file="Include/connect.asp"-->
<!--#include file="Inc/char.asp"-->
<!--#include file="top.asp"-->
<link href="CSS/right.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tablecolor">
  <tr> 
    <td height="25" align="left" class="banner" style="PADDING-LEFT:15px">当前位置 &gt; 管理员列表</td>
  </tr>
</table>
<% 
select case request("action")
case "del"
call del()
case else
call normal()
end select
sub normal()
dim rs,p_i
strFileName="adminlist.asp"
pageno=15
set rs=server.CreateObject("adodb.recordset")
sql="select * from Show5_AdminUser Order By UserID DESC"
rs.Open sql,cn,1,1
rscount=rs.recordcount
if  rscount>=1 then
call showsql(pageno)
%>
<table border="0" align="center" cellpadding="0" cellspacing="1"  class="tablecolor">
  <tr > 
    <td height="25" align="center" class="tablebody">用户名</td>
    <td width="20%" align="center" class="tablebody">权限</td>
    <td width="10%" align="center" class="tablebody">删除</td>
  </tr>
<%
rs.move(rsno)
for p_i=1 to loopno
%>
  <tr > 
    <td height="25" align="center" class="tablebody"><a href="#"><%=rs("Username")%></a></td>
    <td align="center" class="tablebody" style="color:red;">系统管理员</td>
    <td align="center" class="tablebody"><a href="?action=del&UserID=<%=rs("UserID")%>">删除</a></td>
  </tr>
  <%
rs.movenext
next
%>
  <tr><td colspan="3" align="right"  class="tablebody"><%call showpage(strFileName,rscount,pageno,false,true,"名管理员")%></td>
  </tr>
</table>
<%
end if
end sub
sub del()
dim UserID
UserID=Request.QueryString("UserID")
if Cint(session("AdminUserID"))=Cint(UserID) then
response.Write("<script>alert('对不起,您没不能删除自己！');history.back()</script>")
response.End()
end if
cn.execute("delete from Show5_AdminUser where UserID="&UserID&"")
response.Write("<script>alert('删除成功！');location='adminlist.asp'</script>")
end sub
%>
<!--#include file="end.asp"-->