<!--#include file="admin_chk.asp"-->
<!--#include file="admin_conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文章管理</title>
<link href="page.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
</head>

<body>
<table width="188" height="34" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">文章管理</div></td>
  </tr>
</table>
<table width="568" height="366" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td valign="top" bgcolor="#FFFFFF"><br>
        <table width="465" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><div align="center" class="helptopic">点击文章标题可进行编辑修改！</div></td>
          </tr>
        </table>
        <br>
        <hr width="90%" size="1" class="form">
        <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table>
        <table width="490" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="490">&nbsp;</td>
          </tr>
        </table>
        <table width="512" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="34"><div align="center">选择</div></td>
            <td width="77"><div align="center">文章分类</div></td>
            <td width="123"><div align="center">文章标题</div></td>
            <td width="123">&nbsp;</td>
            <td width="78"><div align="center">添加时间</div></td>
            <td width="77"><div align="center">是否固顶</div></td>
          </tr>
        </table>  
        <form name="form1" method="post" action="news_del.asp"> <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news2 order by news_gd,id desc",conn,1,1
url="news.asp"
page=1    ' 设置变量PAGE=1
rs.PageSize = 10 '每页显示记录数
if Not IsEmpty(Request("Page")) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量
        if Page > rs.PageCount then '如果接收的页数大于总页数
        rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页
            elseif Page <= 0 then '如果page小于等于0
        Page = 1 '设置PAGE等于第一页
    else
        rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数 
    end if
End if
Page = rs.AbsolutePage 
total = rs.RecordCount
%>
<% 
For i = 1 to rs.PageSize
if rs.EOF then     
Exit For 
end if '利用for next 循环依次读出记录
%>

          <table width="512" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="34"><div align="center">
                <span class="b">
                <input name=id type='checkbox' class="Gray" value='<%=Cstr(rs("Id"))%>'>
              </span>              </div></td>
              <td width="77"><div align="center">【<%=rs("news_flm")%>】</div></td>
              <td width="246">　<a href="news_edit.asp?id=<%=rs("id")%>"><%if len(rs("news_pt"))<18 then %><%=rs("news_pt")%><%else%><%=left(rs("news_pt"),18)%>..<% end if%></a></td>
              <td width="78"><div align="center"><%= rs("news_addtime") %></div></td>
              <td width="77"><div align="center">
                <% if rs("news_gd")=true then %>固顶<% end if %>
              </div></td>
            </tr>
          </table> 
          <% rs.MoveNext
					  next %>
          <br>
          <br>
          <table width="512" height="27" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="32">
                <div align="center">
            <input name=chkall type='checkbox' class="Gray" onclick='CheckAll(this.form)'>
          </div></td>
              <td width="34">全选</td>
              <td width="63">
                <div align="center">
                  <input name="action" type="submit" class="Gray" onClick="{if(confirm('该操作不可恢复！\n\n确定删除选定的新闻？')){javascript:location.href='news_del.asp';return true;}return false;}" value="删除" >
                </div>
              <td width="82">                
                <div align="center">
                  <input name="Submit" type="button" class="Gray" onClick="javascript:location.href='news_add.asp';" value="添加文章">
                </div></td>
              <td width="289"><div align="right">
                <%
					  response.Write("第"&page&"/"&rs.pagecount&"页 共"&total&"条记录 ")

if Page>1 then
    response.write "<a Href="&url&"?Page="&"1"&">首页</a> <a Href='"&url&"?Page="&Page-1&"'>上一页</a> "

else
    response.write "首页 上一页 "
end if

if Page<>rs.pagecount then
    response.write "<a Href='"&url&"?Page="&Page+1&"'>下一页</a> <a Href='"&url&"?Page="&rs.PageCount&"'>尾页</a>"
else
    response.write "下一页 尾页"
end if
%>
              </div></td>
              <td width="12">&nbsp;</td>
            </tr>
          </table>
        </form>
        <hr width="90%" size="1" class="form"></td>
  </tr>
</table>
</body>
</html>
 
