<%@ LANGUAGE=VBScript codepage ="936" %><%Response.Expires=0
Response.Buffer=true
zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
zhbg_jhdj=Session("zhbg_jhdj")
if zhbg_name="" then Response.Redirect "../error.asp?id=440"
if session("zhbg_adminok")<>true then Response.Redirect "../chat/readonly/bomb.htm"
if zhbg_grade<>10 or instr(Application("zhbg_user"),zhbg_name)=0  then Response.Redirect "../error.asp?id=439"
if zhbg_name<>Application("zhbg_adminuser") then Response.Redirect "../chat/readonly/bomb.htm"
username=Request.Form("search")
cz=Request.form("sjcz")
name=request.querystring("username")
if name<>"" then
username=name
cz="姓名"
end if
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
if cz="ID" then
username=int(username)
sqlstr="SELECT * FROM 用户 where "&cz&"="&username
rs.Open sqlstr,conn
else
sqlstr="SELECT * FROM 用户 where "&cz&"='"&username&"'"
rs.Open sqlstr,conn
end if
if rs.EOF or rs.BOF then
Response.Write "<script language=javascript>alert('抱歉你所要查找的人我们找不到！请查看是否正确！');history.back();</script>"
else
if rs("grade")=10 and zhbg_name<>Application("zhbg_user") or zhbg_name<>Application("zhbg_admin") or zhbg_name<>Application("zhbg_adminuser") then 
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('提示：不可以修改站长资料！');location.href = 'javascript:history.go(-1)';</script>"
	response.end
end if

conn.execute "insert into l(a,b,c,d,e) values (now(),'"& zhbg_name &"','"& Request.ServerVariables("REMOTE_ADDR") &"','管理记录','查找：["&cz&"]="&username&"的记录！')"
Response.Write "<LINK href=../css.css type=text/css rel=stylesheet><body>"
Response.Write "<form method=post action=updateuser.asp><br>1、修改某个字段数据时，必须注意字段数据类型。如：姓名(字符)，数据为汉字；金币(数字)，数据为数字。<br>2、物品、装备的修改：必须是国度中有的物品、装备。<br>w1为药品类，w2为毒药类，w4为暗器类，w5为卡片类，w6为物品类，w7为鲜花类，w8为配药类，w9为魔宝类，w10法器为类。<br>z1为头盔，z2为装饰，z3为盔甲，z4为左手，z5为右手和锻造，z6为双脚。<br>3、注意：z1-z6，如果其中一项没有装备，您必须打一个空格，不能为0（为0，装备无法显示），也不能为空数据（无法更新用户资料）。<br>4、最下面的按钮：更新：为保存修改；新增：为将此用户另保存为新的用户；删除：为将此用户删除；重置：为取消刚才的修改，恢复原始数据。<br><br><table border='1' width='100%' cellpadding='2' cellspacing='0' bordercolordark='#cccccc' bordercolorlight='#cccccc' align='center'><tr><td colspan='6'><div align='center'>国度ID:"&rs("id")&"<input type=hidden readonly size=4 name=id value="&rs("id")&">(<font color=blue size=-1>注意：数据类型与所对应的数据必需相同，否则出错！不能有空的数据存在!----原来就没有的可以打空格!----</font>)</div></td></tr>"
Response.Write "<tr>"
for i=1 to rs.Fields.Count-1
strtype=rs.fields(i).Type
strname=rs.Fields(i).Name
if strname="姓名" then seename=rs.Fields(i).value
if rs.fields(i).Type=202 then strtype="字符"
if rs.fields(i).Type=3 then strtype="数字"
if rs.fields(i).Type=7 then strtype="日期"
if rs.fields(i).Type=11 then strtype="逻辑"
if strname="grade" then strname="管理等级"
if strname="mvalue" then strname="月积分"
if strname="allvalue" then strname="总积分"
if strname="times" then strname="登录次数"
if strname="regip" then strname="注册ip"
if strname="lastip" then strname="最后ip"
if strname="regtime" then strname="注册时间"
if strname="lasttime" then strname="最后时间"
'if strname<>"cw" and strname<>"w1" and strname<>"w2"  and strname<>"w3"  and strname<>"w4"  and strname<>"w5"  and strname<>"w6"    and strname<>"w7"   and strname<>"w8" and strname<>"z1"   and strname<>"z2"   and strname<>"z3"   and strname<>"z4"   and strname<>"z5"   and strname<>"z6"  then
	Response.Write "<td  onmouseout="&chr(34)&"this.bgColor='';"&chr(34)&" onmouseover="&chr(34)&"this.bgColor='';"&chr(34)&"><div align='right'><font size=-1>"&strname&"(<font color=blue >"&strtype&"</font>)：<input type=text size='20' style='FONT-SIZE: 10pt; COLOR: #000000; BACKGROUND-COLOR: #A4DF5E;border-bottom:1px solid #000000;border-right:1px solid #000000;border-left:1px solid #000000;border-top:1px solid #000000; ' name="&rs.Fields(i).Name&" value='"&rs.Fields(i).value&"'></font></div></td>"
	if i/3=int(i/3) then Response.Write "</tr><tr>"
'end if
	next
Response.Write "</tr>"
Response.Write "<tr><td colspan='6'><div align='center'><input type=submit value=更新 name=submit> <input type=submit value=新增 name=submit> <input type=submit value=删除 name=submit> <input type=reset value=重置> <a href='../chat/TOWUPIN.asp?toname="&seename&"' target='_blank' >查询此人物品</a></div></td></tr>"
Response.Write "</table></form>"
end if
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
