<!-- #Include File="Include/AMH_onlogin.asp" -->
<!-- #Include File="../Include/Inc_md5.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V2.0》，简称“AsaiMHV2”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

dim power,pro,tit_name,pro_name,sql_pro,dim_tmp,now_ymd,base_power
power=trim(request.querystring("power"))
pro=trim(request.querystring("pro"))
now_ymd=Cls.time_type(Cls.now_time,4)
base_power=format_powers(0)
select case pro
case "hidden"
  pro_name="待审核"
  sql_pro="hidden=0"
case "estate"
  pro_name="计时"
  sql_pro="estate=1"
case "lock"
  pro_name="锁定"
  sql_pro="islock=1"
case "pb"
  pro_name="屏蔽"
  sql_pro="ispb=1"  
case else
  pro=""
  sql_pro=""
end select
Index_Url="user"
call AMH_master(0,0)
tit_name=ntit
Call AMH_Header(1)
Cls.LoadTemplate(0)
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%Response.Write tit%></a></td>
  <td width=3></td>
  <td><a href='?power=<%Response.Write power%>&pro=hidden'<%if pro="hidden" then Response.Write " class=red"%>>待审核<%Response.Write tit_fir%></a></td>
  <td class=Gys>[<a href='?action=hiddens' onclick="javascript:return click_return('审核所有未审核<%Response.Write tit_fir%>',0);">审核</a>]</td>
  <td width=3></td>
  <td><a href='?power=<%Response.Write power%>&pro=lock'<%if pro="lock" then Response.Write " class=red"%>>锁定<%Response.Write tit_fir%></a></td>
  <td width=3></td>
    <td><a href='?power=<%Response.Write power%>&pro=pb'<%if pro="pb" then Response.Write " class=red"%>>屏蔽<%Response.Write tit_fir%></a></td>
  <td width=3></td>
  <td><a href='?power=<%Response.Write power%>&pro=estate'<%if pro="estate" then Response.Write " class=red"%>>计时<%Response.Write tit_fir%></a></td>
  <td width=20></td>
  <td>
    <table border=0>
    <form action='?' method=get>
    <input type=hidden name=AsaiMHMod value='search'>
    <tr>
    <td><b><%Response.Write tit_fir%>搜索：</b></td>
    <td><input type=text name=keyword value='<%Response.Write trim(request.querystring("keyword"))%>' size=10 maxlength=20></td>
    <td><select name=sea_type>
<option value='username'<%if trim(request.querystring("sea_type"))="username" then Response.Write " selected"%>>按用户名</option>
<option value='email'<%if trim(request.querystring("sea_type"))="email" then Response.Write " selected"%>>按邮件</option>
<option value='nname'<%if trim(request.querystring("sea_type"))="nname" then Response.Write " selected"%>>按头衔</option>
</select></td>
    <td><input type=submit value='搜索' class=btn></td>
    </tr>
    </form>
    </table>
  </td>
  </tr>
  </table>
</td></tr>
<tr><td align=center colspan=2>
  <table border=0>
  <tr>
  <td><%response.write img_admin("","")%>&nbsp;<a href='?action=high'<%if action="high" then response.write " class=red"%>>高级管理</a>&nbsp;</td>
  <td width=20></td>
  <td><%Response.Write tit_fir%>类型：</td>
<% call AsaiMHUser_Sort() %>
  <td width=10></td>
  <td><a href='?'><b>所有用户</b></a></td>
  </tr>
  </table>
</td></tr>
</table>
<%
call AMH_table(1)
if action="handle" then
  if not chk() then action=""
end if
select case action
case "high"
  call AsaiMHChk_High()
case "hiddens"
  call AsaiMHChk_Hiddens()
case "handle"
  call AsaiMHChk_Handle()
case "edit"
  call AsaiMHChk_Edit()
case else
  call AsaiMHChk_Main()
end select
if isarray(dim_tmp) then erase dim_tmp
Call AMH_Ender(tit)
sub AsaiMHChk_High()
  call AMH_td("高级管理")
  dim del_username,del_Bbs,del_mail,del_notes,del_other,set_integral,integral_num,set_emoney,emoney_num,set_strength,strength_num,set_expression,expression_num,sel_true,del_ok,event_integral,event_emoney,event_strength,event_expression,sqlset
  if chk() then
    del_username=Cls.code_form("del_username")
    del_Bbs=0
    del_mail=0
    del_notes=0
    del_other=0
    sel_true=false
    if Cls.code_form("del_Bbs")="yes" then
      del_Bbs=1
      sel_true=true
    end if
    if Cls.code_form("del_mail")="yes" then
      del_mail=1
      sel_true=true
    end if
    if Cls.code_form("del_notes")="yes" then
      del_notes=1
      sel_true=true
    end if
    if Cls.code_form("del_other")="yes" then
      del_other=1
      sel_true=true
    end if
    set_integral=Cls.code_form("set_integral")
    integral_num=Cls.code_int("integral_num",1)
    set_emoney=Cls.code_form("set_emoney")
    emoney_num=Cls.code_int("emoney_num",1)
    set_strength=Cls.code_form("set_strength")
    strength_num=Cls.code_int("strength_num",1)
    set_expression=Cls.code_form("set_expression")
    expression_num=Cls.code_int("expression_num",1)
    event_integral=""
    event_emoney=""
    event_strength=""
	event_expression=""
    sqlset=""
    if set_integral="add" or set_integral="can" then
      if sqlset="" then
        sqlset="integral="
      else
        sqlset=sqlset&",integral="
      end if
      event_integral="等于"
      if set_integral="add" then
        event_integral="增加"
        sqlset=sqlset&"integral+"
      end if
      sqlset=sqlset&integral_num
      sel_true=true
    else
      set_integral=""
    end if
    if set_emoney="add" or set_emoney="can" then
      if sqlset="" then
        sqlset="emoney="
      else
        sqlset=sqlset&",emoney="
      end if
      event_emoney="等于"
      if set_emoney="add" then
        event_emoney="增加"
        sqlset=sqlset&"emoney+"
      end if
      sqlset=sqlset&emoney_num
      sel_true=true
    else
      set_emoney=""
    end if
    if set_strength="add" or set_strength="can" then
      if sqlset="" then
        sqlset="strength="
      else
        sqlset=sqlset&",strength="
      end if
      event_strength="等于"
      if set_strength="add" then
        event_strength="增加"
        sqlset=sqlset&"strength+"
      end if
      sqlset=sqlset&strength_num
      sel_true=true
    else
      set_strength=""
    end if
    if set_expression="add" or set_expression="can" then
      if sqlset="" then
        sqlset="expression="
      else
        sqlset=sqlset&",expression="
      end if
      event_expression="等于"
      if set_expression="add" then
        event_expression="增加"
        sqlset=sqlset&"expression+"
      end if
      sqlset=sqlset&expression_num
      sel_true=true
    else
      set_expression=""
    end if
    if ChkName(del_username)=false then
      call AMH_error("请先输入正确的注册用户名称！")
      exit sub
    end if
    if sel_true=false then
      call AMH_error("至少选择一项所要删除的项目！")
      exit sub
    end if
    del_ok=user_del(1,del_username,del_Bbs,del_mail,del_notes,del_other,0)
    if del_ok=false then
      call AMH_error("注册用户名（"&del_username&"）不存在！！")
      exit sub
    end if
    if sqlset<>"" then
      sql="update AsaiMHUserData set "&sqlset&" where username='"&del_username&"'"
      call Cls.exec(sql,0)
    end if
    if del_Bbs=1 then call AMH_event("删除 "&del_username&" 所有论坛发贴！")
    if del_mail=1 then call AMH_event("删除 "&del_username&" 所有站内短信！")
    if del_notes=1 then call AMH_event("删除 "&del_username&" 所有消费记录！")
    if del_other=1 then call AMH_event("删除 "&del_username&" 所有其它信息！")
    if event_integral<>"" then call AMH_event("设置 "&del_username&" 积分 "&event_integral&" "&integral_num&" 分！")
    if event_emoney<>"" then call AMH_event("设置 "&del_username&" 货币 "&event_emoney&" "&emoney_num&" "&Cls.web_unit&"！")
    if event_strength<>"" then call AMH_event("设置 "&del_username&" 体力 "&event_strength&" "&strength_num&" 点！")
    if event_expression<>"" then call AMH_event("设置 "&del_username&" 经验 "&event_expression&" "&expression_num&" 点！")
    call AMH_msg("成功对用户（"&del_username&"）的进行了相关操作","?action="&action,1)
    exit sub
  end if
  call form_first()
%>
<form action='?action=<%response.write action%>' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td>注册用户名：</td>
<td><input type=input name=del_username value='' size=20 maxlength=20><%response.write redx%></td>
</tr>
<tr>
<td>删除相关信息</td>
<td>
  <table border=0>
  <tr><td><input type=checkbox name=del_Bbs value='yes'>删除所有论坛发贴，进行此操作时需耐心等待</td></tr>
  <tr><td><input type=checkbox name=del_mail value='yes'>删除所有站内短信，将删除此用户发送的短信与接收到的短信</td></tr>
  <tr><td><input type=checkbox name=del_notes value='yes'>删除所有消费记录，如收费下载、浏览文章等</td></tr>
  <tr><td><input type=checkbox name=del_other value='yes'>删除其它信息，如收藏夹，好友等</td></tr>
  </table>
</td>
</tr>
<tr>
<td>设置用户信息</td>
<td>
  <table border=0>
  <tr>
  <td>积分：</td>
  <td><select name=set_integral><option value='' class=Gys>暂无</option><option value='add'>增加</option><option value='can'>等于</option></select></td>
  <td><input type=text name=integral_num value='0' size=10></td>
  <td>分</td>
  </tr>
  <tr>
  <td>货币：</td>
  <td><select name=set_emoney><option value='' class=Gys>暂无</option><option value='add'>增加</option><option value='can'>等于</option></select></td>
  <td><input type=text name=emoney_num value='0' size=10></td>
  <td><%response.write Cls.web_unit%></td>
  </tr>
  <tr>
  <td>体力：</td>
  <td><select name=set_strength><option value='' class=Gys>暂无</option><option value='add'>增加</option><option value='can'>等于</option></select></td>
  <td><input type=text name=strength_num value='0' size=10></td>
  <td>点</td>
  </tr>
  <tr>
  <td>经验：</td>
  <td><select name=set_expression><option value='' class=Gys>暂无</option><option value='add'>增加</option><option value='can'>等于</option></select></td>
  <td><input type=text name=expression_num value='0' size=10></td>
  <td>点</td>
  </tr>
  </table>
</td>
</tr>
<tr class=trb><td></td><td><input type=submit value='执行操作' class=btn></td></tr>
</form>
<%
end sub
sub AsaiMHChk_Hiddens()
  sql="update "&Data_Name&" set hidden=1 where hidden=0 "
  call Cls.exec(sql,0)
  call AMH_event("审核所有未审核"&tit_fir)
  call AMH_msg("已成功审核了所有"&tit_fir&"！","?",1)
end sub
sub AsaiMHChk_Handle()
  dim sel_type,seltype,sel_id,hdim,hnum,htype,hintegral
  htype=1
  sel_type=trim(request.form("sel_type"))
  select case sel_type
  case "审核","待审核"
    seltype="hidden"
    if sel_type="待审核" then htype=0
  case "锁定","取消锁定"
    seltype="lock"
    if sel_type="取消锁定" then htype=0
  case "屏蔽","取消屏蔽"
    seltype="pb"
    if sel_type="取消屏蔽" then htype=0	
  case "删除"
    seltype="delete"
  case else
    sel_type=""
    seltype=""
  end select
  if sel_type="" or seltype="" then
    call AMH_msg("您在提交用户操作时出现非法的数据！","?",0)
    exit sub
  end if
  hintegral=mp_integral()
  sel_id=trim(request.form("sel_id"))
  sel_id=replace(sel_id," ","")
  hdim=split(sel_id,",")
  hnum=ubound(hdim)
  for i=0 to hnum
    id=hdim(i)
    if isnumeric(id) then
      select case seltype
      case "delete"
        call user_del(0,id,1,1,1,1,1)
      case "lock"
        sql="update "&Data_Name&" set islock="&htype&" where id="&id
       call  Cls.exec(sql,0)
      case "pb"
        sql="update "&Data_Name&" set ispb="&htype&" where id="&id
       call  Cls.exec(sql,0)	   
      case else
        sql="update "&Data_Name&" set "&seltype&"="&htype&" where id="&id
       call  Cls.exec(sql,0)
      end select
    end if
  next
  erase hdim
  call AMH_event(sel_type&" "&(hnum+1)&"条（"&tit_fir&"）记录")
  call AMH_msg("已成功（"&sel_type&"）操作了"&(hnum+1)&"条"&tit_fir&"记录！","?",1)
end sub
function user_del(udtype,udstr,ud_Bbs,ud_mail,ud_notes,ud_other,ud_user)
  dim udid,uduser,udbc,num_topic,num_data
  sql="select top 1 id,username,bbs_counter from AsaiMHUserData where"
  if udtype=0 then
    sql=sql&" id="&udstr
  else
    sql=sql&" username='"&udstr&"'"
  end if
  set rs=Cls.exec(sql,1)
  if rs.eof then
    rs.close
    user_del=false
    exit function
  end if
  udid=rs(0)
  uduser=rs(1)
  udbc=rs(2)
  rs.close
  if ud_Bbs=1 and int(udbc)>0 then
    call Cls.exec("delete from AsaiMHBbsData where reply_id in (select id from AsaiMHBbsTopic where userid="&udid&")",0)
    call Cls.exec("delete from AsaiMHBbsTopic where userid="&udid,0)
    call Cls.exec("update AsaiMHBbsTopic set re_counter=re_counter-1 where id in (select reply_id from AsaiMHBbsData where userid="&udid&")",0)
    call Cls.exec("delete from AsaiMHBbsData where userid="&udid,0)
  end if
  if ud_mail=1 then
    call Cls.exec("delete from AsaiMHUserMail where send_u='"&uduser&"' or accept_u='"&uduser&"'",0)
  end if
  if ud_notes=1 then
    call Cls.exec("delete from AsaiMHnotes where username='"&uduser&"'",0)
  end if
  if ud_other=1 then
    call Cls.exec("delete from AsaiMHUserBookGroup where username='"&uduser&"'",0)
    call Cls.exec("delete from AsaiMHUserBookMark where username='"&uduser&"'",0)
    call Cls.exec("delete from AsaiMHUserFriend where username1='"&uduser&"' or username2='"&uduser&"'",0)
  end if
  if ud_user=1 then
    call Cls.exec("delete from AsaiMHUserData where username='"&uduser&"'",0)
  end if
  user_del=true
end function
sub AsaiMHChk_Edit()
  sql="select top 1 * from "&Data_Name&" where id="&id
  call Cls.exec("",-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    call AMH_msg("您要编辑的用户ID（"&id&"）不存在！","?",1)
    exit sub
  end if
  dim username,nname,password,passwd,email,bbs_counter,remark,face,counter,integral,emoney,power,tim,login_num,last_tim,hidden,estate,islock,ispb,isoi,otim,m_level,strength,expression,p_left,p_right,u_ip,medal,ok_counter,ok_helpnum,ok_reply
  dim f_counter,f_integral,f_emoney,f_power,f_tim,f_login_num,f_last_tim,f_otim,f_strength,f_expression,t_counter,t_integral,t_emoney,t_power,t_tim,t_login_num,t_last_tim,t_strength,t_otim,t_expression,f_ok_counter,f_ok_helpnum,f_ok_reply,t_ok_counter,t_ok_helpnum,t_ok_reply
  t_otim=false
  t_counter=false
  t_integral=false
  t_emoney=false
  t_login_num=false
  t_power=false
  t_tim=false
  t_last_tim=false
  t_strength=false
  t_expression=false
  t_ok_counter=false
  t_ok_helpnum=false
  t_ok_reply=false  
  username=rs("username")
  password=rs("password")
  passwd=rs("passwd")
  f_counter=rs("counter")
  f_integral=rs("integral")
  f_emoney=rs("emoney")
  f_login_num=rs("login_num")
  f_power=rs("power")
  f_tim=rs("tim")
  f_last_tim=rs("last_tim")
  f_otim=cls.time_type(rs("otim"),4)
  f_strength=rs("strength")
  f_expression=rs("expression")
  medal=rs("medal")
  m_level=rs("m_level")
  'if f_power = "admin" then
  '  if m_level = 10 then
  '    if login_username<>username then
  '     call AMH_msg("您没有编辑的超级管理员的权限！","?pro="&pro&"&power="&power,1)
  '      exit sub
  '    end if
  '  else
  '    if login_username=username then
   '     call AMH_msg("您没有编辑的自身信息的权限！","?pro="&pro&"&power="&power,1)
  '      exit sub
  '  end if
  '  end if
  'end if
  call AMH_td("编辑用户（"&username&"）信息")
  if chk() then
    email=Cls.Code_Admin ("email",1,50)
    if Cls.Is_Email(email,50)=false then
      call AMH_error(tit_fir&"的 电子邮件（"&email&"） 为空或不符合规则！")
      rs.close
      exit sub
    end if
    bbs_counter=trim(request.form("bbs_counter"))
	u_ip=trim(request.form("u_ip"))
    if Cls.Is_Int(bbs_counter)=false then bbs_counter=0
    counter=trim(request.form("counter"))
    if Cls.Is_Int(counter)=false then counter=0
    integral=trim(request.form("integral"))
    if Cls.Is_Int(integral)=false then integral=0
    emoney=trim(request.form("emoney"))
    if Cls.Is_Int(emoney)=false then emoneyr=0
    strength=trim(request.form("strength"))
    if Cls.Is_Int(strength)=false then strength=0
    expression=trim(request.form("expression"))
    if Cls.Is_Int(expression)=false then expression=0
    power=format_power(Cls.Code_Admin ("power",1,10),0)
	m_level=trim(request.form("m_level"))
	If Cls.Is_Int(m_level)=false then m_level=0
    ok_counter=trim(request.form("ok_counter"))
    if Cls.Is_Int(ok_counter)=false then ok_counter=0
	ok_helpnum=trim(request.form("ok_helpnum"))
    if Cls.Is_Int(ok_helpnum)=false then ok_helpnum=0
	ok_reply=trim(request.form("ok_reply"))
    if Cls.Is_Int(ok_reply)=false then ok_reply=0
    login_num=trim(request.form("login_num"))
    if Cls.Is_Int(login_num)=false then login_num=0
    remark=Cls.Code_Var(trim(request.form("remark")))
    face=Cls.Code_Var(trim(request.form("face")))
    if power="" then
      power=base_power
    end if
    estate=false
    if cstr(Cls.Code_Admin ("estate",1,1))="1" then estate=true
    islock=false
    if cstr(Cls.Code_Admin ("islock",1,1))="1" then islock=true
    ispb=false
    if cstr(Cls.Code_Admin ("ispb",1,1))="1" then ispb=true	
    isoi=false
    if cstr(Cls.Code_Admin ("isoi",1,1))="1" then isoi=true		
    hidden=false
    if cstr(Cls.Code_Admin ("hidden",1,1))="1" then hidden=true
    tim=trim(request.form("tim"))
    if not(isdate(tim)) then
      call AMH_error(tit_fir&"的 注册日期（"&tim&"） 为空或不符合规则！")
      rs.close
      exit sub
    end if
    last_tim=trim(request.form("last_tim"))
    if not(isdate(last_tim)) then
      call AMH_error(tit_fir&"的 最后登陆时间（"&last_tim&"） 为空或不符合规则！")
      rs.close
      exit sub
    end if
    otim=trim(request.form("otim"))
    if not(isdate(otim)) or instr(otim,"-")=0 or instr(otim,":")>0 then
      call AMH_error(tit_fir&"的 过期时间（"&otim&"） 为空或不符合规则！")
      rs.close
      exit sub
    end if
    otim=cls.time_type(otim,4)
    rs("nname")=Cls.Code_Admin ("nname",1,20)
    if ChkPassWord(Cls.Code_Admin ("password",1,20))=true and Cls.Code_Admin ("password",1,20)<>password then
      rs("password")=AsaiMHMd5(Cls.Code_Admin ("password",1,20),"short")
    end if
    if ChkPassWord(Cls.Code_Admin ("passwd",1,20))=true and Cls.Code_Admin ("passwd",1,20)<>passwd then
      rs("passwd")=AsaiMHMd5(Cls.Code_Admin ("passwd",1,20),"short")
    end if
    rs("email")=email
    rs("bbs_counter")=bbs_counter
    if cstr(f_counter)<>cstr(counter) then
      rs("counter")=counter
      t_counter=true
    end if
    if cstr(f_integral)<>cstr(integral) then
      rs("integral")=integral
      t_integral=true
    end if
    if cstr(f_emoney)<>cstr(emoney) then
      rs("emoney")=emoney
      t_emoney=true
    end if
    if cstr(f_strength)<>cstr(strength) then
      rs("strength")=strength
      t_strength=true
    end if
    if cstr(f_expression)<>cstr(expression) then
      rs("expression")=expression
      t_expression=true
    end if
    if cstr(f_ok_counter)<>cstr(ok_counter) then
      rs("ok_counter")=ok_counter
      t_ok_counter=true
    end if
	if cstr(f_ok_helpnum)<>cstr(ok_helpnum) then
      rs("ok_helpnum")=ok_helpnum
      t_ok_helpnum=true
    end if
	if cstr(f_ok_reply)<>cstr(ok_reply) then
      rs("ok_reply")=ok_reply
      t_ok_reply=true
    end if
    if cstr(f_power)<>cstr(power) then
      rs("power")=power
      t_power=true
    end if
    if cstr(f_login_num)<>cstr(login_num) then
      rs("login_num")=login_num
      t_login_num=true
    end if
'----------勋章设置----------------------
	Dim Tmp1
	Medal=""
	For i=1 To int(Ubound(Split(Cls.Web_Medal(0),",")))	
	  Tmp1=Replace(Cls.Code_Admin("Medal_"&i,1,0)," ","")
	  If Len(Tmp1)>0 Then	
        Tmp1=Replace(Tmp1,",","|")
	    Medal=Medal&Tmp1
	  End If
	Next
	If Right(Medal,1)="|" Then Medal=Left(Medal,Len(Medal)-1)
'-----------------------------------------
    rs("remark")=remark
    rs("face")=face
    rs("hidden")=hidden
    rs("estate")=estate
	rs("islock")=islock
	rs("ispb")=ispb
	rs("isopen")=isoi
    rs("m_level")=m_level
	rs("u_ip")=u_ip
    rs("medal")=medal
    if cstr(f_tim)<>cstr(tim) then
      rs("tim")=tim
      t_tim=true
    end if
    if cstr(f_last_tim)<>cstr(last_tim) then
      rs("last_tim")=last_tim
      t_last_tim=true
    end if
    if cstr(f_otim)<>cstr(otim) then
      rs("otim")=otim
      t_otim=true
    end if
    rs.update
    rs.close
    'call Cls.session_del(username)
    dim estr:estr=""
    if t_counter then estr=estr&"[系数改为："&counter&"，原："&f_counter&"] "
    if t_integral then estr=estr&"[积分改为："&integral&"，原："&f_integral&"] "
    if t_emoney then estr=estr&"[货币改为："&emoney&"，原："&f_emoney&"] "
    if t_strength then estr=estr&"[体力改为："&strength&"，原："&f_strength&"] " 
    if t_expression then estr=estr&"[经验改为："&expression&"，原："&f_expression&"] "
    if t_ok_counter then estr=estr&"[爱问数量改为："&ok_counter&"，原："&f_ok_counter&"] "
    if t_ok_helpnum then estr=estr&"[采纳数量改为："&ok_helpnum&"，原："&f_ok_helpnum&"] "
	if t_ok_reply then estr=estr&"[回答数量改为："&ok_reply&"，原："&f_ok_reply&"] "
    if t_power then estr=estr&"[类型改为："&power&"，原："&f_power&"] "
    if t_otim then estr=estr&"[过期时间改为："&otim&"，原："&f_otim&"] "
	call AMH_event("编辑"&tit_fir&"（"&username&"）的信息！相关信息如下："&estr)
    call AMH_msg("您已成功编辑了"&tit_fir&"（"&username&"）的信息！","?pro="&pro&"&power="&power,0)
    exit sub
  end if
  call form_first()
  power=rs("power")
  hidden=rs("hidden")
  estate=rs("estate")
  islock=rs("islock")
  ispb=rs("ispb")
  isoi=rs("isopen")
  u_ip=rs("u_ip")
  otim=cls.time_type(rs("otim"),4)
%>
<form name=user_frm action='?action=edit&pro=<%Response.Write pro%>&power=<%Response.Write power%>&id=<%Response.Write id%>' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td width='20%'>用户名称：</td>
<td width='80%'><input type=text value='<%Response.Write username%>' size=20 disabled>&nbsp;<font class=red>不可更改</font></td>
</tr>
<input type=hidden name=password2 value='<%Response.Write password%>'>
<input type=hidden name=passwd2 value='<%Response.Write passwd%>'>
<tr><td>用户密码：</td><td><input type=text name=password value='<%Response.Write password%>' size=25 maxlength=20></td></tr>
<tr><td>密码钥匙：</td><td><input type=text name=passwd value='<%Response.Write passwd%>' size=25 maxlength=20></td></tr>
<tr><td>用户头衔：</td><td><input type=text name=nname value='<%Response.Write rs("nname")%>' size=25 maxlength=20></td></tr>
<tr><td>注册日期：</td><td><input type=text name=tim value='<%Response.Write rs("tim")%>' size=25 maxlength=20></td></tr>
<tr><td>用户登录IP：</td><td><input type=text name=u_ip value='<%Response.Write rs("u_ip")%>' size=25 maxlength=20>&nbsp;<font class=red>填写则限制该用户以此IP登陆本系统，不限制则留空。</font></td></tr>
<tr><td>最后登陆IP：</td><td><input type=text value='<%Response.Write rs("last_ip")%>' size=25 disabled>&nbsp;<font class=red>不可更改</font></td></tr>
<tr><td>最后登陆时间：</td><td><input type=text name=last_tim value='<%Response.Write rs("last_tim")%>' size=25 maxlength=20></td></tr>
<tr><td>电子邮件：</td><td><input type=text name=email value='<%Response.Write rs("email")%>' size=25 maxlength=50></td></tr>
<!--<tr><td>用户系数：</td><td><input type=text name=counter value='<%Response.Write rs("counter")%>' size=15 maxlength=10>&nbsp;0-10</td></tr>-->
<tr><td>论坛发贴：</td><td><input type=text name=bbs_counter value='<%Response.Write rs("bbs_counter")%>' size=15 maxlength=10>&nbsp;贴</td></tr>
<tr><td>用户积分：</td><td><input type=text name=integral value='<%Response.Write rs("integral")%>' size=15 maxlength=10>&nbsp;分</td></tr>
<tr><td>用户货币：</td><td><input type=text name=emoney value='<%Response.Write rs("emoney")%>' size=15 maxlength=10>&nbsp;<%Response.Write Cls.web_unit%></td></tr>
<tr><td>用户体力：</td><td><input type=text name=strength value='<%Response.Write rs("strength")%>' size=15 maxlength=10>&nbsp;点</td></tr>
<tr><td>用户经验：</td><td><input type=text name=expression value='<%Response.Write rs("expression")%>' size=15 maxlength=10>&nbsp;点</td></tr>
<tr><td>爱问数量：</td><td><input type=text name=ok_counter value='<%Response.Write rs("ok_counter")%>' size=15 maxlength=10>&nbsp;个</td></tr>
<tr><td>采纳数量：</td><td><input type=text name=ok_helpnum value='<%Response.Write rs("ok_helpnum")%>' size=15 maxlength=10>&nbsp;个</td></tr>
<tr><td>回答数量：</td><td><input type=text name=ok_reply value='<%Response.Write rs("ok_reply")%>' size=15 maxlength=10>&nbsp;个</td></tr>
<tr><td>登陆次数：</td><td><input type=text name=login_num value='<%Response.Write rs("login_num")%>' size=15 maxlength=20>&nbsp;次</td></tr>
<tr><td>用户头像：</td><td><input type=text name=face value='<%Response.Write rs("face")%>' size=25 maxlength=30></td></tr>
<tr valign=top><td>用户签名：</td><td><textarea name=remark rows=6 cols=65><%Response.Write Cls.code_word(rs("remark"))%></textarea></td></tr>
<tr><td>用户类型：</td><td><select name=power size=1><%
  dim_tmp=Cls.Cache_Get("User_Group")
  for i=0 to ubound(dim_tmp,2)
    Response.Write vbcrlf&"<option value='"&dim_tmp(0,i)&"'"
    if power=dim_tmp(0,i) then Response.Write " selected"
    Response.Write ">"&dim_tmp(1,i)&"（"&dim_tmp(0,i)&"）</option>"
  next
  erase dim_tmp
%></select>（<%Response.Write power%>）</td></tr>
<tr><td>管理系数：</td><td><input type=text name=m_level value='<%Response.Write rs("m_level")%>' <%if login_level<>10 or login_username=username then response.write "readonly"%> size=5 maxlength=20>&nbsp;级 (1-10,10为超级管理员)</td></tr>
<tr><td>注册审核：</td><td><input type=radio name=hidden value='1'<%if hidden=true then Response.Write " checked"%>>&nbsp;正常&nbsp;&nbsp;<input type=radio name=hidden value='0'<%if hidden=false then Response.Write " checked"%>>&nbsp;未审核</td></tr>
<tr><td>开放信息：</td><td><input type=radio name=isoi value='1'<%if isoi=true then Response.Write " checked"%>>&nbsp;是&nbsp;&nbsp;<input type=radio name=isoi value='0'<%if isoi=false  then Response.Write " checked"%>>&nbsp;否</td></tr>
<tr><td>是否锁定：</td><td><input type=radio name=islock value='0'<%if islock=false then Response.Write " checked"%>>&nbsp;正常&nbsp;&nbsp;<input type=radio name=islock value='1'<%if islock=true  then Response.Write " checked"%>>&nbsp;锁定</td></tr>
<tr><td>贴子屏蔽：</td><td><input type=radio name=ispb value='0'<%if ispb=false then Response.Write " checked"%>>&nbsp;正常&nbsp;&nbsp;<input type=radio name=ispb value='1'<%if ispb=true  then Response.Write " checked"%>>&nbsp;屏蔽</td></tr>
<tr><td>是否计时：</td><td><input type=radio name=estate value='0'<%if estate<>true then response.write " checked"%>>&nbsp;普通&nbsp;&nbsp;<input type=radio name=estate value='1'<%if estate=true then response.write " checked"%>>&nbsp;计时</td></tr>
<tr><td>过期时间：</td><td><input type=text name=otim value='<%response.write otim%>' size=20 maxlength=10>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(otim);return false;">&nbsp;<input type=button name=st_btn value="插入当前时间"  onclick="javascript:document.user_frm.otim.value='<%response.write now_ymd%>';return false;"></td></tr>
<tr valign=top>
<td>勋章奖励：<br /><br /><font class=red>系统建议：<br />奖励勋章个数不要超过5个</font></td>
<td><table border=0>
<%
Dim tDim,j
If Medal="" Then Medal=0
tDim=Split(Medal,",")
For i=0 To Ubound(tDim)
    Dim MedalName
	MedalName = Split(Cls.Web_Medal(0),",")
    For j = 0 To Ubound(MedalName)-1
      Response.Write vbcrlf&"<tr><td><input type=checkbox name=medal_"&(i+1)&" value='"&j+1&"'"
      If Instr(1,"|"&tDim(i)&"|","|"&j+1&"|")>0 Then Response.Write " checked"
      Response.Write ">"&MedalName(j)&"</td></tr>"
    Next
    Erase MedalName
Next
Erase tDim
%>
</table></td></tr>
<%
  call submit_edit()
  rs.close
end sub
sub AsaiMHChk_Main()
  call form_first()
%>
<form name=sel_form action='?pro=&power=&action=handle' method=post>
<input type=hidden name=chk value='yes'>
<tr align=center>
<td class=td width='7%'>序号</td>
<td class=td width='16%'><%Response.Write tit_fir%>名称</td>
<td class=td width='6%'><%Response.Write Cls.web_unit%></td>
<td class=td width='6%'>积分</td>
<td class=td width='6%'>体力</td>
<td class=td width='6%'>经验</td>
<td class=td width='12%'>注册时间</td>
<td class=td width='12%'>过期时间</td>
<td class=td width='12%'>状态</td>
<td class=td width='12%'>最后登陆IP</td>
<td class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  dim id,username,n_power,n_powern,m_level,tim,estate,p_lock,p_ispb,keyword,n_nummer,otim
  n_nummer=trim(request.querystring("nummer"))
  if not Cls.Is_Int(n_nummer) then n_nummer=0
  if int(n_nummer)<1 then n_nummer=0
  if int(n_nummer)>0 then
    nummer=n_nummer
    nums=nummer
    pageurl=pageurl&"nummer="&nummer&"&"
  end if
  if power<>"" then
    sql_add=" power='"&power&"'"
    pageurl=pageurl&"power="&power&"&"
  end if
  if pro<>"" then
    if sql_add="" then
      sql_add=sql_pro
    else
      sql_add=sql_add&" and "&sql_pro
    end if
    pageurl=pageurl&"pro="&pro&"&"
  end if
  if AsaiMHMod="search" then
    call format_search("username","username,email,nname",2,1)
  end if
  dim obj_page
  set obj_page=new Cls_PageCute
  obj_page.pageurl=pageurl
  obj_page.nummer=nummer
  obj_page.page_t=1
  obj_page.page_p=5
  obj_page.page_unit="个"
  obj_page.page_tit=tit_fir
  obj_page.v_id="id"
  call obj_page.p_init("*",Data_Name,sql_add,"id desc")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
  call obj_page.p_main("*",Data_Name,sql_add,"id desc")
  for i=1 to obj_page.page_num
    id=rs("id")
    username=rs("username")
    n_power=rs("power")
    m_level=rs("m_level")
    tim=rs("tim")
    estate=rs("estate")
	p_lock=rs("islock")
	p_ispb=rs("ispb")
    otim=rs("otim")
    n_powern=format_power(n_power,2)
%>
<tr align=center>
<td class=tims><a href='../User/View.asp?username=<%Response.Write server.urlencode(username)%>' alt='浏览 <%Response.Write username%> 的个人信息' target=_blank><%Response.Write obj_page.page_now+i%></a></td>
<td align=left><img border=0 src='<%=Cls.web_skindir%>sys/icon_<%Response.Write format_power(n_power,0)%>.gif' alt='<%Response.Write username%> 是 <%Response.Write format_power(n_power,1)%>'><a href='?action=edit&pro=<%Response.Write pro%>&power=<%Response.Write n_power%>&id=<%Response.Write id%>' alt='邮件：<%Response.Write rs("email")%><br />头衔：<%Response.Write rs("nname")%><br />点击编辑 <%Response.Write username%> 的个人信息'><%Response.Write username%></td>
<td align=center class=red2><%Response.Write rs("emoney")%></td><td align=center class=red2><%Response.Write rs("integral")%></td><td align=center class=red2><%Response.Write rs("strength")%></td><td align=center class=red2><%Response.Write rs("expression")%></td>
<td><font class=tims alt='<%Response.Write Cls.time_type(tim,2)%>'><%Response.Write Cls.time_type(tim,4)%></td>
<td class=tims><%
  if estate=true then
    if datediff("d",otim,now_ymd)>0 then
      response.write "<font class=red>"
    end if
  end if
  response.write cls.time_type(otim,4)
%></td>
<td><%
    dim isuserok:isuserok = true
    if estate=true then
      response.write " <font class=red2>计时</font> "
	  isuserok = false
    end if
    if p_lock = true then
      Response.Write " <font class=red2>锁定</font> "
      isuserok = false
    end if
    if p_ispb = true then
      Response.Write " <font class=red2>屏蔽</font> "
      isuserok = false
    end if	
    if rs("hidden") = false then
      Response.Write " <font class=red2>审核</font> "
	  isuserok = false
    end if
	if isuserok = true then Response.Write "<font class=blue>正常</font>"
%></td>
<td class=tims><a href='<%Response.Write Cls.Web_Dir%>Common/Ip_Address.asp?ip=<%Response.Write rs("last_ip")%>'><%Response.Write rs("last_ip")%></td>
<td>
<%
   if int(n_powern)>2 then
     Response.Write "<input type=checkbox name=sel_id value='"&id&"'>"
   else
     Response.Write "<input type=checkbox name=sel_no disabled>"
   end if
%></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=9>
  <table border=0>
  <tr class=tr1>
  <td></td>
  <td><%Response.Write obj_page.page_var%></td>
  <td width=3></td>
  <td>分页：</td>
  <td><%Response.Write obj_page.page_cute%></td>
  </tr>
  </table>
</td>
<td colspan=3 align=center>
<select name=sel_type size=1>
<option value='审核'>审核</option>
<option value='待审核'>待审核</option>
<option value='锁定'>锁定</option>
<option value='取消锁定'>取消锁定</option>
<option value='屏蔽'>屏蔽</option>
<option value='取消屏蔽'>取消屏蔽</option>
<option value='删除'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);" class=btn>
</td>
</tr>
</form>
<%
end sub
sub AsaiMHUser_Sort()
  dim dp
  dim_tmp=Cls.Cache_Get("User_Group")
  dp=false
  for i=0 to ubound(dim_tmp,2)
    Response.Write vbcrlf&"  <td width=5></td>" & _
		   vbcrlf&"  <td><a href='?pro="&pro&"&power="&dim_tmp(0,i)&"'"
    if power=dim_tmp(0,i)then
      dp=true
      tit_name=dim_tmp(1,i)
      Response.Write " class=red"
    end if
    Response.Write "><img border=0 src='"&Cls.web_skindir&"sys/icon_"&dim_tmp(0,i)&".gif' align=absmiddle>&nbsp;"&dim_tmp(1,i)&"</a></td>"
  next
  if dp=false then
    power=""
  end if
end sub
%>
