<!--#include file="conn.asp" -->
<!--#include file="inc/IsLogin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新闻列表</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/select_unselect.js"></script>
<script language="javascript">
$(function(){	
	//导航切换
	$(".imglist li").click(function(){
		$(".imglist li.selected").removeClass("selected")
		$(this).addClass("selected");
	})	
})	
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>

<script type="text/javascript">
function SubDel(ac){
document.del.action=ac;
document.del.submit();
}
</script>


</head>
<%  
dim pathstr :pathstr=""
dim act :act=Trim(Request("act"))
dim bid:bid=Trim(Request.QueryString("bid"))


 set rs=server.createobject("adodb.recordset")
sql="Select * from News where id>0" 
if bid<>"" then sql=sql&" and bid="&bid
sql=sql&" order by id desc"


rs.open sql,conn,1,1
 
 %>

<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="index.asp">首页</a></li>
    <li><a href="News_list.asp">文章列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li><span><img src="images/t01.png" border="0" /></span><a href="News_add.asp">添加</a></li>
        <li><span><img src="images/t03.png" /></span><a onClick="SubDel('News_Modify.asp');">修改</a></li>
		<li class="click"><span><img src="images/t02.png" /></span>
		<a onClick="document.del.action='News_DelAll.asp?action=Del'">
		删除
		</a>
		</li>
    	</ul> 
	 
		 <ul class="seachform" style="padding-left:30px;">
    <%	
sqlb= "select * from big"
set rsb=conn.execute(sqlb) 
while not rsb.eof
%>
    <li><label><a href="?bid=<%=trim(rsb("id"))%>"><%=rsb("bname")%></a></label>	</li>	
<%
rsb.movenext
wend
 
rsb.close
%>
	</ul>	  
    </div>
	
	
    
    <form name="del" method="Post" action="" id="del">
    <table class="goods">
    
    <thead>
    <tr>
      <th  width="50px;">
	  <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox"></th>
      <th  width="400px;">文章标题</th>
    
	<th>文章分类</th>
	<th>点击率</th>
	<th>添加时间</th>    
    </tr>
    </thead>
    
    <tbody>
    
	<% 
'分页信息头部
filepath=request.servervariables("path_info")
page=1 '设置变量初始值PAGE=1
page=request.querystring("page") 'page值为接受值 
rs.PageSize =15 '每页显示记录数
if Not IsEmpty(trim(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
for i = 0 to rs.PageSize-1

	
	

%>
    <tr>
      <td class="imgtd">
	  <input name='ID' type='checkbox' onClick="unselectall()" id="ID" value='<%=cstr(rs("ID"))%>'></td>
      <td><a href="News_modify.asp?id=<%=rs("id")%>"><%=rs("title")%></a> </td>
    <td><%=GetNewBname(rs("bid"))%></td>
    <td><%=rs("hits")%></td>
    <td><%=rs("addtime")%></td>
    </tr>
<%
		RS.movenext 
		
		if RS.eof then
		i = i + 1
		exit for
		End If
  
        next
%>   
    </tbody>
    </table>
	
	<div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对所选记录的删除 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
      </div>
        
        <div class="tipbtn">
        <input name="subdel_ok" type="button"  class="sure" id="subdel_ok" value="确定" onClick="SubDel('News_DelAll.asp?action=Del')" />
        &nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
		
		 

        </div>
    
    </div>
    
    </form>
    
    
    
   
    <div class="pagin">
   	  <div class="message">共<i class="blue"><%=rs.RecordCount%></i>条记录，当前显示第&nbsp;<i class="blue"><%=page%>&nbsp;</i>页</div>
	  
	  
        <ul class="paginList">
        <li class="paginItem">
		<a href="<%=filepath%>?Page=<%=page -1 %><%=pathstr%>"><span class="pagepre"></span></a></li>
        <li class="paginItem <% If page=1 Then response.Write "current"%>">
		<a href="<%=filepath%>?Page=1&ser=<%=ser%><%=pathstr%>">1</a></li>
		
        <li class="paginItem <% If page=2 Then response.Write "current"%>">
		<a href="<%=filepath%>?Page=2&ser=<%=ser%><%=pathstr%>">2</a></li>
		
<li class="paginItem <% If page=3 Then response.Write "current"%>">
		<a href="<%=filepath%>?Page=3&ser=<%=ser%><%=pathstr%>">3</a></li>
		
		<li class="paginItem <% If page=4 Then response.Write "current"%>">
		<a href="<%=filepath%>?Page=4&ser=<%=ser%><%=pathstr%>">4</a></li>
		
		<li class="paginItem <% If page=5 Then response.Write "current"%>">
		<a href="<%=filepath%>?Page=5&ser=<%=ser%><%=pathstr%>">5</a></li>
		
        <li class="paginItem more"><a href="<%=filepath%>?Page=<%=rs.PageCount%>&ser=<%=ser%><%=pathstr%>">尾页</a></li>
        
        <li class="paginItem"><a href="<%=filepath%>?Page=<%=page + 1%>&ser=<%=ser%><%=pathstr%>"><span class="pagenxt"></span></a></li>
        </ul>
    </div>
    
    
    
    
    
    
    
    </div>
    
     
    
<script type="text/javascript">
	$('.goods tbody tr:odd').addClass('odd');
	</script>
    
</body>

</html>
