<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="MelyySoft.Manage.Asp"-->

<script language="javascript">
<!--
   function SelectAll(form){
     for (var i=0;i<form.AllPurview.length;i++){
        var e = form.AllPurview[i];
        if (e.disabled==false)
           e.checked = form.chkAll.checked;
function ConfirmDel()
{
   if(confirm("确定要删除选中的项目吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}

function form_onsubmit()
{
if (document.form_admin.Password.value!=document.form_admin.ConPassword.value)
{
alert ("新密码和确认密码不一致。");
document.form_admin.Password.value='';
document.form_admin.ConPassword.value='';
document.form_admin.Password.focus();
return false;
}
}
//-->
</SCRIPT>

<%

if Request.QueryString("mark")="operate" then
dim sql,rs,ID
ID=request("ID")
set rs=server.createobject("adodb.recordset")
sql="delete from admin where Id="& ID
rs.open sql,conn,1,3
set rs=nothing
conn.close
response.redirect "Admin_Manage.asp"
end if
%>
<!-- #include file="Inc/Head.asp" -->  
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">      <table width="560" border="0" cellpadding="0" cellspacing="1" class="border">
        <tr> 
          <td height="25" class="topbg"><% If session("AdminName")<>"admin" then%><%=Session("AdminName")%><%else%>管理员<%end if%>帐号管理</td>
        </tr>
        <tr>          
        <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
                <tr class=tdbg> 
                  <td width="28%" height="25" class="Title"> 
                  <div align="center">管理员帐号</div></td>
                  <td width="28%" class="Title"> 
                  <div align="center">管理员部门</div></td>
                  <td width="24%" class="Title"> 
                  <div align="center">操作</div></td>
                  <td width="20%" class="Title"> 
                  <div align="center">删除</div></td>
                </tr>
<%				
set rs=server.createobject("adodb.recordset")
if session("adminname")<>"" then
sql="select * from admin where UserName='" & session("AdminName") & "'"
else
sql="select * from admin"
end if 
rs.open sql,conn,1,1
do while not rs.eof

%>
                <tr bgcolor="#DFEBF2"> 
                  <td height="22" class="tdbg"> 
                  <div align="center"><%=rs("UserName")%></div></td>
                  <td class="tdbg"> 
                  <div align="center"><%=rs("DepartMent")%></div></td>
                  <td class="tdbg"> 
                    <div align="center">
                      <%response.write "<a href='Admin_ManageEdit.asp?ID="&rs("Id")&"'>修改密码及权限</a>"%>
                  </div></td>
                  <td class="tdbg"> 
                    <div align="center"><a href="Admin_Manage.asp?id=<%=rs("id")%>&mark=operate" onClick="return ConfirmDel();">删除</a></div></td>
                </tr>
<%
rs.movenext
loop
rs.close
%>
          </table></td>         
        </tr>
      </table>
    </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->