File size: 1.89Kb
<?php
require('includes/header.php');
require('includes/utils.php');
require('includes/db.php');
require('includes/auth.php');
$max_files = 5;
if(isset($_GET['from']))
$from = $_GET['from'];
else
$from = 0;
$to = $from + $max_files;
?>
<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="manager" title="Менеджер файлов">
<do type="options" name="main" label="Меню"><go href="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>"/></do>
<p>
<?php
$n = 0;
$files = '';
if ($handle = opendir("$login/"))
{
while (false !== ($file = readdir($handle)))
{
if($file != '.' && $file != '..' && $file != 'files')
{
$filesize = filesize("$login/$file");
if($n >= $from && $n < $to)
$files .= '<a href="pageview.php?id=' . $id . '&p=' . $login . '&page=' . $file . '">' . $file . '(' . $filesize . ' byte)</a><br/>';
$n++;
}
}
closedir($handle);
}
if($n > $to )
$files .= <<<FILEDATA
<a href="manager.php?id=$id&p=$login&from=$to">Далее</a>
<br/>
FILEDATA;
$back_from = $from - $max_files;
if($from > 0)
$files .= <<<FILEDATA
<a href="manager.php?id=$id&p=$login&from=$back_from">Назад</a>
<br/>
FILEDATA;
?>
Всего файлов:<?php echo $n; ?>
<br/>
<?php echo $files; ?>
</p>
<p align="center">
*********<br/>
<a href="edittitle.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>&page=index.wml&cp=go">Добавить страницу</a><br/>
<a href="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>">Меню</a><br/>
</p>
</card>
</wml>