<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

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;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的新闻吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}
</SCRIPT>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="100%" height="77%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <p align="center"><strong>新 
        闻 资 讯 管 理</strong></p>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
        <tr class="title"> 
          <td height="25" bgcolor="#eeeeee">
<%Set big = Conn.Execute("Select * From [BigClassNews]")
If big.Eof Then
Response.Write "没有分类!"
Else
Do While Not big.Eof 
Response.Write "<a href='News_Manage.asp?tit=" &big("News_BigClassName")& "'>" &big("News_BigClassName")& "</a> | "
big.MoveNext
Loop
End if
%></td>
        </tr>
      </table>
<%
page=request.querystring("page")
PageSize = 15
SqlStr = "Select * From [News] "
If Request.QueryString("tit")="" Then
SqlStr = SqlStr & " Order by News_ID Desc"
Else
SqlStr = SqlStr & " Where News_BigClassName='"&Request.QueryString("tit")&"' Order by News_ID Desc"
End if
Set rs=Server.CreateObject("Adodb.Recordset")
rs.Open SqlStr,Conn,3,3
rs.PageSize = PageSize
TotalPages=rs.pagecount
if page="" or clng(page)<1 then page=1
if clng(page) > TotalPages then page=TotalPages
if TotalPages>0 then rs.AbsolutePage=page
a = 0
%>
      <form name="del" method="Post" action="News_EditNews.asp?id=<%=rs("News_ID")%>&action=delnews" onsubmit="return ConfirmDel();">
        <table width="720" border="0" cellpadding="0" cellspacing="2">
          <tr> 
            <td height="25">&nbsp;新闻资讯管理 &gt;&gt;
<%
If Request.QueryString("tit")="" Then
Response.Write "全部新闻"
Else
Response.Write Request.QueryString("tit")
End if
%> 
            </td>
            <td width="150">&nbsp; </td>
          </tr>
        </table>
<%
If rs.Eof Then
Response.Write "没有新闻!"
Else
%>
        <table width="720" border="0" cellpadding="2" cellspacing="1" class=tableBorder style="word-break:break-all">
          <tr class="title"> 
            <td width="36" height="25" align="center" background="admin/admin_bg_1.gif">选中</td>
            <td width="40"  height="25" align="center" background="admin/admin_bg_1.gif">ID</td>
            <td width="246" align="center" background="admin/admin_bg_1.gif">新闻标题</td>
            <td width="81" align="center" background="admin/admin_bg_1.gif">所属一级分类</td>
            <td width="76" align="center" background="admin/admin_bg_1.gif">所属二级分类</td>
            <td width="57" align="center" background="admin/admin_bg_1.gif">加入时间</td>
            <td width="68" align="center" background="admin/admin_bg_1.gif">操作</td>
          </tr>
<%Do While Not rs.Eof and a<rs.PageSize
If ID="" Then
ID = rs("News_ID")
Else
ID = ID & "," &rs("News_ID")& ","
End if
%>
          <tr> 
            <td width="36" height="22" align="center"> 
              <input name='ArticleID' type='checkbox' onclick="unselectall()" id="ArticleID" value='<%=cstr(rs("News_ID"))%>'>
            </td>
            <td width="40" align="center"><%=cstr(rs("News_ID"))%></td>
            <td><a href="../ShowNews.asp?id=<%=rs("News_ID")%>" target="_blank"><%=Left(rs("Titel"),20)%></a></td>
            <td><div align="center"><%=rs("News_BigClassName")%></div></td>
            <td><div align="center"><%=rs("News_SmallClassName")%></div></td>
            <td align="center"><%=rs("InfoTime")%></td>
            <td width="68" align="center"> <a href="News_NewsInfo.asp?id=<%=rs("News_ID")%>">修改</a> 
              <a href="News_EditNews.asp?id=<%=rs("News_ID")%>&del=one&action=delnews" onclick="return ConfirmDel();">删除</a> 
            </td>
          </tr>
<%a = a+1
rs.MoveNext
Loop
Response.Write "<input name='AllID' type='hidden' value=" &ID& ">"
End if
rs.Close
Set rs=Nothing
%>  

        </table>
        <table width="720" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有新闻</td>
            <td><input name="submit" type='submit' value='删除选定的新闻'>
            </td>
          </tr>
        </table>	
      </form>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0"><tr> 
          <td align="center">
      <%
Response.Write "共" & TotalPages & "页<b>"
beginpage=1
endpage=Totalpages
if TotalPages>=5 then
  if page>=3 then
    beginpage=page-2
    if page<=(TotalPages-2) then
      endpage=page+2
    else
      endpage=TotalPages
      beginpage=TotalPages-4
    end if
  else
    beginpage=1
    endpage=5
  end if
end if
if beginpage>1 then response.write"<a href='News_Manage.asp?page=1'>&lt&lt</a>"
for i=beginpage to endpage
  if i=page then
    response.write " "&i
  else
    response.write " [<a href='News_Manage.asp?page="&i&"'>"&i&"</a>]"
  end if
next
if endpage<TotalPages then response.write " <a href=News_Manage.asp?page="&TotalPages&">&gt&gt</a>"
%></td>
        </tr>
      </table> 
      <br> <table width="620" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          
        </tr>
      </table></td>
  </tr>
</table>
<%call CloseConn()%>
</body>
</html>