<!--#include file="setup.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Conn.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Const.asp"-->
<%
Dim username,CloseDatabase
Dim page
page=request("page")
If page="" Or Not isnumeric(page) Then page=1
Response.Write "<script language=""JavaScript"" src =""plus/Ex_Stock/Exsm_Plus_News.js""></script>"
Select Case Request("action")
	Case "glance"
		Call Glance()
	Case Else
		Call Main()
End Select
Sub Main()
	Exsm.Title 1,"即时消息"
	Dim NewsSql
	Response.Write "<Script Language=JavaScript>"
	Response.Write "var assignwidth="""&Exsm.AssignWidth&""";"
	sql="select id,content,Color,Addtime from EX_News order by ID desc"
	Set Rs=server.createobject("adodb.recordset")
	rs.open sql,stock_conn,1,1
	If not Rs.eof Then
		Response.Write "var newsliston=true;"
		Rs.PageSize=CInt(Exsm.Setting_Info(16))
		If page+0>Rs.PageCount Then page=Rs.PageCount
		Response.Write "var page="&page&";"
		Rs.AbsolutePage=page
		NewsSql=Rs.GetRows(Rs.PageSize)
		For i=0 To Ubound(NewsSql,2)
			Response.Write "newslist["&i&"]='"&NewsSql(0,i)&"$!%^"&Exsm.UbbCode(Exsm.htmlsetting(NewsSql(1,i)))&"$!%^"&NewsSql(2,i)&"$!%^"&NewsSql(3,i)&"';"
		Next
		Response.Write "var recordcount="&Rs.RecordCount&";"
		Response.Write "var pagesize="&Rs.PageSize&";"
		Response.Write "var pagecount="&Rs.PageCount&";"
	Else
		Response.Write "var newsliston=false;"
	End if
	Response.Write "document.write(exsm_enwsshow())"
	Response.Write "</Script>"
	Exsm.RootShow
End Sub
Sub Glance()
	Exsm.Title 1,"股市公告"
	Dim AnnSql
	Response.Write "<Script Language=JavaScript>"
	Response.Write "var assignwidth="""&Exsm.AssignWidth&""";"
	sql="select Title,Content,Color,AddTime,UserName from EX_Announcement order by ID desc"
	Set Rs=server.createobject("adodb.recordset")
	rs.open sql,stock_conn,1,1
	If not Rs.eof Then
		Response.Write "var annliston=true;"
		Rs.PageSize=CInt(Exsm.Setting_Info(15))
		If page+0>Rs.PageCount Then page=Rs.PageCount
		Response.Write "var page="&page&";"
		Rs.AbsolutePage=page
		AnnSql=Rs.GetRows(Rs.PageSize)
		For i=0 To Ubound(AnnSql,2)
			Response.Write "annlist["&i&"]='"&Server.HtmlEncode(AnnSql(0,i))&","&Exsm.htmlencode(AnnSql(1,i))&","&AnnSql(2,i)&","&AnnSql(3,i)&","&AnnSql(4,i)&"';"
		Next
		Response.Write "var recordcount="&Rs.RecordCount&";"
		Response.Write "var pagesize="&Rs.PageSize&";"
		Response.Write "var pagecount="&Rs.PageCount&";"
	Else
		Response.Write "var annliston=false;"
	End if
	Response.Write "document.write(exsm_annshow())"
	Response.Write "</Script>"
	Exsm.RootShow
End Sub
%>