<!--#include file="../check.asp"--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>商户后台 - 修改通行证密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->

<script language="JavaScript" type="text/javascript">
    function checkform()
    {
      if (document.all.old_password.value==""){
	      alert("请输入原始密码！")
	      document.all.old_password.focus();
	      return false
		  }

      if (document.all.pas.value==""){
	      alert("请输入新密码！");
	      document.all.pas.focus();
	      return false
	      } 
      if (document.all.re_password.value==""){
	      alert("请输入确认密码！");
	      document.all.re_password.focus();
	      return false
	      }

     if (document.all.pas.value!=document.all.re_password.value){
	      alert("两次输放的密码不一致！");
	      document.all.re_password.focus();
	      return false
	      }
	      return true
    }
    </script>


<%
Cmd=request("Cmd")
ErrStr=""
if Cmd="Up" then
   safepassword=request.form("safepassword")
   if safepassword="" then safepassword="0"
   pwd_old=request.form("pwd_old")
   pwd_new1=request.form("pwd_new1")
   pwd_new2=request.form("pwd_new2")
   if pwd_old="" or pwd_new1="" then Errstr="新旧密码不能为空,密码修成失败！"
   if pwd_new1<>pwd_new2 then Errstr="两次新密码输入不相同,密码修成失败！"
   if ErrStr="" then
   set Rs=GrateRs("select * from member where username like '"&trim(Session("Usr_UserName"))&"'",3)
   if not Rs.eof then 
      if Rs("passwd")=md5(pwd_old) then
      if Rs("safepassword")=safepassword then
	  	Rs("passwd")=md5(pwd_new1)
		Rs.update
		ErrStr="密码修成成功!"
		Session("Usr_PassWord")=md5(pwd_new1)
	  else
	  	ErrStr="安全码不正确,密码修成失败！"
	  end if
	  else
	  	ErrStr="原密码不正确,密码修成失败！"
	  end if
   Else
      Errstr="用户不存在"
   end if




   end if
   response.write "<script language='JavaScript'>{window.alert('"&Errstr&"');window.location='javascript:history.back();';}</script>"
end if
%>

	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_shield">修改通行证密码</h3>
		<div class="vspace"></div>
		
		<div class="shrink">
			<form method="post" action="?Cmd=Up" id="ctl01" onSubmit="return checkform()">		

<table cellpadding="5" cellspacing="0">
	<tr>
		<td width="140">用户通行证:</td>
		<td><span class="orange bold"><%=session("usr_username")%></span></td>
	</tr>
	<tr>
		<td>原密码:</td>
		<td><input name="pwd_old" type="password" maxlength="15" id="old_password" style="width:160px;" /></td>
	</tr>
	<tr>
		<td>新密码:</td>
		<td><input name="pwd_new1" type="password" maxlength="15" id="pas" style="width:160px;" /></td>
	</tr>
	<tr>
		<td>新密码确认:</td>
		<td><input name="pwd_new2" type="password" maxlength="15" id="re_password" style="width:160px;" /></td>
	</tr>
	<tr>
		<td></td>
		<td><input type="submit" name="Submit" value="确认" id="changePassword_save" class="button" style="width:100px;" /></td>
	</tr>
	<tr>
		<td></td>
		<td><ul class="remind" id="feedbacks"><li class="prompt">为确保您的帐户安全，密码应尽量设置一定的复杂度，并且不定期更改您的密码。</li></ul><div class="clear"></div></td>
	</tr>
</table>
			</form>
			<div class="vspace"></div>
		</div>
	
		</div>
	</div>
</div>
</body>
</html>