<!--#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">
        <tr class="title"> 
          <td height="25" bgcolor="#eeeeee">
<%Set big = Conn.Execute("Select * From [BigClassDown]")
If big.Eof Then
Response.Write "没有分类!"
Else
Do While Not big.Eof 
Response.Write "<a href='Down_Manage.asp?tit=" &big("DownType")& "'>" &big("DownType")& "</a> | "
big.MoveNext
Loop
End if
%></td>
        </tr>
      </table>
<%
page=request.querystring("page")
PageSize = 15
SqlStr = "Select * From [DownLoad] "
If Request.QueryString("tit")="" Then
SqlStr = SqlStr & " Order by ID Desc"
Else
SqlStr = SqlStr & " Where [DownType]='"&Request.QueryString("tit")&"' Order by 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="Down_Edit.asp?id=<%=rs("ID")%>&action=deldown" 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>
          <tr class="title"> 
            <td width="41" height="25" align="center" background="admin/admin_bg_1.gif">选中</td>
            <td width="45"  height="25" align="center" background="admin/admin_bg_1.gif">ID</td>
            <td width="276" align="center" background="admin/admin_bg_1.gif">下载名称</td>
            <td width="91" align="center" background="admin/admin_bg_1.gif">所属分类</td>
            <td width="59" align="center" background="admin/admin_bg_1.gif">文件大小</td>
            <td width="90" align="center" background="admin/admin_bg_1.gif">加入时间</td>
            <td width="80" align="center" background="admin/admin_bg_1.gif">操作</td>
          </tr>
<%Do While Not rs.Eof and a<rs.PageSize
If ID="" Then
ID = rs("ID")
Else
ID = ID & "," &rs("ID")& ","
End if
%>
          <tr> 
            <td width="41" height="22" align="center"> 
              <input name='ArticleID' type='checkbox' onclick="unselectall()" id="ArticleID" value='<%=cstr(rs("ID"))%>'>
            </td>
            <td width="45" align="center"><%=cstr(rs("ID"))%></td>
            <td><a href="../ShowDown.asp?id=<%=rs("ID")%>" target="_blank"><%=Left(rs("Titel"),20)%></a></td>
            <td><div align="center"><%=rs("DownType")%></div></td>
            <td><div align="center"><%=rs("DownSize")%></div></td>
            <td align="center"><%=rs("InfoTime")%></td>
            <td width="80" align="center"> <a href="Down_Update.asp?id=<%=rs("ID")%>">修改</a> 
              <a href="Down_Edit.asp?id=<%=rs("ID")%>&del=one&action=deldown" 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='Down_Manage.asp?page="&i&"'>"&i&"</a>]"
  end if
next
if endpage<TotalPages then response.write " <a href=Dwon_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>