<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx10<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 管理人员 &gt;&gt; 修改密码 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE1">* 为必添项目</span></td>
      </tr>
    </table></td>
  </tr>
</table>
<p>
  <%if request.QueryString("action")="save" then%>
  <!--#include file="../md5.asp"-->
  <%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_admin where admin='"&session("admin")&"'",conn,1,3
if md5(trim(request("password")))<>rs("password") then
response.Write "<script language=javascript>alert('原密码错误，请返回重新输入');history.go(-1);</script>"
response.End
else
rs("password")=md5(trim(request("password2")))
rs.Update
rs.Close
set rs=nothing
session("admin")=""
session("flag")=""
response.Write "<script language=javascript>alert('更改成功，请用新密码重新登陆！');history.go(-1);</script>"
end if
response.End
end if
%>
  <br>
</p>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <form name="renpassword" method="post" action="admin_password.asp?action=save">
    <tr bgcolor="#F3F3F3">
      <td width="335">
      <div align="right">用户名：</div></td>
      <td width="579">
        <font color=red><%=session("admin")%></font></td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td>
        <div align="right">原密码：</div></td>
      <td>        <input name="password" class="wenbenkuang" type="password" id="password" size="22">      </td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td>
        <div align="right">新密码：</div></td>
      <td>        <input name="password1" class="wenbenkuang" type="password" id="password1" size="22">      </td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td>
        <div align="right">确认密码：</div></td>
      <td>        <input  name="password2" class="wenbenkuang" type="password" id="password2" size="22">      </td>
    </tr>
    <tr bgcolor="#F3F3F3">
      <td colspan="2">
        <div align="center">
          <input onClick="return check();" type="submit" name="Submit" class="go-wenbenkuang" value="确定更改">
      </div></td>
    </tr>
  </form>
</table>
<p>&nbsp;</p>
<!--#include file="copyright.asp"-->
</body>
</html>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.renpassword.password.value)) {
	document.renpassword.password.focus();
    alert("原密码不能为空！");
	return false;
  }
  if(checkspace(document.renpassword.password1.value)) {
	document.renpassword.password1.focus();
    alert("新密码不能为空！");
	return false;
  }
    if(checkspace(document.renpassword.password2.value)) {
	document.renpassword.password2.focus();
    alert("确认密码不能为空！");
	return false;
  }
    if(document.renpassword.password1.value != document.renpassword.password2.value) {
	document.renpassword.password1.focus();
	document.renpassword.password1.value = '';
	document.renpassword.password2.value = '';
    alert("新密码和确认密码不相同，请重新输入");
	return false;
  }
	document.admininfo.submit();
  }
//-->
</script> 
