<!--#include file="../inc/index_conn.asp"-->
<!--#include file="../linkfunction.asp"-->
<!--#INCLUDE FILE="../md5.asp"-->
<!--#INCLUDE FILE="../config.asp"-->
<!--#include file="checklogin.asp"-->
<%
  
'程序开发：58天网络科技 
'官方主页：http://www.58day.com
jiupass=md5(request.Form("jiupass"))
newpassword=md5(Request.Form("newpassword"))
username=session("useridname")
	 
     HomePage=Trim(Request.Form("HomePage"))
	 qq=request.Form("qq")
	 face=request.Form("face")
	 sex=request.Form("sex")
	 phone=Request.Form("phone")
	 rname=Request.Form("rname")
	 shopnote=Request.Form("shopnote")
	 address=Request.Form("address")
	 weiti=Request.Form("weiti")
	 daai=Request.Form("daai")
	 shopname=Request.Form("shopname")
	 shenfenzheng=Request.Form("shenfenzheng")
	 zhifubao=Request.Form("zhifubao")
	 caifutong=Request.Form("caifutong")
	 
	 
Set rs=server.createobject("ADODB.RECORDSET")
if request.Form<>"" then
	  rs.open "Select * From register where username='" &session("useridname")& "'" ,conn,1,3 
	   
	  '--------------检测我的QQ是否已经被注册-------------------------------------------------------------------------
    	      Set rsqq=server.createobject("ADODB.RECORDSET")
	  rsqq.open "Select * From register where qq='"&qq&"' and username<>'"&username&"' " ,conn,1,3
	  if rsqq.eof then
	  set rsqq=nothing
	  else
	  set rsqq=nothing
	  response.write "<script>alert('您填写的“我的QQ”里的QQ号码已经被别人注册！');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
	  response.End()
	  end if
	  '---------------------------------------------------------------------------------------------------------------
	  '--------------绑定淘宝买号账号大号修复-------------------------------------------------------------------------
    	      Set rsstb=server.createobject("ADODB.RECORDSET")
	  rsstb.open "Select * From xinyu where shopname='"&shopname&"' and username<>'"&username&"' " ,conn,1,3  
	  if rsstb.eof then
	  	 set rsstb=nothing
	 else
	 set rsstb=nothing
	 	 Response.Write("<script>alert('您输入的淘宝号已被其它用户绑定!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>")
		 response.End()
	 end if
	 '---------------------------------------------------------------------------------------------------------------
	  
		if jiupass<>rs("password1") then
		response.Write "<script language='javascript'>alert('您的旧密码不正确！');window.location.href='guest_info.asp';</script>"
		response.End()
		end if
		
		if Request.Form("newpassword")<>"" then
		rs("password1")=newpassword
		end if
		
		rs("zhiwei")=request("zhiwei")

		
		rs("qq")=qq
		rs("weiti")=weiti
		rs("daai")=daai
				if Request.Form("shopname")<>"" then
				rs("shopname")=shopname
				rs("taobao")=1
				rs("youa")=1
		end if
		
		rs("shenfenzheng")=shenfenzheng
		rs("zhifubao")=zhifubao
		rs("caifutong")=caifutong
		rs("phone")=phone
		rs("rname")=rname
		rs("homepage")=homepage
		rs("shopnote")=shopnote
		rs("sex")=sex
		rs("address")=address
										
				
		rs("face")=face
		rs("myface")=myface
		rs("faceheight")=faceheight
		rs("facewidth")=facewidth
		
		response.Write "<script language='javascript'>alert('资料修改成功！');window.location.href='guest_info.asp';</script>"
    	rs.update
    	rs.close


set rs=nothing
conn.close
set conn=nothing
end if

%>

<!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>
<meta http-equiv="Content-Language" content="zh-cn">
<title>完善和修改资料-会员中心-<%=stupname%> -<%=stuptitle%></title>
<meta content="<%=stupdesc%>" name="description"/>
<meta content="<%=stupkey%>" name="keywords"/>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
<!--
    body{
    background-image:url(bg_pic.jpg);
    background-repeat: repeat-x; 
    };
-->
</style>
<body>
<!--#include file=../top.asp--><br>
<div align="center">
	<table border="0" width="920" cellspacing="5" cellpadding="0" height="26">
		<tr>
			<td width="200" valign=top rowspan="3"><!--#include file="userleft.asp"--></td>

			<td width="691" valign=top>
			<!--右侧--><table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td><!--会员公告-->
			<table border="1" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#D4DCE5">
				<tr>
					<td height="34" background="titlebg.gif">
					<p align="left">&nbsp; <b><span style="font-size: 13pt">&nbsp; 
					完善和修改资料</span></b></td>
				</tr>
				<tr>
					<td>
					<table border="0" width="100%" cellspacing="8" cellpadding="0" bgcolor="#FFFFFF">
						<tr>
							<td><!--修改密码 start-->
								                  <% 
				  Set rs=server.createobject("ADODB.RECORDSET")
   rs.open "Select * From register where username='"&session("useridname")&"'",conn,1,3
   if rs("gaimima") <> 0 then
   response.Write "<script language='javascript'>alert('您的账号为系统测试账号，无法修改资料和密码！');window.location.href='index.asp';</script>"
   end if
%>
<FORM name="form" id="form" onSubmit="return save_onclick()" method=post>
							    <div align="center">
							    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="10" colspan="3">&nbsp;</td>
        </tr>
      <tr>
        <td width="146" height="40" align="right" class="font12h">
		<font color="#0000FF">用户名：</font></td>
        <td width="35%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FF0000"><%=session("useridname")%></font></td>
        <td width="49%"><script id="tname"></script></td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">旧密码
		（*）：</font></td>
        <td>
		<input name="jiupass" type="password" id="jiupass" size="30" style="width:217px;" /></td>
        <td>
		<p align="left">&nbsp; 请先输入您的旧密码</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h"><font color="#0000FF">新密码：</font></td>
        <td><input name="newpassword" type="password" id="newpassword" size="30" style="width:217px;" maxlength=16/></td>
        <td>
		<p align="left">&nbsp; <span class="fspan">新密码最多可输入16个字符<font color="#0000FF">（不修改请留空）</font></span></td>
      </tr>
      <tr>
        <td height="40" align="right"><span class="font12h">
		<font color="#0000FF">确认密码：</font></span></td>
        <td><input name="password2" type="password" id="password2" size="30"  style="width:217px;"/></td>
        <td>
		<p align="left">&nbsp; <span class="fspan">请再次输入新密码</span></td>
      </tr>
            <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">姓名
		（*）：</font></td>
        <td><input name="rname" type="text" id="rname" size="30"  value="<%=rs("rname")%>" maxLength=8/></td>
        <td align="left">请输入真实姓名　</td>
      </tr>
            <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">我的QQ（*）：</font></td>
        <td><input name="QQ" type="text" id="QQ" size="30" value="<%=rs("qq")%>" maxLength=12/></td>
        <td align="left"><span class="red-bcolor">*</span>QQ不能为空！</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h"><font color="#0000FF">邮箱：</font></td>
        <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000FF"><%=rs("mail")%></font></td>
        <td align="left"><span class="red-bcolor">*</span>取回密码使用，注册后不能更改</td>
      </tr>
      
      <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">密码问题
		（*）：</font></td>
        <td><span class="font12h">
          <input name="weiti" type="text" id="weiti" size="30" value="<%=rs("weiti")%>" maxLength=30/>
        </span></td>
        <td align="left">用于密码遗忘时使用</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">问题答案
		（*）：</font></td>
        <td><span class="font12h">
          <input name="daai" type="text" id="daai" size="30"  value="<%=rs("daai")%>" maxLength=30/>
        </span></td>
        <td align="left">密码遗忘时将验证此答案</td>
      </tr>
      
  
      <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">淘宝卖家号
		（*）：</font></td>
        <td class="font12h">          <span class="font12h">
          <input name="shopname" type="text" id="shopname" size="30"  value="<%=rs("shopname")%>" maxLength=30/></span></td>
        <td align="left">请填写您的卖家淘宝号</td>
      </tr>
      
  
      <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">身份证号
		（*）：</font></td>
        <td class="font12h">          <span class="font12h">
          <input name="shenfenzheng" type="text" id="shenfenzheng" size="30"  value="<%=rs("shenfenzheng")%>" maxLength=18/></span></td>
        <td align="left">请填写身份证号</td>
      </tr>
            <tr>
        <td height="40" align="right" class="font12h"><font color="#FF0000">手机
		（*）：</font></td>
        <td width="35%"><input name="phone" type="text" id="phone" size="30" value="<%=rs("phone")%>" maxLength=11/></td>
        <td width="49%" align="left">请填写手机号</td>
      </tr>
  
      <tr>
        <td height="40" align="right" class="font12h">填写更多：</td>
        <td align="left" class="red-bcolor">          （选填） </td>
        <td>　</td>
      </tr>
                   <tr>
        <td width="16%" height="40" align="right" class="font14b2">选填项目：</td>
        <td colspan="2"><hr  style="color:#FF9933"/></td>
        </tr>
      <tr>
        <td height="40" align="right" class="font12h">卖家店铺地址：</td>
        <td><input name="HomePage" type="text" id="HomePage"  size="30"  value="<%=rs("homepage")%>" /></td>
        <td align="left">你的商家店铺地址</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h">店铺描述：</td>
        <td><input name="shopnote" type="text" id="shopnote" size="30"  value="<%=rs("shopnote")%>" / ></td>
        <td align="left">你的店铺描述</td>
      </tr>
      <tr>
        <td height="30" align="right"><span class="font12h">性别：</span></td>
        <td><input name="sex" type="radio" id="radio" value="1" checked="checked"  <%if rs("sex")="1" then%>checked="checked" <%end if%> />
          男
          <input type="radio" name="sex" id="radio2" value="2"  <%if rs("sex")="2" then%>checked="checked" <%end if%>/>
          女</td>
        <td align="left">性别</td>
      </tr>
      <tr>
        <td height="45" align="right" class="font12h">联系地址：</td>
        <td><input name="address" type="text" id="address" size="30" value="<%=rs("address")%>" /></td>
        <td align="left">你的联系地址</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h">支付宝：</td>
        <td align="center" class="red-bcolor">
		<input name="zhifubao" type="text" id="zhifubao" size="30" value="<%=rs("zhifubao")%>" /></td>
        <td align="left">你的返款支付宝账号</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h">财付通：</td>
        <td align="center" class="red-bcolor">
		<input name="caifutong" type="text" id="caifutong" size="30" value="<%=rs("caifutong")%>" /></td>
        <td align="left">你的返款财付通账号</td>
      </tr>
      <tr>
        <td height="40" align="right" class="font12h">　</td>
        <td align="center" class="red-bcolor">
		<input type="submit" name="button" id="button" value="确  认  修  改" /></td>
        <td>　</td>
      </tr>
    </table>
    							</div>
    							</FORM>
    <!--修改密码 end--></td>
						</tr>



					</table>
					</td>
				</tr>
			</table>
			<!--会员公告结束--></td>
				</tr>

				<tr>
					<td>　</td>
				</tr>
			</table><!--右侧结束-->
			</td>
		</tr>
	</table>
</div>
<!--#include file=../inc/bottom.asp-->
</body>
</html>
<SCRIPT language=javascript>

function  save_onclick()
{

  var strTemp = document.form.newpassword.value;
  
  
  var strTemp1 =document.form.password2.value;
 
  
  if (strTemp!=strTemp1)
  {
      alert("两次输入密码不一致！");
      document.form.newpassword.focus();
      return false;
  }
  
var jiupass=document.form.jiupass.value
  if(jiupass=="")
  {
     alert("请先输入您的旧密码!");
	 document.form.jiupass.focus();
	 return false;
	 }

	  
  
  return true;  
}

</SCRIPT>
