<!--#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_Id,Admin_UserName,Admin_UserPass,Admin_Verity,Admin_NewUserPass
Admin_Id=Request("Admin_Id")
Admin_UserName=Request("Admin_UserName")
Admin_UserPass=md5(Request("Admin_UserPass"))
Admin_NewUserPass=md5(Request("Admin_NewUserPass"))
Admin_Verity=Request("Admin_Verity")
Menu=Request("Menu")
redim ManageArray(j,3)
if Menu="UpManage" then
   rs.open"select * from Admin where Admin_UserName='"&Admin_UserName&"' and Admin_UserPass='"&Admin_UserPass&"'",conn,1,3
   if rs.eof and rs.bof then
      rs.close
      Response.Write("<script language=javascript>alert('请输入正确的用户名和密码');this.location.href='?Admin_Id="&Admin_Id&"';</script>")
	  Response.End
   else
	  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
rs.open"select * from Admin where Admin_Id="&Admin_Id,conn,1,3
   ManageArray(j,0)=rs("Admin_Id")
   ManageArray(j,1)=rs("Admin_UserName")
   ManageArray(j,2)=rs("Admin_UserPass")
   ManageArray(j,3)=rs("Admin_Verity")
rs.close%>
<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=UpManage" id="ManageFrom" onSubmit="return ManageCheck();">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr bgcolor="#FFFFFF">
    <td>管理员ID</td>
    <td><%=ManageArray(i,0)%><input name="Admin_Id" type="hidden" value="<%=ManageArray(i,0)%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>管理员名称</td>
    <td><%=ManageArray(i,1)%><input name="Admin_UserName" type="hidden" value="<%=ManageArray(i,1)%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>管理员级别</td>
    <td><%if ManageArray(i,1)<>"admin" then%>
	<select name="Admin_Verity" class="inputcss" id="Admin_Verity">
	<%if ManageArray(j,3)=1 then%>
	    <option value="1" selected>超级管理员</option>
	    <option value="0">内容管理员</option>
	<%else%>
	    <option value="1">超级管理员</option>
	    <option value="0" selected>内容管理员</option>
	<%end if%>
	</select>
	<%else
	    if ManageArray(j,3)=1 then
		    Response.Write("超级管理员")
		else
		    Response.Write("内容管理员")
		end if%>
		<input name="Admin_Verity" id="Admin_Verity" type="hidden" value="<%=ManageArray(j,3)%>">
	<%end if%></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>原密码</td>
    <td><input name="Admin_UserPass" type="password" class="inputcss" id="Admin_UserPass" size="20"></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>

