<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/function.asp"-->

<html>
<head>
<title>修改注册用户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="new/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
BODY {
	scrollbar-face-color:#DDDDDD;
	scrollbar-highlight-color: #cccccc;
	scrollbar-shadow-color: #CCCCCC;
	scrollbar-3dlight-color: #F5F5F5;
	scrollbar-darkshadow-color: #F5F5F5;
	scrollbar-track-color: #F0F0F0;
	scrollbar-arrow-color: #FFFFFF;
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
</style></head> 
<body bgcolor="ffffff">
<%
if CheckUserLogined()=False then
	response.Redirect "User_Login.asp"
end if

dim Action,FoundErr,ErrMsg
dim rsUser,sqlUser
Action=trim(request("Action"))
if  UserName="" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>参数不足！</li>"
end if
if FoundErr=true then
	call WriteErrMsg()
else
	Set rsUser=Server.CreateObject("Adodb.RecordSet")
	sqlUser="select * from " & db_User_Table & " where " & db_User_Name & "='" & UserName & "'"
	rsUser.Open sqlUser,Conn_User,1,3
	if rsUser.bof and rsUser.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的用户！</li>"
		call writeErrMsg()
	else
		if Action="Modify" then
			dim Sex,Email,Homepage,Company,Department,jszc
			Sex=trim(Request("Sex"))
			city=trim(Request("city"))
			Email=trim(request("Email"))
			Homepage=trim(request("Homepage"))
			ddlYear=trim(request("ddlYear"))			
                           YueSelect=trim(request("YueSelect"))
		         RiSelect=trim(request("RiSelect"))
		         age=trim(request("age"))
			OICQ=trim(request("OICQ"))
		         xinz=trim(request("xinz"))
			UserPhoto=trim(request("UserPhoto"))
			Userinfo=trim(request("Userinfo"))
			if Sex="" then
				founderr=true
				errmsg=errmsg & "<br><li>性别不能为空</li>"
			else
				sex=cint(sex)
				if Sex<>0 and Sex<>1 then
					Sex=1
				end if
			end if
			if Email="" then
				founderr=true
				errmsg=errmsg & "<br><li>Email不能为空</li>"
			else
				if IsValidEmail(Email)=false then
					errmsg=errmsg & "<br><li>您的Email有错误</li>"
			   		founderr=true
				end if
			end if
			if FoundErr<>true then
				rsUser(db_User_Sex)=Sex
				rsUser(db_User_Email)=Email
				rsUser(db_User_city)=city
				rsUser(db_User_Homepage)=HomePage
                                     rsUser(db_User_ddlYear)=ddlYear
	                            rsUser(db_User_YueSelect)=YueSelect
	                            rsUser(db_User_RiSelect)=RiSelect
	                            rsUser(db_User_age)=age
				rsUser(db_User_QQ)=OICQ
				rsUser(db_User_xinz)=xinz
                            	rsUser(db_User_UserPhoto)=UserPhoto
				rsUser(db_User_Userinfo)=Userinfo
				
				rsUser.update
				%>
				
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" height="1"></td>
      <td height="1" bgcolor="#BCBCBC"></td>
      <td width="1" height="1"></td>
    </tr>
    <tr>
      <td bgcolor="#BCBCBC"></td>
      <td height="25" align="left" bgcolor="f2f2f2"><div align="center"><strong>---&nbsp;个人信息&nbsp;---</strong></div></td>
      <td bgcolor="#BCBCBC"></td>
    </tr>
  </table>
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="bcbcbc">
    <tr bgcolor="ffffff">
      <td colspan="3" align="center"><p><br>
        信息修改成功<br>
        <br>
      </p>
      </td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td bgcolor="#BCBCBC"></td>
      <td height="25" align="center" bgcolor="fafafa"><a href="User_ModifyInfo.asp" target="_self">返回管理</a></td>
      <td bgcolor="#BCBCBC"></td>
    </tr>
    <tr>
      <td width="1" height="1"></td>
      <td height="1" bgcolor="#BCBCBC"></td>
      <td width="1" height="1"></td>
    </tr>
  </table>
				<%
			else
				call WriteErrMsg()
			end if
		else

%>

<FORM name="Form1" action="User_ModifyInfo.asp" method="post">
  <table width=100% border=0 align="center" cellpadding=5 cellspacing=1 bgcolor="#CCCCCC" >
   <TR align="center" bgcolor="#FFFFFF" class="tdbg" > 
      <TD colspan="4" bgcolor="#f2f2f2"> 
        <strong>--- 修改个人信息 ---</strong></TD>
    </TR>
    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD width="100" height="30" align="right"><b>用 户 名：</b></TD>
      <TD colspan="3"> <%=Trim(Request.Cookies("asp163")("UserName"))%> 
        <input name="UserName" type="hidden" value="<%=Trim(Request.Cookies("asp163")("UserName"))%>">
      <font class=en><b>&nbsp;&nbsp;&nbsp;</b>&nbsp;<a href="User_ModifyPwd.asp" target="_self"><font color="#CC0000">修改密码</font></a></font></TD>
    </TR>
    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>性别：</strong></TD>
      <TD width="100"> 
        <INPUT type=radio value="1" name=sex <%if rsUser(db_User_Sex)=1 then response.write "CHECKED"%>>
        男 &nbsp;&nbsp; <INPUT type=radio value="0" name=sex <%if rsUser(db_User_Sex)=0 then response.write "CHECKED"%>>
        女</TD>
      <TD width="50" align="center"><strong>&nbsp;&nbsp;地区:</strong></TD>
      <TD><select name="city">
        <option value="北京" <%if rsUser(db_User_city)="北京" then %>selected<%else%><%end if%>>北京</option>
        <option value="天津" <%if rsUser(db_User_city)="天津" then %>selected<%else%><%end if%>>天津</option>
        <option value="河北" <%if rsUser(db_User_city)="河北" then %>selected<%else%><%end if%>>河北</option>
        <option value="山西" <%if rsUser(db_User_city)="山西" then %>selected<%else%><%end if%>>山西</option>
        <option value="内蒙古" <%if rsUser(db_User_city)="内蒙古" then %>selected<%else%><%end if%>>内蒙古</option>
        <option value="辽宁" <%if rsUser(db_User_city)="辽宁" then %>selected<%else%><%end if%>>辽宁</option>
        <option value="吉林" <%if rsUser(db_User_city)="吉林" then %>selected<%else%><%end if%>>吉林</option>
        <option value="黑龙江" <%if rsUser(db_User_city)="黑龙江" then %>selected<%else%><%end if%>>黑龙江</option>
        <option value="上海" <%if rsUser(db_User_city)="上海" then %>selected<%else%><%end if%>>上海</option>
        <option value="江苏" <%if rsUser(db_User_city)="江苏" then %>selected<%else%><%end if%>>江苏</option>
        <option value="浙江" <%if rsUser(db_User_city)="浙江" then %>selected<%else%><%end if%>>浙江</option>
        <option value="安徽" <%if rsUser(db_User_city)="安徽" then %>selected<%else%><%end if%>>安徽</option>
        <option value="福建" <%if rsUser(db_User_city)="福建" then %>selected<%else%><%end if%>>福建</option>
        <option value="江西" <%if rsUser(db_User_city)="江西" then %>selected<%else%><%end if%>>江西</option>
        <option value="山东" <%if rsUser(db_User_city)="山东" then %>selected<%else%><%end if%>>山东</option>
        <option value="河南" <%if rsUser(db_User_city)="河南" then %>selected<%else%><%end if%>>河南</option>
        <option value="湖北" <%if rsUser(db_User_city)="湖北" then %>selected<%else%><%end if%>>湖北</option>
        <option value="湖南" <%if rsUser(db_User_city)="湖南" then %>selected<%else%><%end if%>>湖南</option>
        <option value="广东" <%if rsUser(db_User_city)="广东" then %>selected<%else%><%end if%>>广东</option>
        <option value="广西" <%if rsUser(db_User_city)="广西" then %>selected<%else%><%end if%>>广西</option>
        <option value="海南" <%if rsUser(db_User_city)="海南" then %>selected<%else%><%end if%>>海南</option>
        <option value="重庆" <%if rsUser(db_User_city)="重庆" then %>selected<%else%><%end if%>>重庆</option>
        <option value="四川" <%if rsUser(db_User_city)="四川" then %>selected<%else%><%end if%>>四川</option>
        <option value="贵州" <%if rsUser(db_User_city)="贵州" then %>selected<%else%><%end if%>>贵州</option>
        <option value="云南" <%if rsUser(db_User_city)="云南" then %>selected<%else%><%end if%>>云南</option>
        <option value="西藏" <%if rsUser(db_User_city)="西藏" then %>selected<%else%><%end if%>>西藏</option>
        <option value="陕西" <%if rsUser(db_User_city)="陕西" then %>selected<%else%><%end if%>>陕西</option>
        <option value="甘肃" <%if rsUser(db_User_city)="甘肃" then %>selected<%else%><%end if%>>甘肃</option>
        <option value="青海" <%if rsUser(db_User_city)="青海" then %>selected<%else%><%end if%>>青海</option>
        <option value="宁夏" <%if rsUser(db_User_city)="宁夏" then %>selected<%else%><%end if%>>宁夏</option>
        <option value="新疆" <%if rsUser(db_User_city)="新疆" then %>selected<%else%><%end if%>>新疆</option>
        <option value="台湾" <%if rsUser(db_User_city)="台湾" then %>selected<%else%><%end if%>>台湾</option>
        <option value="香港" <%if rsUser(db_User_city)="香港" then %>selected<%else%><%end if%>>香港</option>
        <option value="澳门" <%if rsUser(db_User_city)="澳门" then %>selected<%else%><%end if%>>澳门</option>
        <option value="国外" <%if rsUser(db_User_city)="国外" then %>selected<%else%><%end if%>>国外</option>
            </select> </TD>
    </TR>
    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>Email地址：</strong></TD>
      <TD colspan="3"> 
        <INPUT name=Email value="<%=rsUser(db_User_Email)%>" size=40   maxLength=50>      </TD>
    </TR>
   
    
    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>OICQ号码：</strong></TD>
      <TD colspan="3"> 
        <INPUT name=OICQ id="OICQ" value="<%=rsUser(db_User_QQ)%>" size=40 maxLength=10>      </TD>
    </TR>

    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>年  龄：</strong></TD>
      <TD colspan="3"> 
        <INPUT name=age id="age" value="<%=rsUser(db_User_age)%>" size=40 maxLength=10>      </TD>
    </TR>



    <TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>生  日：</strong></TD>
      <TD colspan="3"> 
        <INPUT name=ddlYear id="ddlYear" value="<%=rsUser(db_User_ddlYear)%>" size=10 maxLength=10>年
<INPUT name=YueSelect id="YueSelect" value="<%=rsUser(db_User_YueSelect)%>" size=5 maxLength=2>月<INPUT name=RiSelect id="RiSelect" value="<%=rsUser(db_User_RiSelect)%>" size=5 maxLength=2>日 


















       </TD>
    </TR>

<TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>星座：</strong></TD>
      <TD colspan="3"> 
<select name="xinz">
        <option value="白羊座" <%if rsUser(db_User_xinz)="白羊座" then %>selected<%else%><%end if%>>白羊座</option>
        <option value="金牛座" <%if rsUser(db_User_xinz)="金牛座" then %>selected<%else%><%end if%>>金牛座</option>
        <option value="双子座" <%if rsUser(db_User_xinz)="双子座" then %>selected<%else%><%end if%>>双子座</option>
        <option value="巨蟹座" <%if rsUser(db_User_xinz)="巨蟹座" then %>selected<%else%><%end if%>>巨蟹座</option>
        <option value="狮子座" <%if rsUser(db_User_xinz)="狮子座" then %>selected<%else%><%end if%>>狮子座</option>
        <option value="处女座" <%if rsUser(db_User_xinz)="处女座" then %>selected<%else%><%end if%>>处女座</option>
        <option value="天秤座" <%if rsUser(db_User_xinz)="天秤座" then %>selected<%else%><%end if%>>天秤座</option>
        <option value="天蝎座" <%if rsUser(db_User_xinz)="天蝎座" then %>selected<%else%><%end if%>>天蝎座</option>
        <option value="射手座" <%if rsUser(db_User_xinz)="射手座" then %>selected<%else%><%end if%>>射手座</option>
        <option value="魔羯座" <%if rsUser(db_User_xinz)="魔羯座" then %>selected<%else%><%end if%>>魔羯座</option>
        <option value="水瓶座" <%if rsUser(db_User_xinz)="水瓶座" then %>selected<%else%><%end if%>>水瓶座</option>
        <option value="双鱼座" <%if rsUser(db_User_xinz)="双鱼座" then %>selected<%else%><%end if%>>双鱼座</option>
            </select>     </TD>
    </TR>

<TR bgcolor="#FFFFFF" class="tdbg" > 
      <TD align="right"><strong>个人简介：</strong></TD>
      <TD colspan="3"> 

<textarea name="homepage" cols="39" rows="5" id="textarea"><%=rsUser(db_User_homepage)%></textarea>

 200字内     </TD>
    </TR>



    <TR align="center" bgcolor="#FFFFFF" class="tdbg" > 
      <TD height="20" rowspan="2"> 
        <div align="right"><strong>上传头像：</strong></div>
        <div align="right">        150x120&nbsp;&nbsp;&nbsp;&nbsp; </div></TD>
      <TD height="9" colspan="3" align="left"> 
        <input name="UserPhoto" type="text" id="UserPhoto" value="<%=rsUser(db_User_userphoto)%>" size="40" maxlength="200"></TD>
    </TR>
    <TR align="center" class="tdbg" >
      <TD height="10" colspan="3" align="left" bgcolor="#FFFFFF"> 
        <iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=5" frameborder=0 scrolling=no width="290" height="25"></iframe></TD>
    </TR>
    <TR align="center" bgcolor="#FFFFFF" class="tdbg" > 
      <TD height="40" colspan="4"> 
        <input name="Action" type="hidden" id="Action" value="Modify"> 
        <input name=Submit   type=submit id="Submit" value="保存修改结果"></TD>
    </TR>
  </TABLE>
</form>

</body>
</html>
<%
		end if
	end if
	rsUser.close
	set rsUser=nothing
end if
call CloseConn_User()
%>
