<!--#include virtual="inc/General.inc.asp"-->
<%
CheckManageUser()
set rs=server.createobject("adodb.recordset")
if request("oldpassword")&""<>"" and request("newpassword")&""<>"" and request("newpassword2")&""<>"" and request("newpassword")&""=request("newpassword2")&"" then
	rs.open "select * from [manage] where userid=" & cint("0"&request.cookies("userid")) & " and [password]='" & MD5(request("oldpassword")) & "'",conn,1,1
	if not rs.eof then
		conn.execute "update [manage] set [password]='" & MD5(request("newpassword")) & "' where userid=" & request.cookies("userid") & " and [password]='" & MD5(request("oldpassword")) & "'"
		ErrorInfos "密码修改成功！","welcome.asp"
	else
		ErrorInfo "用户名和密码错误！"
	end if
end if
rs.open "select * from manage where userid=" & request.cookies("userid") & " and isstop=0",conn,1,1
if not rs.eof then
%>
<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>商城后台管理系统</title>
<link rel="stylesheet" href="../../css/main.css"></link>
</head>

<body topmargin="0" leftmargin="0">
<table height="100%" width="100%"><tr><td>
<table border="0" cellpadding="0" cellspacing="0" width="300" align="center" bgcolor="#005BAA">
  <tr>
	<td height="1" background="/images/line.gif"></td>
  </tr>
  <tr height="24">
	<td align="center"><font color="#FFFFFF">修 改 密 码</font></td>
  </tr>
  <tr>
	<td height="1" background="/images/line.gif"></td>
  </tr>
  <tr height="24" bgcolor="#CCE7FF">
	<td>
	  <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="border-left:1px solid #005BAA;border-right:1px solid #005BAA;border-bottom:1px solid #005BAA;">
		<form name="Manage_Login" method="post" action="ChangePass.asp" onsubmit="if (this.oldpassword.value==''){alert('旧密码不能为空！');this.oldpassword.focus();return false;}else if (this.newpassword.value==''){alert('新密码不能为空！');this.newpassword.focus();return false;}else if (this.newpassword2.value==''){alert('确认密码不能为空！');this.newpassword2.focus();return false;}else if (this.newpassword.value!=this.newpassword2.value){alert('密码要一致！');this.newpassword.value='';this.newpassword2.value='';this.newpassword.focus();return false;}else{return true;}">
		<tr height="25">
		  <td align="center" colspan="2"></td>
		</tr>
		<tr height="35">
		  <td width="35%" align="right">用 户 名： </td>
		  <td width="65%"> <%=rs("username")%></td>
		</tr>
		<tr height="35">
		  <td align="right">旧 密 码： </td>
		  <td> <input type="password" name="oldpassword" maxlength="20" class="inbox" onchange="this.value=this.value.replace(/[\']|(\s*)/g,'')"><input type="hidden" name="userid" value="<%=rs("userid")%>"></td>
		</tr>
		<tr height="35">
		  <td align="right">新 密 码： </td>
		  <td> <input type="password" name="newpassword" maxlength="20" class="inbox" onchange="this.value=this.value.replace(/[\']|(\s*)/g,'')"></td>
		</tr>
		<tr height="35">
		  <td align="right">确认密码： </td>
		  <td> <input type="password" name="newpassword2" maxlength="20" class="inbox" onchange="this.value=this.value.replace(/[\']|(\s*)/g,'')"></td>
		</tr>
		<tr height="35">
		  <td align="center" colspan="2"><input type="submit" value=" 确定 " class="btn">　　　<input type="reset" value=" 重置 " class="btn"></td>
		</tr>
		<tr height="25">
		  <td align="center" colspan="2"></td>
		</tr>
		</form>
	  </table>
	</td>
  </tr>
</table>
</td></tr></table>
</body>

</html>
<%end if
rs.close
set rs=nothing
CloseConnection%>