📄 admin_announce.asp
字号:
<!--#include file="function.asp"-->
<%CheckAdmin%>
<!--#include file="top.asp"-->
<img src="" width="1" height="3"><table width="680" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="<%=tablebackcolor%>">
<tr>
<td width="160" bgcolor="<%=tabletitlecolor%>" valign=top>
<!--#include file="admin_left.asp"-->
</td>
<td width="622" bgcolor="<%=tablebodycolor%>" align="center">
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rs=server.createobject("adodb.recordset")
sql="select * from announce order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有公告<br><br><input type=""button"" value=""添加新公告"" onclick=""window.open('admin_announceadd.asp','_self')""></p>"
else
PageUrl="admin_announce.asp"
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
end if
rs.close
sub showContent
%>
<input type="button" value="添加新公告" onclick="window.location.href('admin_announceadd.asp')"><br><br>
<table border="0" width="99%" cellspacing="1" cellpadding="6" class="TableLine" bordercolorlight="<%=MainBColor%>" bgcolor="<%=tablebackcolor%>">
<tr bgcolor="<%=tabletitlecolor%>">
<td width="4%" height=22 align=center><font color="#000000">ID</font></td>
<td width="79%" height=22 align=center><font color="#000000">内容</font></td>
<td width="9%" height=22 align=center><font color="#000000">编辑</font></td>
<td width="8%" height=22 align=center><font color="#000000">删除</font></td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr bgcolor="<%=tablebodyacolor%>">
<td align=center width="4%"><%=rs("id")%></td>
<td width="79%"><%=rs("content")%></td>
<td align=center width="9%"><a href=announceedit.asp?boardid=<%=rs("boardid")%>&id=<%=rs("id")%>>编辑</a> </td>
<td align=center width="8%"><a href=manage.asp?action=bbs&act=announcedel&boardid=<%=rs("boardid")%>&id=<%=rs("id")%>>删除</a> </td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=post action="&filename&">"
if CurrentPage<2 then
response.write " 首页 | 上一页 |"
else
response.write " <a href="&filename&"?page=1>首页</a> | <a href="&filename&"?page="&CurrentPage-1&">上一页</a> |"
end if
if n-currentpage<1 then
response.write " 下一页 | 末页"
else
response.write " <a href="&filename&"?page="&CurrentPage+1&">下一页</a> |"&_
" <a href="&filename&"?page="&n&">末页</a>"
end if
response.write " | 页次:<strong>"&CurrentPage&"/"&n&"</strong>页 | 转到:<select name='page' size='1' onchange='javascript:submit()'>"
for i = 1 to n
response.write "<option value="&i
if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
next
response.write "</select></form>"
end function
%>
</td>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -