<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<%Call FortxtChat
Call head()
Call saycardd("聊天室在线")

dim ID
ID=trim(Request.QueryString("ID"))
if ID="" or IsNumeric(ID)=false then
   Call Error("错误的聊天室ID")
end if

dim Chatname,ChatAdmin,Suxin,cBeon
set rs=server.createobject("adodb.recordset")
rs.open "select roomname,roomAdmin,Suxin,chatnum,gruid from Chat where ID="&ID,conn,1,2
if rs.eof then
  rs.close
  set rs=nothing
  Call Error("错误的聊天室ID")
end if
Chatname = rs("roomname")
ChatAdmin= rs("roomAdmin")
Suxin    = rs("Suxin")
cBeon    = rs("chatnum")
gruid    = rs("gruid")
rs.close
set rs=nothing
Response.write "==聊天室在线成员查看==<br/>"
'管理员
dim AdminID
AdminID = 0
if Instr(","&ChatAdmin&",",","&Myid&",") > 0 then
   AdminID   = Myid
end if
If datesql=0 then
set rs=server.CreateObject("ADODB.RecordSet")
  rs.Open "select ID,name,tjj from Users where tjj >= '"&DateAdd("n", chatonline, Now())&"' and ChatID= "&ID&" order by tjj desc",conn,1,1
  Else
set rs=server.CreateObject("ADODB.RecordSet")
  rs.Open "select ID,name,tjj from Users where ChatID= "&ID&" order by tjj desc",conn,1,1

  End if
If Not rs.eof Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="chatonline.asp?ID="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	For i=1 To PageSize     						
	If rs.eof Then Exit For
   Response.write ""&i+(page-1)*PageSize&"."
       Response.write " <a href='chatsend.asp?ID="&ID&"&amp;IDs="&rs("ID")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&rs("Name")&"</a> <br/>最后在线时间:["&rs("tjj")&"]"
     if rs("ID") <> Myid then
       if Myid = AdminID or keys = 1 or keys=2 or abs(gruid)=adminzone then
       Response.write " [<a href='chatout.asp?ID="&ID&"&amp;IDS="&rs("ID")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>踢</a>]"
       end if
     end if
   Response.write "<br/>"&chr(13)

	rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳转</a><br/>"
end if
Else
   Response.write "暂时没有在线会员！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=Nothing
Response.write "<br/>&nbsp;"&chr(13)
Response.write "<br/><a href='chatroom.asp?ID="&ID&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>返回房间</a>"&chr(13)
call headsay()
%>