<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->

<!--#include file="forbbs.asp"-->
<!--#include file="../md5.asp"-->
<%call head()
Call saycarda("修改资料")
%>




<!--#INCLUDE file="sy1.asp"-->
<%



dim TP
dim username,about,sex,city,sr,ppzone,email,age,newdatainfo,zlxg,photo
TP=Request("TP")
username=trim(request("username"))
newdatainfo=trim(request("newdatainfo"))
about=trim(request("about"))
sex=trim(request("sex"))
photo=trim(request("photo"))
ppzone=trim(request("ppzone"))
zlxg=trim(request("zlxg"))
city=trim(request("city"))
sr=trim(request("sr"))
email=trim(request("email"))
age=trim(request("age"))
urltou=request("urltou")
'username=forbbs(username)
newdatainfo=forbbs(newdatainfo)
about=forbbs(about)
city=forbbs(city)
email=forbbs(email)
sr=forbbs(sr)
if TP<>"" then
if username="" then
 Call Error("名字不能为空！")
  end if
if city="" then
 Call Error("城市不能为空！")
  end If
  if sex="" then
 Call Error("性别不能为空！")
  end If
  if sr="" then
 Call Error("各项都要填写！")
  end If
  if age="" then
 Call Error("年龄不能为空！")
  end If
  if ppzone="" then
 Call Error("空间欢迎不能为空！")
  end if
if len(username) > 10 then
  Call Error("会员昵称不能超过10个字！")
end if
if jia > 10 then
  Call Error("您已经修改过一次资料了")
end if
if len(photo) > 50 then
  Call Error("相片地址不能超过50个字符！")
end if
if len(newdatainfo) > 30 then
  Call Error("个性签名不能超过30个字！")
end if
if age="" or Isnumeric(age)=false then
  Call Error("年龄无效！")
end if

if len(age) > 3 then
  Call Error("年龄无效！")
end if
if Instr(username,"爷") or Instr(username,"奶") or Instr(username,"爸") or Instr(username,"妈") or Instr(username,"爹") then
  Call Error("系统限制昵称“"&username&"”，请重新输入！")
end if

set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select ID from Users where name='"&username&"' and id<>"&myid,conn,1,1
if not rs.eof then
  Call Error("昵称已被使用！")
  end if
rs.close
set rs=nothing

set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where id="&myid,conn,1,2
if rs.eof then
  Call Error("会员不存在！")
  end if
rs("name")=username
rs("datainfo")=newdatainfo
rs("about")=about
rs("photo")=photo
rs("sex")=sex
rs("ppzone")=ppzone
rs("zlxg")=newzlxg
rs("city")=city
rs("sr")=sr
rs("age")=age
rs("email")=email
rs.update
rs.close
set rs=nothing
Response.Write "修改资料成功！"
ELSE
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where id="&myid,conn,1,1
if rs.eof then
  Call Error("会员不存在！")
  end if
username=rs("name")
sjhmnum=rs("sjhm")
newdatainfo=rs("datainfo")
about=rs("about")
sex=rs("sex")
age=rs("age")
city=rs("city")
sr=rs("sr")
email=rs("email")
photo=rs("photo")
zlxg=rs("zlxg")
ppzone=rs("ppzone")
rs.close
set rs=nothing

if zlxg = 1 then
Response.Write "您是首次修改资料哦,系统已经赠送给您100"&getcent&"作为奖励<br/>！"
conn.execute("update users set myjb=myjb + 100,zlxg=zlxg + 1 where id="&myid)
else
Response.Write "------<br/>"
end if
 if myid<>0 then
mz="[url=/bbs/uinfo.asp?id="&myid&"&amp;saytk="&saytk&"&sid=[sid]]"&myni&"[/url]"
else
mz="游客"
end if
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"修改了个人资料')")
If saytk>1 then
%>
<form name="form" method="post" action="checkshow.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">
<%

Response.Write "社区昵称：<br/>"
 Response.Write "<input name=""username"" maxlength=""10"" value="""&username&"""/><br/>"
 Response.Write "您的性别<select name=""sex"" value='"&sex&"'>"
 Response.Write "<option value=""1"">男性</option>"
 Response.Write "<option value=""2"">女性</option>"
 Response.Write "<option value=""3"">保密</option>"
 Response.Write "</select><br/>"
 Response.Write "自定义头像：(请输入框输入您的图象地址.省掉前面的域名剩下:file/****.gif)<br/>"%>
 <a href='sctou.asp?CONTSE=<%=dlid%>&amp;sid=<%=sid%>&amp;saytk=2'>本地上传添加</a><br/><%
If urltou<>"" Then
photo1=urltou
Else
photo1=photo
End if
 Response.Write "<input name=""photo"" maxlength=""50"" value="""&photo1&"""/><br/>"
 Response.Write "个性签名：<br/>"
 Response.Write "<input name=""newdatainfo"" maxlength=""500"" value="""&newdatainfo&"""/><br/>"
 Response.Write "个人简介：<br/>"
 Response.Write "<input name=""about"" maxlength=""500"" value="""&about&"""/><br/>"
 Response.Write "您的邮箱：(找回密码用)<br/>"
 Response.Write "<input name=""email"" maxlength=""500"" value="""&email&"""/><br/>"

 Response.Write "所在城市：<br/>"
 Response.Write "<input name=""City"" maxlength=""500"" value="""&City&"""/><br/>"
 Response.Write "您的年龄：<br/>"
 Response.Write "<input name=""age"" maxlength=""500"" value="""&age&"""/><br/>"
 Response.Write "您的生日：<br/>"
 Response.Write "<input name=""sr"" maxlength=""500"" value="""&sr&"""/><br/>"
 Response.Write "[格式:如19801101]<br/>"


 
response.write "<input type=""hidden"" name=""tp"" value=""1""/>"

response.write "<input type=""submit"" name=""Submit"" value=""确定修改""></form><br/>"

else
Response.Write "社区昵称：<br/>"
 Response.Write "<input name=""username"&tt&""" maxlength=""10"" value="""&username&"""/><br/>"
 Response.Write "您的性别<select name=""sex"&tt&""" value='"&sex&"'>"
 Response.Write "<option value=""1"">男性</option>"
 Response.Write "<option value=""2"">女性</option>"
 Response.Write "<option value=""3"">保密</option>"
 Response.Write "</select><br/>"
 Response.Write "自定义头像：(请输入框输入您的图象地址.省掉前面的域名剩下:file/****.gif)<br/>"
 %>
 <a href='sctou.asp?CONTSE=<%=dlid%>&amp;sid=<%=sid%>&amp;saytk=2'>本地上传添加</a><br/><%
If urltou<>"" Then
photo1=urltou
Else
photo1=photo
End if
 Response.Write "<input name=""photo"&tt&""" maxlength=""50"" value="""&photo&"""/><br/>"

 Response.Write "个性签名：<br/>"
 Response.Write "<input name=""newdatainfo"&tt&""" maxlength=""500"" value="""&newdatainfo&"""/><br/>"
 Response.Write "个人简介：<br/>"
 Response.Write "<input name=""about"&tt&""" maxlength=""500"" value="""&about&"""/><br/>"
 Response.Write "您的邮箱：(找回密码用)<br/>"
 Response.Write "<input name=""email"&tt&""" maxlength=""500"" value="""&email&"""/><br/>"

 Response.Write "所在城市：<br/>"
 Response.Write "<input name=""City"&tt&""" maxlength=""500"" value="""&City&"""/><br/>"
 Response.Write "您的年龄：<br/>"
 Response.Write "<input name=""age"&tt&""" maxlength=""500"" value="""&age&"""/><br/>"
 Response.Write "您的生日：<br/>"
 Response.Write "<input name=""sr"&tt&""" maxlength=""500"" value="""&sr&"""/><br/>"
 Response.Write "[格式:如19801101]<br/>"

 Response.Write "<anchor>[确定修改]"
 Response.Write "<go href=""checkshow.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"" accept-charset='utf-8'>"
 Response.Write "<postfield name=""username"" value=""$(username"&tt&")""/>"
 Response.Write "<postfield name=""newdatainfo"" value=""$(newdatainfo"&tt&")""/>"
 Response.Write "<postfield name=""about"" value=""$(about"&tt&")""/>"
 Response.Write "<postfield name=""sex"" value=""$(sex"&tt&")""/>"
 Response.Write "<postfield name=""email"" value=""$(email"&tt&")""/>"
 Response.Write "<postfield name=""City"" value=""$(City"&tt&")""/>"

 Response.Write "<postfield name=""sr"" value=""$(sr"&tt&")""/>"
 Response.Write "<postfield name=""age"" value=""$(age"&tt&")""/>"
 Response.Write "<postfield name=""photo"" value=""$(photo"&tt&")""/>"
 Response.Write "<postfield name=""TP"" value=""1""/>"
 Response.Write "</go></anchor><br/>"
  end If
  End if
conn.close
set conn=nothing
  response.write "<br/><a href='show.asp?saytk="&saytk&"&amp;sid="&sid&"'>我的空间</a>"%>
<!--#include file="fanhui.asp"-->
<%
if saytk=2 then
Response.Write "<br/>页面版本：2.0|<a href='checkshow.asp?sid="&sid&"&amp;saytk=1'>1.0</a>|<a href='checkshow.asp?sid="&sid&"&amp;saytk=3'>立体版</a><br/>注：立体版为电脑浏览器专用"
%></td></tr></table><%
Response.Write "</p></body></html>"
else
if saytk=3 then
Response.Write "<br/>页面版本：立体版|<a href='checkshow.asp?sid="&sid&"&amp;saytk=1'>1.0</a>|<a href='checkshow.asp?sid="&sid&"&amp;saytk=2'>2.0</a><br/>注：立体版为电脑浏览器专用"
%></td></tr></table><%
Response.Write "</p></FONT></body></html>"
else
Response.Write "<br/>页面版本：1.0|<a href='checkshow.asp?sid="&sid&"&amp;saytk=2'>2.0</a>|<a href='checkshow.asp?sid="&sid&"&amp;saytk=3'>立体版</a><br/>注：立体版为电脑浏览器专用"
Response.Write "</p></card></wml>"
end if
end if
%>