www.gusucode.com > 盐城分类信息网asp源码程序 > admin/listnews.asp

    <!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<link href="inc_style.css" rel="stylesheet" type="text/css">
<%
dim sql,rs,nbiaoti,nfrom,nurl,Allrecord,Pagesize,Allpage,ThisPage,k
if request("page")="" then
ThisPage=1		
else
ThisPage=request("page")
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [news] order by ndata  desc"
rs.open sql,conn,1,1
rs.Pagesize=10
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then                           
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
k=0
%>

<style type="text/css">
<!--
body {
	background-color: #E7EEF5;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style><div align="center">
   <table width="88%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">

<tr bgcolor="#B6EBC4">
        <td width="99%" height="26" bgcolor="#C5D5E4">
      <p align="center"><b>城市新闻管理&nbsp; <a href="addnews.asp"><u><font color="#FF0000">添加新闻</font></u></a></b></td>
     </tr>
      <tr>
        <td width="99%" height="24" valign="top" bgcolor="#EAEFF4">
        <b>记录总数</b>:[共<%=Allrecord%>条新闻]
        <table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">

     <%do while not rs.eof%>
   <tr bgcolor="#B6EBC4">
            <td width="6%" height="24" s bgcolor="#D8E1EB">
            <p align="center"><b><font color="#808080"><%=k+1%></font></b></td>
            <td width="82%" height="24"  bgcolor="#D8E1EB"><A target="_blank" href="<%=rs("nurl")%>"><FONT color=#000000><%=rs("nbiaoti")%></FONT></A>[<font color="#0000FF"><%=rs("nfrom")%></font>   <%=rs("ndata")%>]</td>
            <td width="6%"  height="24" bgcolor="#D8E1EB">
            <a href="editnews.asp?id=<%=rs("id")%>"><font color="#FF0000">修改</font></a></td>
            <td width="5%"  height="24" bgcolor="#D8E1EB">
            <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="delnews.asp?id=<%=rs("id")%>">
            <font color="#FF0000">删除</font></a></td>
          </tr>
     <%
    k=k+1
    rs.movenext
    if k>=Pagesize then exit do
	loop
	 %>
        </table>
        </td>
      </tr>
      <tr>
        <td width="99%" height="24" valign="top" bgcolor="#FFFFFF">
		   <table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">

   <tr bgcolor="#B6EBC4">
<td height="27" width="151" align="center" bgcolor="#C5D5E4">
共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录</td>
<td width="181" align="center" bgcolor="#C5D5E4">
共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td width="237" align="center" bgcolor="#C5D5E4">
现在是第 
                <font color="#CC5200"><%=ThisPage%></font> 页</td>
<td width="200" align="center" bgcolor="#C5D5E4">
<%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1>首页</a>&nbsp;"
response.write "<a href=?page="&ThisPage-1&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&">尾页</a>&nbsp;"     
end if
%></td></tr></table></td>
      </tr>
    </table>
</div>
<%
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing
%>