<?php require_once("admin_public.php");
cleardate_list();

?>
<div class="admin_bread">当前位置：文件清理</div>
<div class="admin_right">
  <div class="admin_main">
   <form action="clear.php" method="get" class="clearfile_form"><input type="text" name="limitdate" value="" class="limitdate" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"  onkeyup="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');" /><input type="submit" value="搜索" name="datesubmit"  class="datesubmit"/><span>(注：在右侧框中输入需要清理的天数，此天数为最后下载时间距现在的天数)</span></form>
    <form action="result.php" method="post" name="files_form" class="admin_info_form files_form" onsubmit="return check_delbtn(select);">
      <div class="admin_info" id="info_a">
        <h4 class="h1">文件清理</h4>
        <div class="admin_table">
          <table width="100%">
            <thead>
              <tr>
                <td style="width:4%;"><input type="checkbox" name="chkAll" id="chkAll" onclick="return CheckAll(this.form)" title="全选" /></td>
                <td style="width:12%;">文件ID</td>
                <td style="width:28%;">文件名</td>
                <td style="width:8%;color:#F00;">距当前</td>
                <td style="width:7%;">文件MIME</td>
                <td style="width:7%;">文件字节</td>
                <td style="width:12%;">上传时间</td>
                <td style="width:12%;">最后下载</td>
                <td style="width:8%;">下载次数</td>
              </tr>
            </thead>

            <?php 			
			$result=cleardate_list();
			while($files=mysql_fetch_array($result))
			{
			?>
            <tr>
              <td><input type="checkbox" name="select[]" class="checkbox" value="<?php echo $files['id'];?>" /></td>
              <td><?php echo $files['id'];?></td>
              <td><a href="file_view.php?id=<?php echo $files['id'];?>" title="<?php echo $files['name'];?>"><?php echo $files['name'];?></a></td>
              <td style="color:#F00;"><?php echo intval((time()-$files['dt'])/3600/24);?>天</td>
              <td><?php echo $files['type'];?></td>
              <td><?php echo size_info($files['size']);?></td>
              <td><?php echo date('Y.m.d H:s',$files['up']);?></td>
              <td><?php echo date('Y.m.d H:s',$files['dt']);?></td>
              <td><?php echo $files['down'];?>次</td>
            </tr>
            <?php
			}
			?>
          </table>
        </div>
      </div>
      <div class="page_box">
      <input type="submit" value="删除所选" name="files_del" class="submit_del" onclick="return window.confirm(' 确定删除全部所选吗？');"/>
     <?php echo clearpages("clear.php",'id');?>
    </div>
    </form >
  </div>
</div>
<?php require_once("admin_footer.php");?>