<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[30]!=1)
  jump("jump.php?id=25&jump=main.php");
$phpcolor->table="upload";
if($_GET['action']=="del" && isset($_GET['id']) && isset($_GET['filename']))
{
  unlink('../upload/'.$_GET['filename']);
  $phpcolor->where="id = '".$_GET['id']."'";
  $phpcolor->delete();
  jump("jump.php?id=24&jump=upload.php");
}
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']*25).",25";
$file=$phpcolor->assignment();
$page=pages($count,25,$_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");
?>