<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: modifyfd.asp
' Version:3.0
' Date: 2005-11-6
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
stats="交友资料修改"
call nav()
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有登陆，请登陆后进行修改。"
	founderr=true
end if

if founderr then
  	errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
	call head_var("","")
	call Mslove_error()
else
	call head_var(membername & "的帐号","mycount.asp")
	if request("action")="updat" then
		call upreg()
		if founderr then
		call Mslove_error()
		else
			sucmsg="<li>修改交友资料成功！"
			call Mslove_suc()
		end if
	else
		call userinfo()
	end if
end if
call activeonline()
call footer()

sub userinfo()
dim Userfriendinfo,health,Pheight,Pweight,figure
dim mylook,fug,income,alcohol,houses,language
set rs=server.createobject("adodb.recordset")
sql="Select Userfriends,Userheight from [Ms_User] where userid="&userid
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
	founderr=true
	exit sub
else
Userfriendinfo=rs("Userfriends")
Pheight=rs("Userheight")
end if
rs.close
set rs=nothing
if Userfriendinfo<>"" then
	Userfriendinfo=split(Userfriendinfo,"|||")
	if ubound(Userfriendinfo)=8 then
	health=Userfriendinfo(0)
	Pweight=Userfriendinfo(1)
	figure=Userfriendinfo(2)
	mylook=Userfriendinfo(3)
	fug=Userfriendinfo(4)
	income=Userfriendinfo(5)
	alcohol=Userfriendinfo(6)
	houses=Userfriendinfo(7)
	language=Userfriendinfo(8)
	else
	health=""
	Pweight=""
	figure=""
	mylook=""
	fug=""
	income=""
	alcohol=""
	houses=""
	language=""
	end if
else
	health=""
	Pweight=""
	figure=""
	mylook=""
	fug=""
	income=""
	alcohol=""
	houses=""
	language=""
end if
%>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr>
<th width=12% height=25 id=tabletitlelink><a href=mycount.asp>我的帐号</a></th>
<th width=11%  id=tabletitlelink><a href=mymodify.asp>基本资料</a></th>
<th width=11%  id=tabletitlelink><a href=modifypsw.asp>密码修改</a></th>
<th width=11%  id=tabletitlelink><a href=modifyfd.asp>交友资料</a></th>
<th width=11%  id=tabletitlelink><a href=modifyadd.asp>联系资料</a></th>
<th width=11%  id=tabletitlelink><a href=usersms.asp>短信服务</a></th>
<th width=11%  id=tabletitlelink><a href=friendlist.asp>我的好友</a></th>
<th width=11%  id=tabletitlelink><a href=favlist.asp>我的收藏</a></th>
<th width=11%  id=tabletitlelink><a href=userphoto.asp>我的相册</a></th>
</tr>
</table>
<form action="modifyfd.asp?action=updat" method=POST name="theForm">
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr> 
        <th height=28 valign=middle colspan=2><b>交友资料信息</b></th>
      <tr> 
        <td height="26"  class=tablebody1><strong>健康程度：</strong></td>
        <td width=60%  class=tablebody1><select name=health>
            <option <%if health="" then%>selected<%end if%>></option>
            <option value=体弱多病 <%if health="体弱多病" then%>selected<%end if%>>体弱多病</option>
            <option value=体质一般 <%if health="体质一般" then%>selected<%end if%>>体质一般</option>
            <option value=很健康 <%if health="很健康" then%>selected<%end if%>>很健康</option>
            <option value=棒极了 <%if health="棒极了" then%>selected<%end if%>>棒极了</option>
          </select></td>
      </tr>
      <tr> 
        <td height="3"  class=tablebody1><strong>身　　高：</strong></td>
        <td width=60%  class=tablebody1><input name=Pheight type=text size=6 maxlength="4" value=<%=Pheight%>>
          厘米</td>
      </tr>
      <tr> 
        <td height="3"  class=tablebody1><strong>体　　重：</strong></td>
        <td  class=tablebody1><input name=Pweight type=text size=6 maxlength="4" value=<%=Pweight%>>
          公斤</td>
      </tr>
      <tr> 
        <td height="1"  class=tablebody1><strong>体　　型：</strong></td>
        <td  class=tablebody1><SELECT name=figure>
            <option <%if figure="" then%>selected<%end if%>></option>
			<option value=瘦 <%if figure="瘦" then%>selected<%end if%>>瘦</option>
            <option value=较瘦 <%if figure="较瘦" then%>selected<%end if%>>较瘦</option>
			<option value=匀称 <%if figure="匀称" then%>selected<%end if%>>匀称</option>
			<option value=苗条 <%if figure="苗条" then%>selected<%end if%>>苗条</option>
			<option value=高挑 <%if figure="高挑" then%>selected<%end if%>>高挑</option>
			<option value=丰满 <%if figure="丰满" then%>selected<%end if%>>丰满</option>
			<option value=健壮 <%if figure="健壮" then%>selected<%end if%>>健壮</option>
			<option value=魁梧 <%if figure="魁梧" then%>selected<%end if%>>魁梧</option>
			<option value=较胖 <%if figure="较胖" then%>selected<%end if%>>较胖</option>
			<option value=胖 <%if figure="胖" then%>selected<%end if%>>胖</option>
          </SELECT>&nbsp;&nbsp;相貌自评：<select name=mylook>
              <option <%if mylook="" then%>selected<%end if%>></option>
              <option value=1 <%if mylook="1" then%>selected<%end if%>>1</option>
              <option value=2 <%if mylook="2" then%>selected<%end if%>>2</option>
              <option value=3 <%if mylook="3" then%>selected<%end if%>>3</option>
              <option value=4 <%if mylook="4" then%>selected<%end if%>>4</option>
              <option value=5 <%if mylook="5" then%>selected<%end if%>>5</option>
              <option value=6 <%if mylook="6" then%>selected<%end if%>>6</option>
              <option value=7 <%if mylook="7" then%>selected<%end if%>>7</option>
              <option value=8 <%if mylook="8" then%>selected<%end if%>>8</option>
              <option value=9 <%if mylook="9" then%>selected<%end if%>>9</option>
              <option value=10 <%if mylook="10" then%>selected<%end if%>>10</option>
            </select>
            (10分为满分) </font></td>
      </tr>
      <tr>
        <td height="1"  class=tablebody1><strong>是否吸烟：</strong></td>
        <td  class=tablebody1><SELECT name=fug>
                      <option <%if fug="" then%>selected<%end if%>></option>
                      <option value=厌恶 <%if fug="厌恶" then%>selected<%end if%>>厌恶</option>
                      <option value=不吸 <%if fug="不吸" then%>selected<%end if%>>不吸</option>
                      <option value=偶尔 <%if fug="偶尔" then%>selected<%end if%>>偶尔</option>
                      <option value=经常 <%if fug="经常" then%>selected<%end if%>>经常</option>
                    </SELECT>&nbsp;&nbsp;收入水平：
					<select name=income>
              <option <%if income="" then%>selected<%end if%>></option>
          <option value=1000以下 <%if income="1000以下" then%>selected<%end if%>>1000以下</option>
          <option value=1000-2000 <%if income="1000-2000" then%>selected<%end if%>>1000-2000</option>
          <option value=2000-3000 <%if income="2000-3000" then%>selected<%end if%>>2000-3000</option>
          <option value=3000-4000 <%if income="3000-4000" then%>selected<%end if%>>3000-4000</option>
          <option value=4000-5000 <%if income="4000-5000" then%>selected<%end if%>>4000-5000</option>
          <option value=5000-6000 <%if income="5000-6000" then%>selected<%end if%>>5000-6000</option>
          <option value=6000-7000 <%if income="6000-7000" then%>selected<%end if%>>6000-7000</option>
          <option value=7000-10000 <%if income="7000-10000" then%>selected<%end if%>>7000-10000</option>
          <option value=10000以上 <%if income="10000以上" then%>selected<%end if%>>10000以上</option>
            </select></td>
      </tr>
      <tr>
        <td height="3"  class=tablebody1><strong>是否喝酒：</strong></td>
        <td  class=tablebody1><SELECT name=alcohol>
                      <option <%if alcohol="" then%>selected<%end if%>></option>
                      <option value=厌恶 <%if alcohol="厌恶" then%>selected<%end if%>>厌恶</option>
                      <option value=不喝 <%if alcohol="不喝" then%>selected<%end if%>>不喝</option>
                      <option value=偶尔 <%if alcohol="偶尔" then%>selected<%end if%>>偶尔</option>
                      <option value=经常 <%if alcohol="经常" then%>selected<%end if%>>经常</option>
                    </SELECT>&nbsp;&nbsp;住房状况：<select name=houses>
              <option <%if houses="" then%>selected<%end if%>></option>
              <option value=自有房 <%if houses="自有房" then%>selected<%end if%>>自有房</option>
			  <option value=与人合租 <%if houses="与人合租" then%>selected<%end if%>>与人合租</option>
			  <option value=独自租房 <%if houses="独自租房" then%>selected<%end if%>>独自租房</option>
			  <option value=与父母同住 <%if houses="与父母同住" then%>selected<%end if%>>与父母同住</option>
			  <option value=住亲朋家 <%if houses="住亲朋家" then%>selected<%end if%>>住亲朋家</option>
			  <option value=住单位房 <%if houses="住单位房" then%>selected<%end if%>>住单位房</option> 
            </select></td>
      </tr>
      <tr> 
        <td height="16"  class=tablebody1><strong>掌握语言：</strong></td>
        <td  class=tablebody1>
		<input type=checkbox name=language value=普通话 <%if instr(language,"普通话")>0 then response.write "checked" end if%>>普通话 
          <input type=checkbox name=language value=上海话 <%if instr(language,"上海话")>0 then response.write "checked" end if%>>上海话
<input type=checkbox name=language value=广东话 <%if instr(language,"广东话")>0 then response.write "checked" end if%>>广东话
<input type=checkbox name=language value=其他方言 <%if instr(language,"其他方言")>0 then response.write "checked" end if%>>其他方言
<input type=checkbox name=language value=英语 <%if instr(language,"英语")>0 then response.write "checked" end if%>>英语
<br><input type=checkbox name=language value=日语 <%if instr(language,"日语")>0 then response.write "checked" end if%>>日语
<input type=checkbox name=language value=韩语 <%if instr(language,"韩语")>0 then response.write "checked" end if%>>韩语
<input type=checkbox name=language value=法语 <%if instr(language,"法语")>0 then response.write "checked" end if%>>法语
<input type=checkbox name=language value=德语 <%if instr(language,"德语")>0 then response.write "checked" end if%>>德语
<input type=checkbox name=language value=俄语 <%if instr(language,"俄语")>0 then response.write "checked" end if%>>
          俄语 
          <input type=checkbox name=language value=其它 <%if instr(language,"其它")>0 then response.write "checked" end if%>>其它</td>
      </tr>
    <tr align="center"> 
      <td colspan="2" width="100%"  class=tablebody2>
            <input class=2 type=Submit value="更 新" name="Submit"> &nbsp; <input class=2 type="reset" name="Submit2" value="清 除">
      </td>
    </tr>
	<tr align="center"> 
      <td colspan="2" width="100%"  class=tablebody1 align="left"><font color=red>注意：</font><br>　　请您认真填写，未来意中人对您的第一印象也许就从这里产生。您的真诚，也许就会收获你一生的幸福！ 
      </td>
    </tr>
    </table></form>
</body>
</html> 
<%
end sub

sub upreg()
dim Pheight,Pweight,Userfriends
Pheight=checkreal(trim(Request.Form("Pheight")))
if Pheight="" or not isInteger(Pheight) then
errmsg=errmsg+"<br>"+"<li>请输入身高为数字型数字。"
		founderr=true
end if
Pweight=checkreal(trim(Request.Form("Pweight")))
if Pweight="" or not isInteger(Pweight) then
errmsg=errmsg+"<br>"+"<li>请输入体重为数字型数字。"
		founderr=true
end if
Userfriends=Request.Form("health") & "|||" & Pweight & "|||" & Request.Form("figure") & "|||" & Request.Form("mylook")& "|||" & Request.Form("fug")& "|||" & Request.Form("income")& "|||" & Request.Form("alcohol")& "|||" & Request.Form("houses")& "|||" & checkreal(Request.Form("language"))

if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")
sql="Select Userfriends,Userheight from [Ms_User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
	errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
	founderr=true
	exit sub
else
	rs("Userfriends")=Userfriends
	rs("Userheight")=Pheight
	rs.Update
end if
rs.close
set rs=nothing
end sub

function checkreal(v)
dim w
if not isnull(v) then
	w=replace(v,"|||","§§§")
	checkreal=w
end if
end function
%>   