📄 gonggao.asp
字号:
<!--#include file="head.asp" -->
<%
sub navigation()
response.write " >> "
response.write "政府公告--"&a125_title
end sub
%>
<script language="javascript">
function popUp(gonggaolink) {
props=window.open(gonggaolink,'', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=1, width=450, height=500, left = 376, top = 182');
}
// End -->
</script>
<%
page_count = 12
MaxPerPage=page_count '分页显示的纪录个数
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim keyword
keyword=request("keyword")
if request("keyword")<>"" then
if instr(request("keyword"),"'")>0 then
founderr=true
Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
end if
end if
%>
<table border="0" cellpadding="0" cellspacing="0" width="996" height="50" bgcolor="#ffffff">
<tr>
<!--左边内容-->
<td width="216" valign="top" background="images/2/left_bg.gif">
<div align="center">
<%call a125_tianqi()%>
</div>
<div align="center">
<% Call a125_acticletype(15,-5,"新闻公告") %>
</div>
<div align="center">
<% call a125_Search5() %>
</div>
<div align="center">
<% Call a125_otherInfo(1,8,20,"a125_",0) %>
</div>
</td>
<td width="780" valign="top">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="780" height="20" >
<tr>
<TD width="100%" height="62" ><IMG height=62 src="images/tu01.jpg" width=780></TD>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="780" height="20" >
<tr>
<TD width="50" height="20" ><DIV align=center><IMG height=17
src="images/bottom4.gif" width=18></DIV></TD>
<TD width="580" height="20" >您现在的位置:首页 >> 政府公告
<%
if request.querystring("keyword")<>"" then
Response.Write ">> 搜索结果 关键词:"&keyword
end if
%>
</TD>
</tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="780" height="160" >
<tr>
<td bgcolor="#FFFFFF" width="780">
<!-- 公告列表开始-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top"> <br>
<%
sql="select * from a125_gonggao ORDER BY ID DESC"
if request("keyword")<>"" then
sql="select * from a125_gonggao where Title like '%"&keyword&"%' or Content like '%"&keyword&"%' ORDER BY ID DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
'Set Rs=Conn.Execute("select * from gonggao ORDER BY id DESC")
rs.pagesize=MaxPerPage
If trim(Request("Page"))<>"" and IsNumeric(Request("Page")) then
CurrentPage= CLng(request("Page"))
If CurrentPage< 1 then
CurrentPage= 1
ElseIf CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If
if rs.eof then
response.write "<p align='center'>还没有添加公告...</p>"
else
totalPut=rs.recordcount '记录总数
if CurrentPage=1 then
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移动到开始显示的记录位置
showContent
showpages
else
currentPage=1
showContent
end if
end if
rs.close
end if
set rs=nothing
set conn=nothing
sub showContent
%>
<TABLE width="100%" align="center" cellspacing="2" >
<%
dim i
i=0
do while not (rs.eof or err)
%>
<tr>
<td width="20" height="30" background="images/line.gif">
<div align="right"><img src="Images/a125_ico.gif" width="12" height="11" align="absmiddle"></div></td>
<td width="510" background="images/line.gif"><div align="left"><a href="javascript:popUp('a125_gonggao.asp?id=<%response.write rs(0)%>')">
<% if Getlen(rs("Title"))>35 then%>
<%=LeftStr(rs("Title"),30)%>...
<%else%>
<%response.write rs("Title")%>
<%end if%>
</a></div></td>
<td width="120" background="images/line.gif">[ <%=rs("Time")%>
]</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</TABLE>
<%end sub%>
<%sub showpages()%>
<br> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="center">
<%
dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
%>
共有<%=rs.recordcount%>个记录 每页<%=Page_count%>个记录
<%
k=currentPage
if k=1 then
response.write " 首页 "& vbCrLf
response.write " 上一页 "& vbCrLf
end if
if k<>1 then
response.write "<a href='gonggao.asp?keyword="&request("keyword")&"&page=1'> 首页 </a>"
response.write "<a href='gonggao.asp?keyword="&request("keyword")&"&page="+cstr(k-1)+"'> 上一页 </a>"
end if
if k=n then
response.write " 下一页 "& vbCrLf
response.write " 末页 "& vbCrLf
end if
if k<>n then
response.write "<a href='gonggao.asp?keyword="&request("keyword")&"&page="+cstr(k+1)+"'> 下一页 </a>"
response.write "<a href='gonggao.asp?keyword="&request("keyword")&"&page="+cstr(n)+"'> 末页 </a> "
end if
%>
</td>
</tr>
</table>
<% end sub %>
</td>
</tr>
</table>
<!-- 公告列表结束-->
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<!--#include file="foot.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -