<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="forbbs.asp"-->
<!--#include file="chinahanzi.asp"-->
<%
call head()
Call saycarda("修改用户资料")
dim TP,ids
ids=Request("ids")
if ids="" or Isnumeric(ids)=False then
  Call Error("ID无效！")
  end If
  if KEYid<>1 then 
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>权限不足！")
else
  Call Error("<card title=""警告""><p>权限不足！")
  end if
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,aaaa,bbbb,dddd,ye,regtime,myip,cwsm,cwpz,cwrq,cwxq,cwqg,cwzs,cwzt,cwhh,cwsmk,cwjkk,kkkk
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"))
ye=trim(request("ye"))
cwsm=trim(request("cwsm"))
cwrq=trim(request("cwrq"))
cwxq=trim(request("cwxq"))
kkkk=trim(request("kkkk"))
cwqg=trim(request("cwqg"))
cwzs=trim(request("cwzs"))
cwpz=trim(request("cwpz"))
cwhh=trim(request("cwhh"))
cwsmk=trim(request("cwsmk"))
cwjkk=trim(request("cwjkk"))
cwzt=trim(request("cwzt"))
cent=trim(request("cent"))
myip=trim(request("myip"))
regtime=trim(request("regtime"))
bbbb=trim(request("bbbb"))
aaaa=trim(request("aaaa"))
dddd=trim(request("dddd"))
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="" or city="" or sex="" or sr="" or age="" or cent="" 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 aaaa="" or Isnumeric(aaaa)=false then
  Call Error("体力无效！")
end if

if bbbb="" or Isnumeric(bbbb)=false then
  Call Error("魅力无效！")
end if

if dddd="" or Isnumeric(dddd)=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("myip")=myip
rs("city")=city
rs("sr")=sr
rs("age")=age
rs("ye")=ye
rs("wap_888cj_cn")=kkkk
rs("cwzt")=cwzt
rs("cw")=cwpz
rs("cwsm")=cwsm
rs("cwrq")=cwrq
rs("cwxq")=cwxq
rs("cwqg")=cwqg
rs("cwzs")=cwzs
rs("cwsmk")=cwsmk
rs("cwhh")=cwhh
rs("cwjkk")=cwjkk
rs("myjb")=cent
rs("rmbcent")=newrmbcent
rs("myjy")=sore
rs("mytl")=aaaa
rs("myml")=bbbb
rs("mych")=dddd
rs("regtime")=regtime
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")
ye=rs("ye")
myip=rs("myip")
cwpz=rs("cw")
cwsm=rs("cwsm")
cwrq=rs("cwrq")
cwxq=rs("cwxq")
kkkk=rs("wap_888cj_cn")
cwqg=rs("cwqg")
cwzs=rs("cwzs")
cwzt=rs("cwzt")
cwhh=rs("cwhh")
cwsmk=rs("cwsmk")
cwjkk=rs("cwjkk")
newrmbcent=rs("rmbcent")
banks=rs("bank")
regtime=rs("regtime")
bankj=rs("bankjie")
sore=rs("myjy")
bbbb=rs("myml")
aaaa=rs("mytl")
dddd=rs("mych")
city=ubb(rs("city"))
sr=rs("sr")
email=ubb(rs("email"))
rs.close
set rs=nothing
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""adminedituser.asp?sid="&sid&"&amp;saytk="&saytk&""">"
 Response.Write "社区昵称：<br/>"
 Response.Write "<input name=""username"" maxlength=""10"" value="""&username&"""/><br/>"
 Response.Write "手机号码：<br/>"
 Response.Write "<input name=""sjhmnum"" maxlength=""11"" value="""&sjhmnum&"""/><br/>"
 Response.Write "用户密码：<br/>"
 Response.Write "<input name=""pass"" maxlength=""11"" value="""&pass&"""/><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 "帐户余额：<br/>"
 Response.Write "<input name=""ye"" maxlength=""500"" value="""&ye&"""/><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 "注册时间：<br/>"
 Response.Write "<input name=""regtime"" maxlength=""500"" value="""&regtime&"""/><br/>"
 Response.Write "[格式:如2009-5-20 18:04:48]<br/>"
 Response.Write "注册IP：<br/>"
 Response.Write "<input name=""myip"" maxlength=""500"" value="""&myip&"""/><br/>"
 Response.Write "[格式:如211.136.222.74]<br/>"
 Response.Write ""&getcent&"：<br/>"
 Response.Write "<input name=""cent"" maxlength=""500"" value="""&cent&"""/><br/>"
  Response.Write "银行：<br/>"
 Response.Write "<input name=""banks"" maxlength=""500"" value="""&banks&"""/><br/>"
   Response.Write "贷款：<br/>"
 Response.Write "<input name=""bankj"" maxlength=""500"" value="""&bankj&"""/><br/>"
 Response.Write "经验：<br/>"
 Response.Write "<input name=""sore"" maxlength=""500"" value="""&sore&"""/><br/>"
 Response.Write "体力<br/>"
 Response.Write "<input name=""aaaa"" maxlength=""500"" value="""&aaaa&"""/><br/>"
 Response.Write "魅力<br/>"
 Response.Write "<input name=""bbbb"" maxlength=""500"" value="""&bbbb&"""/><br/>"
 Response.Write "才华<br/>"
 Response.Write "<input name=""dddd"" maxlength=""500"" value="""&dddd&"""/><br/>"
 Response.Write "元宝：<br/>"
 Response.Write "<input name=""newrmbcent"" maxlength=""500"" value="""&newrmbcent&"""/><br/>"
 Response.Write "宠物品种:<select name=""cwpz"" value='"&cwpz&"'>"
 Response.Write "<option value=""1"">龙系</option>"
 Response.Write "<option value=""2"">精灵系</option>"
 Response.Write "<option value=""3"">鸟系</option>"
 Response.Write "<option value=""4"">猫系</option>"
 Response.Write "<option value=""5"">熊猫系</option>"
 Response.Write "<option value=""6"">青蛙系</option>"
 Response.Write "<option value=""7"">兔子系</option>"
 Response.Write "</select><br/>"
 Response.Write "宠物状态:<select name=""cwzt"" value='"&cwzt&"'>"
 Response.Write "<option value=""0"">无</option>"
 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=""cwsm"" maxlength=""500"" value="""&cwsm&"""/><br/>"
 Response.Write "宠物健康:<br/>"
 Response.Write "<input name=""cwrq"" maxlength=""500"" value="""&cwrq&"""/><br/>"
 Response.Write "宠物智力:<br/>"
 Response.Write "<input name=""cwzs"" maxlength=""500"" value="""&cwzs&"""/><br/>"
 Response.Write "宠物心情:<br/>"
 Response.Write "<input name=""cwxq"" maxlength=""500"" value="""&cwxq&"""/><br/>"
 Response.Write "宠物情感:<br/>"
 Response.Write "<input name=""cwqg"" maxlength=""500"" value="""&cwqg&"""/><br/>"
 Response.Write "宠物还魂丹:<br/>"
 Response.Write "<input name=""cwhh"" maxlength=""500"" value="""&cwhh&"""/><br/>"
 Response.Write "宠物生命卡:<br/>"
 Response.Write "<input name=""cwsmk"" maxlength=""500"" value="""&cwsmk&"""/><br/>"
 Response.Write "宠物智力卡:<br/>"
 Response.Write "<input name=""cwjkk"" maxlength=""500"" value="""&cwjkk&"""/><br/>"
 Response.Write "是否验证他的管理权限<br/>请慎重选择<br/><select name=""kkkk"" value="""&kkkk&""">"
 Response.Write "<option value=""0"">否</option>"
 Response.Write "<option value=""100"">是</option>"
 Response.Write "</select><br/>"
response.write "<input type=""hidden"" name=""ids"" value="""&ids&"""/>"
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 "手机号码：<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=""ye"&tt&""" maxlength=""500"" value="""&ye&"""/><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 "注册时间：<br/>"
 Response.Write "<input name=""regtime"&tt&""" maxlength=""500"" value="""&regtime&"""/><br/>"
 Response.Write "[格式:如2009-5-20 18:04:48]<br/>"
 Response.Write "注册IP：<br/>"
 Response.Write "<input name=""myip"&tt&""" maxlength=""500"" value="""&myip&"""/><br/>"
 Response.Write "[格式:如211.136.222.74]<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=""aaaa"&tt&""" maxlength=""500"" value="""&aaaa&"""/><br/>"
 Response.Write "魅力<br/>"
 Response.Write "<input name=""bbbb"&tt&""" maxlength=""500"" value="""&bbbb&"""/><br/>"
 Response.Write "才华<br/>"
 Response.Write "<input name=""dddd"&tt&""" maxlength=""500"" value="""&dddd&"""/><br/>"
 Response.Write "元宝：<br/>"
 Response.Write "<input name=""newrmbcent"&tt&""" maxlength=""500"" value="""&newrmbcent&"""/><br/>"
 Response.Write "宠物品种:<select name=""cwpz"&tt&""" value='"&cwpz&"'>"
 Response.Write "<option value=""1"">龙系</option>"
 Response.Write "<option value=""2"">精灵系</option>"
 Response.Write "<option value=""3"">鸟系</option>"
 Response.Write "<option value=""4"">猫系</option>"
 Response.Write "<option value=""5"">熊猫系</option>"
 Response.Write "<option value=""6"">青蛙系</option>"
 Response.Write "<option value=""7"">兔子系</option>"
 Response.Write "</select><br/>"
 Response.Write "宠物状态:<select name=""cwzt"&tt&""" value='"&cwzt&"'>"
 Response.Write "<option value=""0"">无</option>"
 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=""cwsm"&tt&""" maxlength=""500"" value="""&cwsm&"""/><br/>"
 Response.Write "宠物健康:<br/>"
 Response.Write "<input name=""cwrq"&tt&""" maxlength=""500"" value="""&cwrq&"""/><br/>"
 Response.Write "宠物智力:<br/>"
 Response.Write "<input name=""cwzs"&tt&""" maxlength=""500"" value="""&cwzs&"""/><br/>"
 Response.Write "宠物心情:<br/>"
 Response.Write "<input name=""cwxq"&tt&""" maxlength=""500"" value="""&cwxq&"""/><br/>"
 Response.Write "宠物情感:<br/>"
 Response.Write "<input name=""cwqg"&tt&""" maxlength=""500"" value="""&cwqg&"""/><br/>"
 Response.Write "宠物还魂丹:<br/>"
 Response.Write "<input name=""cwhh"&tt&""" maxlength=""500"" value="""&cwhh&"""/><br/>"
 Response.Write "宠物生命卡:<br/>"
 Response.Write "<input name=""cwsmk"&tt&""" maxlength=""500"" value="""&cwsmk&"""/><br/>"
 Response.Write "宠物智力卡:<br/>"
 Response.Write "<input name=""cwjkk"&tt&""" maxlength=""500"" value="""&cwjkk&"""/><br/>"
 Response.Write "是否验证他的管理权限<br/>请慎重选择<br/><select name=""kkkk"&tt&""" value='"&kkkk&"'>"
 Response.Write "<option value=""0"">否</option>"
 Response.Write "<option value=""100"">是</option>"
 Response.Write "</select><br/>"

 Response.Write "<anchor>[确定修改]"
 Response.Write "<go href=""adminedituser.asp?sid="&sid&"&amp;saytk="&saytk&""" 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=""myip"" value=""$(myip"&tt&")""/>"
 Response.Write "<postfield name=""cwpz"" value=""$(cwpz"&tt&")""/>"
 Response.Write "<postfield name=""cwsm"" value=""$(cwsm"&tt&")""/>"
 Response.Write "<postfield name=""cwrq"" value=""$(cwrq"&tt&")""/>"
 Response.Write "<postfield name=""cwxq"" value=""$(cwxq"&tt&")""/>"
 Response.Write "<postfield name=""cwqg"" value=""$(cwqg"&tt&")""/>"
 Response.Write "<postfield name=""cwzs"" value=""$(cwzs"&tt&")""/>"
 Response.Write "<postfield name=""kkkk"" value=""$(kkkk"&tt&")""/>"
 Response.Write "<postfield name=""cwhh"" value=""$(cwhh"&tt&")""/>"
 Response.Write "<postfield name=""cwsmk"" value=""$(cwsmk"&tt&")""/>"
 Response.Write "<postfield name=""cwzt"" value=""$(cwzt"&tt&")""/>"
 Response.Write "<postfield name=""cwjkk"" value=""$(cwjkk"&tt&")""/>"
 Response.Write "<postfield name=""regtime"" value=""$(regtime"&tt&")""/>"
 Response.Write "<postfield name=""ye"" value=""$(ye"&tt&")""/>"
 Response.Write "<postfield name=""cent"" value=""$(cent"&tt&")""/>"
 Response.Write "<postfield name=""sore"" value=""$(sore"&tt&")""/>"
 Response.Write "<postfield name=""aaaa"" value=""$(aaaa"&tt&")""/>"
 Response.Write "<postfield name=""bbbb"" value=""$(bbbb"&tt&")""/>"
 Response.Write "<postfield name=""dddd"" value=""$(dddd"&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
  end if
conn.close
set conn=nothing
response.write"<a href=""show.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">用户信息</a>"
%><%
call headsay()%>
