<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="forbbs.asp"-->
<!--#include file="chinahanzi.asp"-->
<card title="修改用户资料"><p>
<%
dim TP,ids
ids=Request("ids")
if ids="" or Isnumeric(ids)=False then
  Call Error("ID无效！")
  end if
'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT name FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("会员ID不存在！")
end if
  rs.close
  set rs=Nothing

dim username,about,sex,city,sr,email,age,newdatainfo,sjhmnum,cent,sore,pass,newrmbcent
TP=Request("TP")
sjhmnum=trim(request("sjhmnum"))
username=trim(request("username"))
pass=trim(request("pass"))
newdatainfo=trim(request("newdatainfo"))
about=trim(request("about"))
sex=trim(request("sex"))
city=trim(request("city"))
sr=trim(request("sr"))
email=trim(request("email"))
age=trim(request("age"))
cent=trim(request("cent"))
newrmbcent=trim(request("newrmbcent"))
sore=trim(request("sore"))
banks=trim(request("banks"))
bankj=trim(request("bankj"))
username=forbbs(username)
newdatainfo=forbbs(newdatainfo)
about=forbbs(about)
city=forbbs(city)
email=forbbs(email)
sr=forbbs(sr)
if TP<>"" then
'if sjhmnum="" or username="" or about="kkuy" or city="54345ii" or sex="" or sr="" or age="199" or cent="ku" or pass="" then
 'Call Error("各项都要填写！")
  'end if

if len(username) > 10 then
  Call Error("会员昵称不能超过10个字！")
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 cent="" or Isnumeric(cent)=false then
  Call Error(""&getcent&"无效！")
end if
if sore="" or Isnumeric(sore)=false then
  Call Error("经验无效！")
end if

if newrmbcent="" or Isnumeric(newrmbcent)=false then
  Call Error("元宝无效！")
end if

if banks="" or Isnumeric(banks)=false then
  Call Error("银行币无效！")
end if
if bankj="" or Isnumeric(bankj)=false 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
'过滤昵称
'dim h
'for h = 1 to len(username)
 ' if Instr(chinahanzi,mid(username,h,1))=0 then
  'Call Error("会员昵称只能是汉字、字母、数字组成！")
  'end if
'next

'if Isnumeric(sjhmnum)=false then 
    'Call Error("请输入正确的手机号！")
  'end if
'if len(sjhmnum)<>11 then 
    'Call Error("请输入正确的手机号！")
  'end if
'if left(sjhmnum,2)<>13 and left(sjhmnum,2)<>15 then 
    'Call Error("请输入正确的手机号！")
  'end if

'set rs=Server.CreateObject("ADODB.Recordset")
  'rs.open"select ID from Users where name='"&username&"' and id<>"&ids,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 sjhm from [Users] where [sjhm]='"&sjhmnum&"' and id<>"&ids,conn,1,1
'if not rs.eof then
'rs.close
'set rs=nothing
    'Call Error("该该手机号已经被注册！")
  'end if
'rs.close
'set rs=nothing
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where id="&ids,conn,1,2
if rs.eof then
  Call Error("会员不存在！")
  end if
rs("sjhm")=sjhmnum
rs("name")=username
rs("mm")=pass
rs("datainfo")=newdatainfo
rs("about")=about
rs("sex")=sex
rs("city")=city
rs("sr")=sr
rs("age")=age
rs("myjb")=cent
rs("rmbcent")=newrmbcent
rs("myjy")=sore
rs("bank")=banks
rs("bankjie")=bankj
rs("email")=email
rs.update
rs.close
set rs=nothing
 Response.Write "修改资料成功！<br/>"
ELSE
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where id="&ids,conn,1,1
if rs.eof then
  Call Error("会员不存在！")
  end if
username=ubb(rs("name"))
sjhmnum=rs("sjhm")
pass=rs("mm")
newdatainfo=ubb(rs("datainfo"))
about=ubb(rs("about"))
sex=rs("sex")
age=rs("age")
cent=rs("myjb")
newrmbcent=rs("rmbcent")
banks=rs("bank")
bankj=rs("bankjie")
sore=rs("myjy")
city=ubb(rs("city"))
sr=rs("sr")
email=ubb(rs("email"))
rs.close
set rs=nothing


 Response.Write "社区昵称：<br/>"
 Response.Write "<input name=""username"&tt&""" maxlength=""10"" value="""&username&"""/><br/>"
 Response.Write "手机号码：<br/>"
 Response.Write "<input name=""sjhmnum"&tt&""" maxlength=""11"" value="""&sjhmnum&"""/><br/>"
 Response.Write "用户密码：<br/>"
 Response.Write "<input name=""pass"&tt&""" maxlength=""11"" value="""&pass&"""/><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 "个性签名：<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 ""&getcent&"：<br/>"
 Response.Write "<input name=""cent"&tt&""" maxlength=""500"" value="""&cent&"""/><br/>"
  Response.Write "银行：<br/>"
 Response.Write "<input name=""banks"&tt&""" maxlength=""500"" value="""&banks&"""/><br/>"
   Response.Write "贷款：<br/>"
 Response.Write "<input name=""bankj"&tt&""" maxlength=""500"" value="""&bankj&"""/><br/>"
 Response.Write "经验：<br/>"
 Response.Write "<input name=""sore"&tt&""" maxlength=""500"" value="""&sore&"""/><br/>"
 Response.Write "元宝：<br/>"
 Response.Write "<input name=""newrmbcent"&tt&""" maxlength=""500"" value="""&newrmbcent&"""/><br/>"
 Response.Write "<anchor>[确定修改]"
 Response.Write "<go href=""adminedituser.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=""sjhmnum"" value=""$(sjhmnum"&tt&")""/>"
 Response.Write "<postfield name=""pass"" value=""$(pass"&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=""cent"" value=""$(cent"&tt&")""/>"
 Response.Write "<postfield name=""sore"" value=""$(sore"&tt&")""/>"
 Response.Write "<postfield name=""newrmbcent"" value=""$(newrmbcent"&tt&")""/>"
  Response.Write "<postfield name=""banks"" value=""$(banks"&tt&")""/>"
 Response.Write "<postfield name=""bankj"" value=""$(bankj"&tt&")""/>"
 Response.Write "<postfield name=""TP"" value=""1""/>"
 Response.Write "<postfield name=""ids"" value="""&ids&"""/>"
 Response.Write "</go></anchor><br/>"
  end if
conn.close
set conn=nothing
response.write"<a href=""show.asp?id="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">用户信息</a>"
%><!--#include file="fanhui.asp"-->
</p></card>
</wml>