<!--#include file="userCheck.asp"-->
<!-- #include file="conn.asp"-->
<%
dim action
action = request.QueryString("action")
if action = "submit" then call subtijiao()

set rs=server.createobject("adodb.recordset")  
sql="select * from member where id="&session("userId23")&""  
rs.open sql,conn,1,1
%>
<!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">
	  <%if not (rs.eof or err) then %>
<form method="post" action="?action=submit" name="memberMod">
  <TABLE width="100%" border="1" cellPadding="0" 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> <div align="right">会员帐号：</div></td>
          <td width="445" height="25"> <%=rs("memberID")%> </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="25" nowrap> <div align="right">会员姓名：</div></td>
          <td width="445" height="25"> <input type="text" name="name" size="20" value="<%=rs("name")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7"> 
          </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="25" nowrap> <div align="right"><font color="#000000">会员性别：</font></div></td>
          <td width="445" height="25"> <select name="sex" style="background-color: #f7f7f7">
              <%if rs("sex")="男" then %>
              <option selected>男</option>
              <option>女</option>
              <%else %>
              <option>男</option>
              <option selected>女</option>
              <%end if %>
            </select> </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="26" nowrap> <div align="right">电子邮件：</div></td>
          <td width="445" height="26"> <input type="text" name="email" size="30" value="<%=rs("email")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7"> 
          </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="26" nowrap> <div align="right">常用电话：</div></td>
          <td width="445" height="26"> <input type="text" name="phone" size="30" value="<%=rs("phone")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7"> 
          </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="25" nowrap> <div align="right">家庭地址：</div></td>
          <td width="445" height="25"> <input type="text" name="address" size="60" value="<%=rs("address")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7"> 
          </td>
        </tr>
        <tr> 
          <td width=70 align="right" height="26" nowrap> <div align="right">邮政编码：</div></td>
          <td width="445" height="26"> <input type="text" name="code" size="10" value="<%=rs("code")%>" style="font-size: 9pt; border: 1px solid #7D85A2; background-color: #f7f7f7"> 
          </td>
        </tr>
        <tr bgcolor="#FFDBBD"> 
          <td colspan="2" align="right" height="26" 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(5)
	tt(0) = request.form("name")
	tt(1) = trim(Request.form("sex"))
	tt(2) = trim(request.Form("email"))
	tt(3) = trim(Request.Form("phone"))
	tt(4) = trim(Request.Form("address"))
	tt(5) = trim(Request.Form("code"))
	
	If instr(Request.Form("email"),".")=0 or instr(Request.Form("email"),"@")=0 or instr(Request.Form("email"),"@")=1 or instr(Request.Form("email"),"@")=len(email) then 
Response.Write "<script language=javascript>alert('电子信箱格式填写不正确！');javascript:history.back();</script>" 
Response.End 
End If


	
    Set InsertCursor = Server.CreateObject("ADODB.Recordset")
    InsertCursor.Open "SELECT * FROM member WHERE id = "& session("userId23") &"",conn,1,3
    	
     InsertCursor("name")    = tt(0)
	 InsertCursor("sex")     = tt(1)
	 InsertCursor("email")   = tt(2)
	 InsertCursor("phone")   = tt(3)
     InsertCursor("address") = tt(4)
     InsertCursor("code")    = tt(5)

    InsertCursor.Update
    InsertCursor.close
    set InsertCursor=nothing
    response.write "<script>alert('资料修改成功！');window.open('user_main.asp','_self')</script>"
end function
%>