Файл: 4mast/profmas.ru/downloads/kats.php
Строк: 31
<?
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
$query = DB :: $dbs -> query ("SELECT * FROM `down_kats` WHERE (`id`=?)",array ((int) $_GET['id']));
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$kats = $query -> fetch ();
H ($kats['name'], '<a href="/downloads" style="color:white;">Обменник</a> / ' . $kats['name'] . ' / Подкатегории');
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_pods` WHERE (`id_kats`='" . $kats['id'] . "')") == 0) {
echo '<div class="error">Подразделов нет!</div>';
}
else {
$query = DB :: $dbs -> query ("SELECT * FROM `down_pods` WHERE (`id_kats`='" . $kats['id'] . "')");
while ($pods = $query -> fetch ()) {
$c_f = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_files` WHERE (`id_kats`='" . $kats['id'] . "') AND (`id_pods`='" . $pods['id'] . "') AND (`dop`='da')");
$n_f = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_files` WHERE (`id_kats`='" . $kats['id'] . "') AND (`id_pods`='" . $pods['id'] . "') AND (`dop`='da') AND (`time`>'" . (time () - 86400) . "')");
echo '<a href="/downloads/pods' . $pods['id'] . '" class="block"><img src="/images/unknown.png" alt=""/>' . $pods['name'] . ' (' . $c_f . ($n_f != 0 ? '/<b style="color:red;">+' . $n_f . '</b>' : '') . ')</div></a>';
}
}
echo '</div>';
require_once('../includes/Footers.php');
?>