<!--#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"))

if my_level=0 then
  set cschat=nothing
  application.unlock
  response.end
end if

votes=application( ConstStr & "_votes")

mess=""
if votes(0)=3 then
  if ( votes(2)-votes(3) ) > 3 and ( ( votes(2)/votes(4) ) > 0.4 or ( votes(2)>9 and (votes(3)/votes(2)) < 0.6 ) ) then
    if instr(Application( ConstStr & "_user_list"),"<$"&votes(1)&"$>")<>0 then
      application(ConstStr & "_user_list")=cschat.DelList(application(ConstStr & "_user_list"),votes(1))
    end if
    Set Conn=Server.CreateObject("ADODB.Connection")
    conn.open Application( ConstStr & "_connstr")
    out_time=dateAdd("n",application( ConstStr & "_kicknamedontlogin"),now())
    out_info=5
    stype=10
    occ_end=">提议把%%请出了聊天室"
    mess="【踢人】激犯众怒的%%被请出了聊天室，Ｖ！<\script>parent.dell(\'" & votes(1) & "\')</\script>"
    conn.Execute("UPDATE user SET out_info="&out_info&",out_time='"&out_time&"',room_id=0 WHERE username='"&votes(1)&"'")
    occ_env="在线提议>大家> >"&votes(1)&">"&votes(7)&">"&votes(8)&occ_end
    conn.Execute("INSERT INTO record (stype,occ_time,occ_env) VALUES ("&stype&",'"&now()&"','"&occ_env&"')")
    votes(0)=0
    votes(5)=now()
    conn.close
    set conn=nothing
  elseif ((votes(3)-votes(2))>3 and (votes(3)/votes(4))>0.4) or datediff("s",votes(5),now())>120 or (votes(2)+votes(3))/votes(4)>0.8 then
    votes(0)=0
    votes(5)=now()
    mess="【系统】由于没有足够的人同意处罚%%，提议被取消！"
  elseif datediff("s",votes(5),now())>60 and votes(6) then
    mess="【提议】有人以理由〖<font color=red>"&votes(8)&"</font>〗提议把<u>"&votes(1)&"</u>请出聊天室！请你点击：[<a href=voteput.asp?agree=1 onclick=\'parent.input.document.forms[0].saystemp.focus()\' target=newsay>同意</a>]，[<a href=voteput.asp?agree=0 onclick=\'parent.input.document.forms[0].saystemp.focus()\' target=newsay>不同意</a>]？"
    votes(6)=false
  end if
  if mess<>"" then
    says = Application(ConstStr & "_says")
    current = Application(ConstStr & "_current")
    cschat.newsay "大家",votes(1),0,-2,mess,"green","red",-4,says,current
    Application(ConstStr & "_says") = says
    Application(ConstStr & "_current") = current
  end if
  application( ConstStr & "_votes")=votes
end if
set cschat=nothing
application.unlock
if request("form")="form" then Response.Redirect("votestat.asp")%><%
%>