Файл: zc/kat.php
Строк: 30
<?
include '../system/sys.php';
include '../system/funcs.php';
if(!$cms->us['id']){
header('location:/');
exit;
}
$kat = DB::$dbs->queryFetch("SELECT * from `zc_kat` where `id` = ? limit 1",array($func->num($_GET['id'])));
if(!$kat['id']){
header('location:/zc');
exit;
}
verh($kat['name'],'<a href="/zc" style="color:#ffffff;">ЗЦ</a> / '.$kat['name'].' / Подкатегории');
echo '<div class="ram">';
if(DB::$dbs->querySingle("SELECT count(`id`) from `zc_podkat` where `kat`=?",array($kat['id']))==0){
echo '<div class="raz">Подкатегорий нет!</div>';
}else{
$pks=DB::$dbs->query('select * from `zc_podkat` where `kat`=?',array($kat['id']));
while($pk=$pks->fetch()){
$newf=DB::$dbs->querySingle('select count(`id`) from `zc_file` where `podkat`=? and `access`="1" and `time`>?',array($pk['id'],time()-86400));
echo '<div class="raz"><img src="/images/unknown.png" alt="*"/> <a href="/zc/pk'.$pk['id'].'">'.$pk['name'].'</a> ('.DB::$dbs->querySingle('select count(`id`) from `zc_file` where `podkat`=? and `access` = "1"',array($pk['id'])).($newf>0?'/<font color="red"><b>+'.$newf.'</b></font>':NULL).')</div>';
}
}
echo '</div>';
niz();
?>