<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权修改管理员！');history.go(-1);</script>"
response.End
end if
%>
<title>后台用户管理</title>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="16" BGCOLOR="#39867B" align="center"><font color="#FFFFFF">后台用户管理</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> <br>
	<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="23%">管理员</td>
          <td width="21%">密 码</td>
          <td width="31%">权 限</td>
          <td width="25%">操 作</td>
        </tr>
        <%set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from admin order by rank",conn,1,1
        do while not rs.EOF%>
        <form name="form1" method="post" action="saveadmin.asp?action=edit&id=<%=int(rs("id"))%>">
          <tr align="center" bgcolor="#FFFFFF" height="20"> 
            <td><input name="admin" type="text" size="12" value="<%=trim(rs("admin"))%>"></td>
            <td><input name="UserPassword" type="text" size="12"></td>
            <td>
                <%select case rs("rank")
                case "1"
                response.Write "<input type=radio name=rank value=1 checked>管理&nbsp;<input name=rank type=radio value=2 >添加&nbsp;<input type=radio name=rank value=3>查看"
                case "2"
                response.Write "<input type=radio name=rank value=1>管理&nbsp;<input name=rank type=radio value=2 checked>添加&nbsp;<input type=radio name=rank value=3>查看"
				case "3"
				response.Write "<input type=radio name=rank value=1>管理&nbsp;<input name=rank type=radio value=2>添加&nbsp;<input type=radio name=rank value=3  checked>查看"
                end select%>
              </td>
            <td><input type="submit" name="Submit" value="修 改">
                &nbsp;<a href="saveadmin.asp?id=<%=int(rs("id"))%>&action=del" onClick="return confirm('您确定要删除此用户吗？')"><font color=red>删除</font></a> 
             </td>
          </tr>
        </form>
        <%rs.movenext
        loop
        rs.close
        set rs=nothing
        %>
      </table><br></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="20" BGCOLOR="#39867B" align="center"><font color="#FFFFFF">后台用户添加</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> <br>
	<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="21%">管理员</td>
          <td width="23%">密 码</td>
          <td width="35%">权 限</td>
          <td width="21%">操 作</td>
        </tr>
        <form name="form1" method="post" action="saveadmin.asp?action=add">
          <tr align="center" bgcolor="#FFFFFF"> 
            <td><input name="admin2" type="text" size="12"></td>
            <td><input name="UserPassword2" type="text" size="12"></td>
            <td><input type="radio" name="rank2" value="1">管理 
                <input name="rank2" type="radio" value="2" checked>添加 
                <input type="radio" name="rank2" value="3">查看</td>
            <td><input type="submit" name="Submit2" value="添 加"></td>
          </tr>
        </form>
      </table><br></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td BGCOLOR="#39867B" align="center" height="20"><font color="#FFFFFF">操作注意事项及说明</font></td>
  </tr>
  <tr> 
    <td height="38" bgcolor="#FFFFFF"> 
	<table width="80%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr> 
          <td><font color="#FF6600">·后台管理用户与前台用户毫无牵连。<br>
            ·添加人员只能添加、修改、删除商品资料。<br>
            ·查看人员可以管理商品评论和用户订单。<br>
            ·管理员拥有本站所有管理权限。<br>
            ·登录密码采用MD5不可逆转方式加密，如不修改密码，请留空。 </font></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="footer.asp"-->