<!--#include file="Include/Conn.asp"-->
<!--#include file="Include/Const.asp"-->
<!--#include file="Include/Function.asp"-->
<%
Aid = Trim(Request.QueryString("Aid"))
Page = Trim(Request.QueryString("Page"))
If Aid = "" Then
	Set Ceb_Rs = Server.CreateObject("ADODB.RecordSet")
	Ceb_Rs.Open "Select * From iHelp_Announce Order By F_HelpAnnounceId Desc",Conn,1,1
	If Ceb_Rs.Eof And Ceb_Rs.Bof Then
		Announce = "<TR><TD colSpan=9>暂无公告</TD></TR><TR><TD background=images/line_g22.gif colSpan=9 height=1></TD></TR>"
	Else
		Ceb_Rs.PageSize = 20 '每页记录条数
		iCount = Ceb_Rs.RecordCount
		iPageSize = Ceb_Rs.PageSize
    		Maxpage = Ceb_Rs.PageCount 
		If Not IsNumeric(Page) Or Page = "" Then
        		Page = 1
		Else
			Page = Cint(Page)
		End If
		If Page < 1 Then
			Page = 1
		ElseIf Page > Maxpage Then
			Page = Maxpage
		End If
		Ceb_Rs.AbsolutePage = Page
		If Page = Maxpage Then
			X = iCount-(Maxpage-1)*iPageSize
		Else
			X = iPageSize
		End If
		For I = 1 To X
			Announce = Announce & "<TR><TD width='1%'></TD><TD width='79%'>·<A href='?Aid=" & Ceb_Rs("F_HelpAnnounceId") & "' target=_blank>"
			Announce = Announce & Ceb_Rs("F_HelpAnnounceTitle") & "</A></TD><TD class=c6 width='20%'>" & Ceb_Rs("F_HelpAnnounceDate") & "</TD></TR>"
			Announce = Announce & "<TR><TD background=images/line_g22.gif colSpan=9 height=1></TD></TR>"
		Ceb_Rs.Movenext
		Next
		Announce = Announce & "<TR><TD width='1%'></TD><TD width='79%'>总计 " & iCount & " 条公告 "
		If Page <= 1 Then
			Announce = Announce & "首页 上一页"
		Else
			Announce = Announce & "<a href='?Page=1'>首页</a> <a href='?Page=" & Page-1 & "'>上一页</a>"
		End If
		If Page >= Maxpage Then
			Announce = Announce & " 下一页 末页"
		Else
			Announce = Announce & " <a href='?Page=" & Page+1 & "'>下一页</a> <a href='?Page=" & Maxpage & "'>末页</a>"
		End If
		Announce = Announce & "&nbsp;第" & Page & "页 共" & Maxpage & "页</TD><TD align=right width='20%'><A href='#top'><IMG height=17 "
		Announce = Announce & "src='images/gototop.gif' width=40 border=0></A></TD></TR>"
	End If
	Ceb_Rs.Close
	Set Ceb_Rs = Nothing
	Set Ceb_Rs = Conn.Execute("Select Top 5 * From iHelp_Announce Order By F_HelpAnnounceId Desc")
	If Ceb_Rs.Eof And Ceb_Rs.Bof Then
		Announces = Announces & "<tr><td><span class='f10 c9'>·</span>暂无公告</td></tr>"
		Announces = Announces & "<tr><td height='1' colspan='9' background='/images/line_g.gif'><img src='images/line_g.gif' border='0'></td></tr>"
	Else
		Do While Not Ceb_Rs.Eof
			Announces = Announces & "<tr><td><span class='f10 c9'>·</span><a href='Announce.asp?aId=" & Ceb_Rs("F_HelpAnnounceId") & "' target='_blank' "
			Announces = Announces & "class='c3nul'>" & Ceb_Rs("F_HelpAnnounceTitle") & "</a></td></tr><tr><td height='1' colspan='9' background='"
			Announces = Announces & "/images/line_g.gif'><img src='images/line_g.gif' border='0'></td></tr>"
		Ceb_Rs.Movenext
		Loop
	End If
	Set Ceb_Rs = Nothing
	SiteTitle = "公告"
	Template = Templates("Template/Top.Html") & Templates("Template/Announce.Html") & Templates("Template/Bottom.Html")
	Template = Replace(Template,"{$Ask@SiteTitle}",SiteTitle)
	Template = Replace(Template,"{$Ask@WebSite}",WebSite)
	Template = Replace(Template,"{$Ask@Body}",iBody)
	Template = Replace(Template,"{$Ask@Announce}",Announce)
	Template = Replace(Template,"{$Ask@Announces}",Announces)
	Template = Replace(Template,"{$ask@islogin}",islogin)
Else
	Call IsEn(Aid,"Aid值只能是数字",1)
	Set Ceb_Rs = Conn.Execute("Select * From iHelp_Announce Where F_HelpAnnounceId = " & Clng(Aid))
	If Ceb_Rs.Eof And Ceb_Rs.Bof Then Call Info("没有该条公告",2,"?")
	AnnounceTitle = Ceb_Rs("F_HelpAnnounceTitle")
	AnnounceCountent = Ceb_Rs("F_HelpAnnounceContent")
	AnnounceDate = Ceb_Rs("F_HelpAnnounceDate")
	Set Ceb_Rs = Nothing
	Set Ceb_Rs = Conn.Execute("Select Top 5 * From iHelp_Announce Order By F_HelpAnnounceId Desc")
	If Ceb_Rs.Eof And Ceb_Rs.Bof Then
		Announces = Announces & "<tr><td><span class='f10 c9'>·</span>暂无公告</td></tr>"
		Announces = Announces & "<tr><td height='1' colspan='9' background='/images/line_g.gif'><img src='images/line_g.gif' border='0'></td></tr>"
	Else
		Do While Not Ceb_Rs.Eof
			Announces = Announces & "<tr><td><span class='f10 c9'>·</span><a href='Announce.asp?aId=" & Ceb_Rs("F_HelpAnnounceId") & "' target='_blank' "
			Announces = Announces & "class='c3nul'>" & Ceb_Rs("F_HelpAnnounceTitle") & "</a></td></tr><tr><td height='1' colspan='9' background='"
			Announces = Announces & "/images/line_g.gif'><img src='images/line_g.gif' border='0'></td></tr>"
		Ceb_Rs.Movenext
		Loop
	End If
	Set Ceb_Rs = Nothing
	SiteTitle = AnnounceTitle & " - 公告"
	Template = Templates("Template/Top.Html") & Templates("Template/AnnounceCountent.Html") & Templates("Template/Bottom.Html")
	Template = Replace(Template,"{$Ask@SiteTitle}",SiteTitle)
	Template = Replace(Template,"{$Ask@WebSite}",WebSite)
	Template = Replace(Template,"{$Ask@Body}",iBody)
	Template = Replace(Template,"{$Ask@AnnounceTitle}",AnnounceTitle)
	Template = Replace(Template,"{$Ask@AnnounceDate}",AnnounceDate)
	Template = Replace(Template,"{$Ask@AnnounceCountent}",AnnounceCountent)
	Template = Replace(Template,"{$Ask@Announces}",Announces)
	Template = Replace(Template,"{$ask@islogin}",islogin)
End If
Response.Write Template
close_conn()
%>