📄 admin_news1.asp
字号:
<!--#include file="7dipath.asp"-->
<%
if request.cookies("okadmin")="" then
response.redirect "../7dilogin.asp"
end if
%>
<%
dim MaxPerPage
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<body leftmargin="0" topmargin="0">
<table border="0" width="528" cellspacing="0" cellpadding="0">
<center>
<tr>
<tr>
<td width="575" valign="top"></td>
</tr>
<tr>
<td width="575" valign="top">
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table align="center" width="423">
<tr>
<td width="552">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from news order by time DESC"
rs.open sql,conn,1,1
if rs.eof and rs.bof then %>
<p align="center" class="text1">还 没 这 类 新 闻 动 态</p>
<% else
rs.pagesize=15
totalPut=rs.recordcount '记录总数
totalPage=rs.pagecount
MaxPerPage=rs.pagesize
if currentpage<1 then
currentpage=1
end if
if currentpage>totalPage then
currentpage=totalPage
end if
if currentPage=1 then
showpages
showContent
showpages1
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移动到开始显示的记录位置
showpages
showContent
showpages1
else
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i,j
%>
<br>
<table width="508" border="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<% i=1
do while not (rs.eof or err)
if i mod 2 <> 0 then %>
<tr bgcolor="#F0F0F0">
<%else%>
<tr bgcolor="#F0F0F0">
<%end if%>
<td width="508" class="text1">
<ul>
<li><font color="#5A5A5A"><b>
<%=rs("title")%></b></font> (<%=rs("date")%>?<%=rs("time")%>)<br><!-- 新闻标题日期时间 -->
<%=rs("news")%>
【<a href="../new.asp?id=<%=rs("id")%>" target="_blank">详细信息</a> <%Response.Write "<A HREF=editnews.asp?userid=" & cstr(rs("id")) & "&page=" & cstr(currentpage) & "&lbid=" & cstr(request("lbid"))& ">修改</A>" %> <%Response.Write "<A HREF=delenews.asp?userid=" & cstr(rs("id")) & "&page=" & cstr(currentpage) & "&lbid=" & cstr(request("lbid"))& ">删除</A>】"%>
</ul>
</td>
</tr>
<%
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
i=i+1
rs.movenext
loop
%>
</table>
<%end sub
sub showpages()
%>
<table width="500">
<tr>
<td align="right" width="494" class="text1">共查询到<font color="#FF0000"><%=totalPage%></font>页/<font color="red"><b><%=totalPut%></b></font>条信息</td>
</tr>
</table>
<%
end sub
sub showpages1()
dim n
n=totalPage
%>
<form action="admin_typegong.asp" method="GET" align="right">
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0" height="30" width="100%">
<tr>
<td width="100%">
<p align="center"> <%
If currentPage <> 1 Then
Response.Write "<A HREF=admin_news.asp?lbid="&request("lbid") & ">[第一页]</A> "
Response.Write "<A HREF=admin_news.asp?lbid="&request("lbid") & "&Page=" & (currentPage-1) & ">[上一页]</A> "
End If
If currentPage <> rs.PageCount Then
Response.Write "<A HREF=admin_news.asp?lbid="&request("lbid") & "&Page=" & (currentPage+1) & ">[下一页]</A> "
Response.Write "<A HREF=admin_news.asp?lbid="&request("lbid") & "&Page=" & totalPage & ">[最后一页]</A> "
End If
%><font size="2pt">第<%=currentPage%>页/共<%=totalPage%>页<% response.write " 转到:</font><select name='page' size=1 class=smallselsect style='font-family: 宋体; font-size: 9pt;'>"
for i=1 to n
response.write "<option value="& i
if currentpage=i then
response.write " selected"
end if
response.write ">"& i &"</option>"
next
response.write "</select>"
response.write "<input type='hidden' name='lbid' value="&request("lbid")&">"
response.write " <input class=buttonface type='submit' value='确定' style='font-family: 宋体; font-size: 9pt;'>"
%> </p>
</td>
</tr>
</table>
</center>
</div>
</form>
<%end sub%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</body><!--
'******************************以下信息切记一定不要删除******************************************************'
'** *****'
'** 启迪信息平台由www.7di.net开发完成,如果需要转载,请保留作者的劳动成果 *****'
'** 此程序由 我(qq:9256114)和 没有鱼的水(356754)开发完成,历时2周。 *****'
'** 我的站点是http://www.7di.net,最近正在加紧改版,欢迎提出宝贵建议。 *****'
'** 没有鱼的水的站点是http://www.heartyue.com,这是一个不错的文学站点,由我们两人合作完成 *****'
'** *****'
'************************************************************************************************************' -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -