Файл: 4mast/profmas.ru/downloads/pods.php
Строк: 27
<?
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
$query = DB :: $dbs -> query ("SELECT * FROM `down_pods` WHERE (`id`=?)", array ((int) $_GET['id']));
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$pods = $query -> fetch ();
$kats = DB :: $dbs -> queryFetch ("SELECT * FROM `down_kats` WHERE (`id`='" . $pods['id_kats'] . "')");
H ($pods['name'], '<a href="/downloads" style="color:white;">Обменник</a> / <a href="/downloads/kats' . $kats['id'] . '" style="color:white;">' . $kats['name'] . '</a> / ' . $pods['name']);
$items = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_files` WHERE (`id_kats`='" . $kats['id'] . "') AND (`id_pods`='" . $pods['id'] . "') 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 (`id_kats`='" . $kats['id'] . "') AND (`id_pods`='" . $pods['id'] . "') AND (`dop`='da') ORDER BY `id` DESC LIMIT $start, $items_per_page");
while ($f = $query -> fetch ()) {
echo '<div class="block">' . fname ($f['id']) . ' (' . sizef ($f['size']) . ') ' . ($f['time'] > (time () - 86400) ? ' <b style="color:red;">[new]</b>' : '') . '</div>';
}
if ($pages > 1) {
page('/downloads/pods' . $pods['id']);
}
}
else {
echo '<div class="error">Здесь файлов нет!</div>';
}
echo '</div>';
if($us == true) { echo '<a href="/downloads/down.php?pr=' . $pods['id'] . '" class="block"><img src="/images/ark.png" alt="*"/> Выгрузить файл</a></div>'; }
require_once('../includes/Footers.php');
?>