<%@ codepage ="936" %>
<%if session("adminname")="" then
response.Redirect "../login.asp"
end if
%>

<!--#include file="../../conn/nosql.asp"-->
<%Response.Expires=0
nickname=nosql(request("id"))
if nickname=""  then Response.Redirect "close.asp"
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
t=s & ":" & f & ":" & m
sj=n & "-" & y & "-" & r & " " & t
ip=Request.ServerVariables("REMOTE_ADDR")
Application.Lock
onlinelist=Application("wsaxhxf_c_onlinelist")
dim newonlinelist()
useronlinename=""
onliners=0
js=1
ubl=UBound(onlinelist)
for i=1 to ubl step 8
 if CStr(onlinelist(i+1))<>CStr(nickname) then
  onliners=onliners+1
  useronlinename=useronlinename & " " & onlinelist(i+1)
  Redim Preserve newonlinelist(js),newonlinelist(js+1),newonlinelist(js+2),newonlinelist(js+3),newonlinelist(js+4),newonlinelist(js+5),newonlinelist(js+6),newonlinelist(js+7)
  newonlinelist(js)=onlinelist(i)
  newonlinelist(js+1)=onlinelist(i+1)
  newonlinelist(js+2)=onlinelist(i+2)
  newonlinelist(js+3)=onlinelist(i+3)
  newonlinelist(js+4)=onlinelist(i+4)
  newonlinelist(js+5)=onlinelist(i+5)
  newonlinelist(js+6)=onlinelist(i+6)
  newonlinelist(js+7)=onlinelist(i+7)
  js=js+8
 else
  savetime=onlinelist(i+5)
 end if
next
useronlinename=useronlinename&" "
if savetime<>"" then
 if onliners=0 then
  dim listnull(0)
  Application("wsaxhxf_c_onlinelist")=listnull
 else
  Application("wsaxhxf_c_onlinelist")=newonlinelist
 end if
 Application("wsaxhxf_c_useronlinename")=useronlinename
 Application("wsaxhxf_c_chatrs")=onliners
 sd=Application("wsaxhxf_c_sd")
 line=int(Application("wsaxhxf_c_line"))
 Application("wsaxhxf_c_line")=line+1
 Dim newsd(180)
 j=1
 for i=10 to 180 step 9
  newsd(j)=sd(i)
  newsd(j+1)=sd(i+1)
  newsd(j+2)=sd(i+2)
  newsd(j+3)=sd(i+3)
  newsd(j+4)=sd(i+4)
  newsd(j+5)=sd(i+5)
  newsd(j+6)=sd(i+6)
  newsd(j+7)=sd(i+7)
  newsd(j+8)=sd(i+8)
  j=j+9
 next
 newsd(172)=line+1
 newsd(173)=1
 newsd(174)=0
 newsd(175)=nickname
 newsd(176)="大家"
 newsd(177)="660099"
 newsd(178)="660099"
 newsd(179)="对"
 newsd(180)="<font color=black>【公告】</font><font color=F08000>" & Replace("%%被人一脚踢出聊天室","%%","<font color=black>" & nickname & "</font>") & "</font><font class=t>(" & t & ")</font>"
 Application("wsaxhxf_c_sd")=newsd
End if
Application.UnLock
if savetime<>"" then
 Set conn=Server.CreateObject("ADODB.CONNECTION")
 Set rs=Server.CreateObject("ADODB.RecordSet")
 connstr=Application("wsaxhg_connstr")
 conn.open connstr
 sql="SELECT grade,value,mvalue,hb,lasttime,lastip FROM reginfo WHERE kill='0' and username='" & nickname & "'"
 rs.open sql,conn,1,3
 addvalue=DateDiff("n",savetime,sj)
 if Not(rs.Eof and rs.Bof) then
  grade=rs("grade")
  rs("value")=rs("value")+addvalue
  rs("hb")=rs("hb")+addvalue
  if DateDiff("m",savetime,sj)=0 then
   rs("mvalue")=rs("mvalue")+addvalue
  else
   rs("mvalue")=addvalue
  end if
  rs("lasttime")=sj
  rs("lastip")=ip
  value=int(rs("value"))
  if value>=int(Application("wsaxhxf_c_level1to2")) and grade<2 then grade=2
  if value>=int(Application("wsaxhxf_c_level2to3")) and grade<3 then grade=3
  if value>=int(Application("wsaxhxf_c_level3to4")) and grade<4 then grade=4
  if value>=int(Application("wsaxhxf_c_level4to5")) and grade<5 then grade=5
  rs("grade")=grade
 
  rs.Update
 end if
 rs.close
 conn.close
 set rs=nothing
 set conn=nothing
end if

If Application("wsaxhxf_c_openurl") = 1 Then
 Response.Redirect "readonly/exitchat.htm"
Else
 'Response.Redirect "/liaotian/index.asp"
 response.write "<script language='javascript'>"
                    response.write "alert('成功踢出！！');"
                    response.write "window.close()</SCRIPT>"
			        response.End()
End If
'Response.Redirect "close.asp"%>