<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[30]!=1)
{
  Header("Location: jump.php?id=25&jump=main.php");
  exit();
}
$phpcolor->table=$core_mysql_prefix."upload";
if($_GET['action']=="del" && isset($_GET['id']) && isset($_GET['filename']))
{
  unlink('../upload/'.$_GET['filename']);
  $phpcolor->where="id = '".$_GET['id']."'";
  $phpcolor->delete();
  Header("Location: jump.php?id=24&jump=upload.php");
}
else
{
  if(!isset($_GET['page']))
    $_GET['page']=0;
  $phpcolor->field="*";
  $phpcolor->where="1=1";
  $count = $phpcolor->exist(2);
  $phpcolor->where="1=1 order by uptime desc limit ".($_GET['page']*20).",20";
  $file=$phpcolor->assignment();
  $page=pages($count,20,$_GET['page'],'upload','','','0');
  for($count=0;$count<count($file);$count++)
  {
    $file[$count]['filesize']=number_format($file[$count]['filesize']/1024,0)."KB";
  }
  $tpl -> assign("file", $file);
  $tpl -> assign("page", $page);
  $tpl -> display("upload.htm");
}
?>