<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<%
call adminer()
call Header()
Call ComeUrl()
Call IfUserClass()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理</title>
<script language="JavaScript1.2">
<!--
function confirm_delete(){
	if (confirm("你确定真的要这么做吗？")){
		return true;
	}
	return false;
}
//-->
</script>
	<Script Language=JavaScript>
	
	// 表单提交客户端检测
	function doSubmit(){
	
		if (document.myform.username.value==""){
			alert("用户名不能为空！");
			return false;
		}
		if (document.myform.password.value==""){
			alert("密码不能为空！");
			return false;
		}
		if (document.myform.password.value != document.myform.password1.value){
			alert("密码与确认密码不同！");
			return false;
		}
	}
	</Script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div align="center">
  <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#DEDFDE">
    <tr bgcolor="#F7F7F7">
      <td bgcolor="#F7F7F7"><div align="center">用户名</div></td>
      <td bgcolor="#F7F7F7"><div align="center">权 限</div></td>
      <td bgcolor="#F7F7F7"><div align="center">最后登录IP</div></td>
      <td bgcolor="#F7F7F7"><div align="center">最后登录时间</div></td>
      <td bgcolor="#F7F7F7"><div align="center">登录次数</div></td>
      <td><div align="center">修改</div></td>
      <td><div align="center">删除</div></td>
    </tr>
	<%
	set ors=server.CreateObject("adodb.recordset")
	ssql="select * from admin"
	ors.open ssql,oConn,1,1
	%>
	<%do while not ors.eof %>
	    <tr bgcolor="#FFFFFF">
      <td><div align="center"><%=ors("username")%></div></td>
      <td><div align="center"><%
	  If oRs("userclass")=1 Then
	  Response.Write "超级管理员"
	  End If
	  If oRs("userclass")=0 Then
	  Response.Write "普通管理员"
	  End If
	  %></div></td>
      <td><div align="center"><%=oRs("LastLoginIP")%></div></td>
      <td><div align="center"><%=oRs("LastLoginTime")%></div></td>
      <td><div align="center"><%=oRs("LoginTimes")%></div></td>
      <td><div align="center"><a href="user_modify.asp?id=<%=ors("id")%>">修改</a></div></td>
      <td><div align="center" onClick="return confirm_delete()"><a href="user_del.asp?id=<%=ors("id")%>">删除</a></div></td>
    </tr>
	<%
	ors.movenext
	loop
	%>
	<%
	ors.close
	set ors=nothing
	oconn.close
	set ors=nothing
	%>
  </table>
  <br>  
  <hr width="690" size="1" noshade color=#DEDFDE>
  <br>
  
  
  <table width="350" border="0" cellpadding="5" cellspacing="1" bgcolor="#DEDFDE">
   <form name="myform" method="post" action="user_add.asp" onSubmit="return doSubmit();">
  <tr bgcolor="#F7F7F7">
      <td colspan="2"><div align="center"><strong><font color="#FF0000">管 理 员 添 加</font></strong></div></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="93">管理员名称：</td>
      <td width="234"><input name="username" type="text" class="INPUT" id="username"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td>管理员密码：</td>
      <td><input name="password" type="password" class="INPUT" id="password"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td>确认密码　：</td>
      <td><input name="password1" type="password" class="INPUT" id="password1"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="2"><div align="center">
          <input name="userclass" type="radio" value="0" checked>
          普通管理员
          <input type="radio" name="userclass" value="1">
      超级管理员</div></td>
      </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="2"><div align="center">
          <input type="submit" name="Submit" value=" 提　交 " class="INPUT">
        　
        <input type="reset" name="Submit2" value=" 重　置 "class="INPUT">
      </div></td>
    </tr></form>
  </table>
</div>
</body>
</html>
