<!--#include file="setup.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Conn.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Const.asp"-->
<%
	select case request("action")
		case "AnalyseDiv"
			call AnalyseDiv()
		case else
			call main()
	End select
	sub main()
		Response.Write "<script language=""JavaScript"" src =""plus/Ex_Stock/Exsm_Plus_UserList.js""></script>"
		If CInt(Exsm.Setting_Info(10))>0 then
			Exsm.Title 1,"在线情况"
			Dim page,AdminMenu,ExRs,AnalyseDaTa
			Dim Quotations
			Exsm.Name="Exsm_Imitate_Quotations"
			Quotations=Exsm.Value
			page=request("page")
			If page="" Or Not isnumeric(page) Then page=1
			Response.Write "<Script Language=JavaScript>"
			Response.Write "var stockname='"&Exsm.Setting_Info(0)&"';"
			Response.Write "var assignwidth='"&Exsm.AssignWidth&"';"
			Response.Write "var regusernum="&Cint(Quotations(4))&";"
			Response.Write "var guestusernum="&Cint(Quotations(5))&";"
			If Exsm.StockAdmin Then
				Response.Write "stockadmin=1;"
			End if
			If request("action")="Admin" Then AdminMenu=1 Else AdminMenu=0
			Response.Write "var adminmenuon="&AdminMenu&";"
			Response.Write "document.write(exsm_online_top());"
			Response.Write "</Script>"
			Sql="select * from EX_Analyse"
			Set Rs=server.createobject("adodb.recordset")
			rs.open sql,stock_conn,1,1
			If not Rs.eof Then
				Rs.PageSize=CInt(Exsm.Setting_Info(16))
				If page+0>Rs.PageCount Then page=Rs.PageCount
				Rs.AbsolutePage=page
				ExRs=Rs.GetRows(Rs.PageSize)
				For i=0 To Ubound(ExRs,2)
					Response.Write "<Script Language=JavaScript>"
					Response.Write "document.write (exsm_online_list('"
					Response.Write ExRs(0,i)
					Response.Write "','"
					Response.Write Exsm.htmlencode(ExRs(1,i))
					Response.Write "','"
					If Exsm.StockAdmin Then
						Response.Write ExRs(2,i)
					Else
						Response.Write Split(ExRs(2,i),".")(0)&"."&Split(ExRs(2,i),".")(1)&"."&Split(ExRs(2,i),".")(2)&".*"
					End if
					Response.Write "','"
					Response.Write ExRs(3,i)
					Response.Write "','"
					Response.Write Exsm.htmlencode(ExRs(4,i))
					Response.Write "','"
					Response.Write ExRs(5,i)
					Response.Write "','"
					Response.Write ExRs(6,i)
					Response.Write "','"
					Response.Write ExRs(7,i)
					Response.Write "','"
					Response.Write ExRs(8,i)
					Response.Write "'));"
					Response.Write "</Script>"
				Next
				Response.Write "<Script Language=JavaScript>"
				Response.Write "var assignwidth='"&Exsm.AssignWidth&"';"
				Response.Write "var page="&page&";"
				Response.Write "var recordcount="&Rs.RecordCount&";"
				Response.Write "var pagesize="&Rs.PageSize&";"
				Response.Write "var pagecount="&Rs.PageCount&";"
				Response.Write "document.write(exsm_online_root());"
				Response.Write "</Script>"
			Else
				Response.Write "<Script Language=JavaScript>"
				Response.Write "var assignwidth='"&Exsm.AssignWidth&"';"
				Response.Write "document.write(exsm_online_naught());"
				Response.Write "</Script>"
			End if
		Else
			stock_conn.execute "delete from EX_Analyse"
			Exsm.Errmess="<li>"&Exsm.Setting_Info(0)&"-在线情况已经关闭请返回。"
			Call Exsm.Endinfo(1)
			Exit sub
		End if
		Exsm.RootShow
	End sub
	Sub AnalyseDiv()
		Response.Write "<script language=""JavaScript"" src =""plus/Ex_Stock/Exsm_Plus_Online.js""></script>"
		Response.Write "<script language=""javascript"">"
		Dim page,AnalyseDaTa,IdentifyUserIp,j
		Dim AutoUserID
		If Request("online")=1 Then
			Response.Write "ShowAnalyse();"
		End If
		If CInt(Request("Off"))=1 Then
			Response.Write "</script>"
			Exit Sub
		End if
		page=Request("page")
		If page="" Then page=1
		page=Clng(page)
		If Exsm.UserID<>0 Then
			Response.Write "username='"&Exsm.StockHolder&"';"
		Else
			AutoUserID=Clng(Exsm.ExsmUserInfo(3))
			Response.Write "StatUserID='"&AutoUserID&"';"
		End If
		If Exsm.StockAdmin Then
			IdentifyUserIp=",userip"
			Response.Write "StockAdmin=1;"
		End if
		j=0
		Set Rs=server.createobject("adodb.recordset")
		Sql="select id,username,usertime,nowseat,userid,movetime,hideuser,StatUserID"&IdentifyUserIp&" from EX_Analyse"
		Rs.open Sql,stock_conn,1,1
		Rs.PageSize=CInt(Exsm.Setting_Info(12))
		Rs.AbsolutePage=page
		Response.Write "pageCount="&Rs.pageCount&";"
		Response.Write "Count="&Rs.recordcount&";"
		Response.Write "PageSize="&CInt(Exsm.Setting_Info(12))&";"
		Response.Write "page="&page&";"
		Do while Not Rs.Eof
			For i=0 to Rs.Fields.count-1
				AnalyseDaTa=AnalyseDaTa & Rs(i)& "@$#^"
			Next
			AnalyseDaTa=AnalyseDaTa&"!&%@"
		Rs.movenext
		j=j+1
		If j=CInt(Exsm.Setting_Info(12)) Then Exit Do
		loop
		Rs.close
		AnalyseDaTa=Replace(Replace(Replace(Replace(AnalyseDaTa&"","\","\\"),"'","\'"),VbCrLf,"\n"),chr(13),"")
		Response.Write "showlist('"&AnalyseDaTa&"');"
		Response.Write "</script>"
	End Sub
%>