<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))

application.unlock
if my_level=0 then
  set cschat=nothing
  response.redirect("showerr.asp")  
  response.end
end if
myname=cschat.myname

votes=application( ConstStr & "_votes")
if (votes(0)<>0 and votes(1)=myname) then my_level=1

if my_level-application( ConstStr & "_l_lockip")<0 and my_level-application( ConstStr & "_l_lockuser")<0 then
  response.redirect("showerr.asp?errtext=你的级别太低了！")
  response.end
end if

Set Conn=Server.CreateObject("ADODB.Connection") 
conn.open Application( ConstStr & "_connstr")
cschat.FilterStr = Application(ConstStr & "_saysfilterstr")
forwhat=cschat.trdb(request("forwhat"))
ip=cschat.trdb(request("ip"))
set cschat=nothing%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="chat.css">
<script>function x(y,z){document.write("<option value=\""+y+"\">"+z+"</option>")}</script>
</head>

<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;">
  <table height=100% width=100%><tr><td align=center valign=center >
  <table width=400 align=center cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
<%if my_level-application( ConstStr & "_l_lockip")>=0 then%>
  <tr><td colspan=2 class=navy2>解/封锁IP</td>
  <%
  conn.Execute("DELETE FROM ip_lock WHERE DATEDIFF('s',end_time,now())>0")
  set rs=conn.Execute("select * from ip_lock where act_level<="&my_level)
  if not (rs.eof or rs.bof) then%>
    <script>function x1(n,t){document.write("<tr><td style='cursor:hand;color:ff9966' onclick='document.frmlock.ip.value=\""+n+"\"'>"+n+"</td><td>"+t+"</td></tr>")}</script>
    <tr><td class=navy1>被封锁IP</td><td class=navy1>剩余时间(分)</td>
    <%Do While (Not Rs.Eof)%>
      <script>x1('<%=rs("ip")%>','<%=datediff("n",now(),rs("end_time"))%>');</script>
      <%rs.movenext
    loop
  else%><tr><td colspan=2 class=navy1><font color=red>无IP被封锁</font></td>
  <%end if%>
  <form action=lockip.asp method=post name=frmlock>
  <tr><td height=70 colspan=2><select name=list style="background-color:3399FF;color:FFFFFF"
    onchange="javascript:document.frmlock.forwhat.value=document.frmlock.list.value;document.frmlock.forwhat.focus();">
    <script>x("","锁IP");x("在聊天室里多次捣乱","捣乱");x("有悔过行为","悔过");</script></select>　
    <input name=forwhat type=text maxlength=100  size=40 value="<%=forwhat%>">
    <br><br>IP地址:<input name=ip type=text maxlength=16 size=10 value="<%=ip%>">
    封锁时间:<input name=howlong type=text maxlength=5 size=5>小时<br><br>
    <input class=navy1 type=submit name=cmdYes value="解锁">
    <input class=navy1 type=submit name=cmdYes value="封锁">
    <input class=navy1 type=reset name=cmdClear value=清除><br>　
  </td></tr></form>  
<%end if
if my_level-application( ConstStr & "_l_lockuser")>=0 then%>
  <tr><td colspan=2 class=navy2>解冻用户</td>
  <%if my_level-application( ConstStr & "_l_lockuser")=0 then
    set rs=conn.Execute("select * from user WHERE out_info=6 and (DATEDIFF('s',out_time,now())<0)")
  else
    set rs=conn.Execute("select * from user WHERE (out_info=6 and (DATEDIFF('s',out_time,now())<0)) or out_info=7")
  end if
  if not (rs.eof or rs.bof) then%>
    <script>function x2(n,t){document.write("<tr><td style='cursor:hand;color:cc9966' onclick='document.frmlife.username.value=\""+n+"\"'>"+n+"</td><td>"+t+"</td></tr>")}</script>
    <tr><td class=navy1>被冻结用户</td><td class=navy1>剩余时间(分)</td>
    <%Do While (Not Rs.Eof)
      if rs("out_info")=7 then
        t="永久"
      else
        t=datediff("n",now(),rs("out_time"))
      end if%>
      <script>x2('<%=rs("username")%>','<%=t%>');</script>
      <%rs.movenext
    loop%>
    <form action=lifeuser.asp method=post name=frmlife>
    <tr><td height=70 colspan=2><select name=list style="background-color:3399FF;color:FFFFFF"
    onchange="javascript:document.frmlife.forwhat.value=document.frmlife.list.value;document.frmlife.forwhat.focus();">
    <script>x("","解冻");x("有悔过行为","悔过");</script></select>　
    <input name=forwhat type=text maxlength=100  size=40 value=有悔过行为>
    <br><br>用户名:<input name=username type=text maxlength=10 size=10 >
    <input class=navy1 type=submit name=cmdYes value="解冻">
    <input class=navy1 type=reset name=cmdClear value=清除>
    </td></tr></form>
  <%else%><tr><td colspan=2 class=navy1><font color=red>无用户被冻结</td>
  <%end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</table><br>
[<a href='javascript:history.go(-1)'>后退</a>]</td></tr></table></body>