<%if Session("huiyuan")="" then
Response.redirect "cart-login.asp" 
Response.end
end if
%><!--#include file="inc_top.asp" -->
<!--#include file="conn/inc_banner.asp" -->
<table width="760" bgcolor="#ffffff" border="0" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
  <tr>
    <td width="170" valign="top" bgcolor="#f3f3f3" class="table-you">
      <table width="170" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="32" align="center" valign="bottom" class="table-shang"><img src="image/huiyuan.gif" width="166" height="30"></td>
        </tr>
        <tr> 
          <td height="25" align="center" valign="middle"><img src="image/tp08.gif" width="13" height="13"> 
            <a href="huiyuan-1.asp">我的订单</a></td>
        </tr>
        <tr> 
          <td align="center"><img src="image/xx.gif"></td>
        </tr>
        <tr> 
          <td height="25" align="center" valign="middle"><img src="image/tp08.gif" width="13" height="13"> 
            <a href="huiyuan-2.asp">我的收藏</a></td>
        </tr>
        <tr> 
          <td align="center"><img src="image/xx.gif"></td>
        </tr>
        <tr> 
          <td height="25" align="center" valign="middle"><img src="image/tp08.gif" width="13" height="13"> 
            <a href="huiyuan-3.asp">个人资料</a></td>
        </tr>
        <tr> 
          <td align="center"><img src="image/xx.gif"></td>
        </tr>
        <tr> 
          <td height="25" align="center" valign="middle"><img src="image/tp08.gif" width="13" height="13"> 
            <a href="huiyuan-4.asp">修改密码</a></td>
        </tr>
        <tr> 
          <td align="center"><img src="image/xx.gif"></td>
        </tr>
      </table> 
    </td>
    <td width="590" height="350" align="center" valign="top"><p>&nbsp;</p>
      <%if trim(replace(request("pass"),"'",""))<>"" then
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from huiyuan where huiyuan='"&session("huiyuan")&"' and password='"&trim(replace(request("password"),"'",""))&"'"
rs.open sql,conn,1,3
if rs.eof then
Response.Write("<script>alert(""会员密码错误，不能修改。请确认您的会员原密码"");location.href=""huiyuan-4.asp"";</script>")
else
rs("password")=trim(replace(request("pass"),"'",""))
rs.update
rs.close
Response.Write("<script>alert(""会员密码修改成功，请以后用您的新密码登陆!"");location.href=""huiyuan-4.asp"";</script>")
end if
end if
set rs = conn.execute("select * from huiyuan where huiyuan='"&session("huiyuan")&"'") %>
      <script language="javascript">
	function checksignup() {
		if ( document.ff.password.value == '' ) {
			window.alert('请输入您的原密码!!');
			document.ff.password.focus();
			return false;
		}
		if ( document.ff.pass.value == '' ) {
			window.alert('请输入您的新密码!!');
			document.ff.pass.focus();
			return false;
		}
		if ( document.ff.pass2.value == '' ) {
			window.alert('请确认新密码!!');
			document.ff.pass2.focus();
			return false;
		}
		if ( document.ff.pass.value!=document.ff.pass2.value) {
			window.alert('新密码与确认码不一致!!');
			document.ff.pass.focus();
			return false;
		}
			return true;
			}
</script> 
      <table width="300" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
        <form name="ff" method="post"  onSubmit="return check_input()" action=?x=yes>
          <tr bgcolor="#f1f1f1"> 
            <td colspan="2" align="center" class="d13"><b>密码修改</b></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" class="d13" align="center">会员帐号</td>
            <td width="70%" class="d13"><font color="#FF3333"><%=rs("huiyuan")%></font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" class="d13" align="center">原密码</td>
            <td width="70%" class="d13"> <input name="password" type="password" class="wenbenkuang" id="password" maxlength=200> 
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" class="d13" align="center">新密码</td>
            <td width="70%" class="d13"> <input name="pass" type="password" class="wenbenkuang" id="pass" maxlength="50"> 
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" class="d13" align="center">新密码确认</td>
            <td width="70%" class="d13"> <input name="pass2" type="password" class="wenbenkuang" id="pass2"> 
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align="center" class="d13">&nbsp; </td>
            <td class="d13"> <input name="Submit2" type="submit" class="go-wenbenkuang" value="修改" onClick="javascript:return checksignup()"> 
              <input name="Submit2" type="reset" class="go-wenbenkuang" value="重写"> 
            </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<%rs.close
set rs=nothing%>
<!--#include file="inc_end.asp" -->