<!--#include file="userCheck.asp"-->
<!-- #include file="conn.asp"-->
<%
dim action
action = request.QueryString("action")
if action = "submit" then call subtijiao()
%>
<!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 rel="stylesheet" href="css.css" type="text/css" />
<script language="JavaScript" type="text/javascript">
/*点击修改密码*/
function ifxiugai()
{
	var o = document.getElementById("modifyPassword");
	if(o.checked == true)
	{
		document.getElementById("modimima").style.display = "inline";
	}
	else
	{
		document.getElementById("modimima").style.display = "none";
	}
}
</script>
<link href="css/comm.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="bodyDiv">
<!--#include file="user_top.asp"-->
  <table width="910" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="178" valign="top" style="border-right:dotted 1px #CCCCCC; background-color:#F8F8F6;"><!--#include file="user_left.asp"--></td>
      <td width="732" valign="top">
<%
set rs=server.createobject("adodb.recordset")  
sql="select * from member where id="&session("userId23")
rs.open sql,conn,1,1

if not (rs.eof or err) then %>
<form action="?action=submit" method="post" name="memberMod" id="memberMod">
  <table 
                  width="100%" border="1" cellpadding="5" cellspacing="0" bordercolor="#626D78" bordercolorlight="#626D78" bordercolordark="#ffffff">
      <tbody>
        <tr bgcolor="#FFDBBD"> 
          <td colspan="2" height="18" bgcolor="#EEEEEE"> <p align="center">会员密码资料修改</p></td>
        </tr>
        <tr> 
          <td width="70" align="right" height="25" nowrap="nowrap"> <div align="right">会员帐号：</div></td>
          <td width="445" height="25"> <%=rs("memberID")%> </td>
        </tr>
        <tr> 
          <td width="70" align="right" height="26" nowrap="nowrap"><div align="right">会员密码：</div></td>
          <td width="445" height="26"> <input type="checkbox" name="modifyPassword" value="1" onClick="ifxiugai()" /> 
            <font color="#FF0000">修改密码</font>
			<div style="display:none;" id="modimima">
			<input type="password" name="password1" size="12" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" />&nbsp;&nbsp;<input type="password" name="password2" size="12" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" /><span style="color:#999999">请输入新密码</span>
			</div>
		  </td>
        </tr>
        <tr> 
          <td width="70" align="right" height="26" nowrap="nowrap"> <div align="right">密码提问：</div></td>
          <td width="445" height="26"> <input type="text" name="question" size="40" value="<%=rs("question")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" />          </td>
        </tr>
        <tr> 
          <td width="70" align="right" height="26" nowrap="nowrap"> <div align="right">密码答案：</div></td>
          <td width="445" height="26"> <input type="text" name="answer" size="40" value="<%=rs("answer")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" />          </td>
        </tr>
        <tr bgcolor="#FFDBBD"> 
          <td colspan="2" align="right" height="26" nowrap="nowrap" bgcolor="#EEEEEE"> 
            <div align="center"> 
              <input type="submit" name="Submit2" value="修改" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" />
              <input type="button" name="Submit3" value="关闭" onClick="window.close()" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7" />
            </div></td>
        </tr>
      </tbody>
    </table>
</form>
  <%else %>
  <br />
  <div align="center">您没有登陆，或该会员已被删除，请重新登陆一次。<a href="Javascript:window.history.go(-1)">返回</a> 
  </div>
  <%end if %></td>
    </tr>
    
    <tr>
      <td colspan="2"><!--#include file="model_bottom.asp"--></td>
    </tr>
  </table>
</div>
</body>
</html>
<%
'=======================
'提交修改信息
function subtijiao()
	dim InsertCursor
	dim tt(4)
	tt(0) = request.form("modifyPassword")
	tt(1) = trim(Request.form("password1"))
	tt(2) = trim(request.Form("password2"))
	tt(3) = trim(Request.Form("question"))
	tt(4) = trim(Request.Form("answer"))
	
	if tt(1) <> tt(2) then call wrong("两次输入的新密码不一致！")

	
    Set InsertCursor = Server.CreateObject("ADODB.Recordset")
    InsertCursor.Open "SELECT * FROM member WHERE id = "& session("userId23") &"",conn,1,3
    	if tt(0) = 1 then
    		InsertCursor("password") = tt(1)
       	end if
       InsertCursor("question") = tt(3)
       InsertCursor("answer") = tt(4)
       InsertCursor.Update
   InsertCursor.close
   set InsertCursor=nothing
   response.write "<script>alert('修改成功，请牢记您的新密码！');window.open('user_main.asp','_self')</script>"
end function
%>