<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="top.asp"-->
<%
if request.QueryString("action")="save" then

set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from com_admin where com_xxx_admin='"&session("admin_xyz")&"'",conn,1,3
randostr=rs("randchar")

password=md5(trim(request("pass1")))
password=password&randostr
password=md5(password)

password1=md5(trim(request("pass")))
password1=password1&randostr
password1=md5(password1)

if password1<>rs("com_xxx_pass") then
response.Write "<script language=javascript>alert('原密码错误，请返回重新输入！');history.go(-1);</script>"
response.End
else
randostr=rando(6)
password=md5(trim(request("pass1")))
password=password&randostr
password=md5(password)
rs("com_xxx_pass")=password
rs("randchar")=randostr
rs.Update
rs.Close
set rs=nothing

response.Write "<script language=javascript>alert('更改成功！');history.go(-1);</script>"
end if
response.End
end if
%>

<div id="container">
<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
</div>
<div class="tableAll titlebgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:700px;">修改管理密码</li>
</div>
<form name="renpassword" method="post" action="?action=save">
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">用户名</li>
 <li><%=session("admin_xyz")%></li>
</div>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">原密码</li>
 <li><input name="pass" type="password" id="pass"></li>
</div>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">新密码</li>
 <li><input name="pass1" type="password" id="pass1"></li>
</div>
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">确认密码</li>
 <li><input  name="pass2" type="password" id="pass2"></li>
</div>

<div class="tableAll trbgcolor">
 <li style="width:30px;">&nbsp;</li>
 <li style="width:100px;">&nbsp;</li>
 <li><input class="button" onClick="return check();" type="submit" name="Submit" value=" 确认修改 " ></li>
</div>
 
</form>
</div>
<!--#include file="footer.asp"-->