<!--#include file="conn.asp"-->

<%


call head()
Call saycarda(""&vicename&"")
%>
<!--#INCLUDE file="../bbs/sy1.asp"-->



<%
IF  Request.QueryString("Action")="view" Then
	call view
else

	call index
end if
Function view
dim id,vicename,vicetxt,vicetm
id=usb(request.QueryString("id"))
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from bbs_vice where id="&id,connshop,1,1
vicename=rs("name")
vicetxt=rs("txt")
vicetm=rs("tm")
rs.close
set rs=nothing






Response.write "标题:"&ubb(vicename)&"<br/>"
Response.write "内容:"&ubb2(vicetxt)&"<br/>"
Response.write "时间:"&vicetm&"<br/>"
dim rs1,rs2
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select name,id from [bbs_vice] where [ID]<"& ID &" order by [ID] desc",connshop,1,1
if rs1.recordcount>0 then
Response.write "下一条:<a href='bbsvice.asp?action=view&amp;id="&rs1("ID")&"&amp;sid="&sid&"'>"&ubb(rs1("name"))&"</a><br/>"
end if
rs1.close
set rs1=nothing
set rs2=Server.CreateObject("ADODB.Recordset")
rs2.open"select name,id from [bbs_vice] where [ID]>"& ID &" order by [ID] asc",connshop,1,1
if rs2.recordcount>0 then
Response.write "上一条:<a href='bbsvice.asp?action=view&amp;id="&rs2("ID")&"&amp;sid="&sid&"'>"&ubb(rs2("name"))&"</a><br/>"
end if
rs2.close
set rs2=nothing
Response.write "<a href=""bbsvice.asp?sid="&sid&""">查看更多公告</a>"
end  Function 
Function index%>
<card title="公告列表">
<p><%
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from bbs_vice order by tm desc"
rs.open sql,connshop,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10						
	Dim Count,page,pagecount,gopage			
	gopage="bbsvice.asp?action=index&amp;sid="&sid&"&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='bbsvice.asp?action=view&amp;id=" & rs("id") & "&amp;sid="&sid&"'>" & ubb(rs("name")) & "</a><br/>"
	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/>"&page&"/"&pagecount&"页,共"&Count&"条<br/><input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳到该页</a><br/>"
Else
Response.write "暂时没有公告！<br/>"
end if
rs.close
set rs=nothing
end  Function 
connshop.close
set connshop=nothing
%>
<br/><!--#include file="fanhui.asp"-->  

<%
call headsay()
%>
