Файл: 4mast/profmas.ru/downloads/new_files.php
Строк: 21
<?
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
H ('Новые файлы', 'Новые файлы');
$items = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_files` WHERE (`time`>'" . (time () - 86400) . "') AND (`dop`='da')");
$items_per_page = 10;
$pages = ceil ( $items / $items_per_page );
if ($page < 1) {
$page = 1;
}
if ($page > $pages) {
$page = $pages;
}
$start = $page * $items_per_page - $items_per_page;
if ($items != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `down_files` WHERE (`time`>'" . (time () - 86400) . "') AND (`dop`='da')");
while ($f = $query -> fetch ()) {
$kats = DB :: $dbs -> queryFetch ("SELECT * FROM `down_kats` WHERE (`id`='" . $f['id_kats'] . "')");
$pods = DB :: $dbs -> queryFetch ("SELECT * FROM `down_pods` WHERE (`id`='" . $f['id_pods'] . "')");
echo '<div class="lst">';
echo 'Файл: <a href="/downloads/file' . $f['id'] . '">' . $f['name'] . '</a> (' . datef ($f['time']) . ')<br/>';
echo 'Категория: <a href="/downloads/kats' . $kats['id'] . '">' . $kats['name'] . '</a> / <a href="/downloads/pods' . $pods['id'] . '">' . $pods['name'] . '</a>';
echo '</div>';
}
echo '' . page ('/downloads/new') . '';
}
else {
echo '<div class="error">Новых файлов нет!</div>';
}
require_once('../includes/Footers.php');
?>