<!--#include file="../siteconfig/conn.asp"-->
<!--#include file="../siteconfig/md5.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_ManageFunction.asp"-->
<HTML>
<HEAD>
<TITLE>修改管理员</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</HEAD>
<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<%dim Menu,Admin_UserName,Admin_NewUserPass,Admin_Verity
Admin_UserName=Request("Admin_UserName")
Admin_NewUserPass=md5(Request("Admin_NewUserPass"))
Admin_Verity=Request("Admin_Verity")
Menu=Request("Menu")
if Menu="AddManage" then
   rs.open"select * from Admin where Admin_UserName='"&Admin_UserName&"'",conn,1,3
   if not rs.eof and not rs.bof then
      Response.Write("<script language=javascript>alert('用户名已存在');javascript:history.go(-1)</script>")
	  Response.End()
	  rs.close
   else
   rs.addnew
	  rs("Admin_UserName")=Admin_UserName
	  rs("Admin_UserPass")=Admin_NewUserPass
	  rs("Admin_Verity")=Admin_Verity
   rs.update
   rs.close
   Response.Write("<script language=javascript>alert('管理员添加成功');parent.window.location.reload();DivOpenClose('',2,0,0);</script>")
   Response.End()
   end if
end if
%>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr>
    <td width="45%">添加管理员</td>
    <td width="55%" align="right"><a href="#" onClick="javascript:DivOpenClose('',2,0,0);return false">关闭</a></td>
  </tr>
</table>
<form name="ManageFrom" method="post" action="?Menu=AddManage" id="ManageFrom" onSubmit="return ManageCheck();">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  
  <tr bgcolor="#FFFFFF">
    <td>管理员名称</td>
    <td><input name="Admin_UserName" type="text" class="inputcss" id="Admin_UserName"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>管理员级别</td>
    <td><select name="Admin_Verity" class="inputcss" id="Admin_Verity">
	    <option value="1" selected>超级管理员</option>
	    <option value="0">内容管理员</option>
	</select></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>密 码</td>
    <td><input name="Admin_NewUserPass" type="password" class="inputcss" id="Admin_NewUserPass" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>确认密码</td>
    <td><input name="Admin_NewUserPass2" type="password" class="inputcss" id="Admin_NewUserPass2" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td><input name="Submit" type="submit" class="SubmitCss" value="添加管理员"></td>
  </tr>
</table>
</form>
</BODY>
</HTML>

