Файл: 4mast/profmas.ru/adm/fort.php
Строк: 21
<?php
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
if (!isset ($us)) {
header ('location: /');
exit;
}
if ($us['level']<1) {
header ('location:/');
exit;
}
H ('Админ форум', 'Админ форум');
$db = DB::$dbs;
echo '<div class="menu2">Активные темы (' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `adm_fort`") . ')</div>';
$query=DB::$dbs->query('SELECT `id`, `name` FROM `adm_fort` ORDER BY `id` DESC LIMIT 10');
while ($row = $query->fetch(PDO::FETCH_LAZY))
{
?><a href="/adm/forts.php?id=<?=$row -> id;?>" class="block"><img src="/images/the.png" alt=""/> <?=$row -> name?> (<?=$db->query('SELECT `id` FROM `adm_post` WHERE `ref` = "'.$row->id.'"')->rowCount();?>)</a> </div><?php
}
echo '</div>';
echo '<div class="menu2"> Список категорий</a></div>';
$phq = 'SELECT `id` FROM `adm_razd`';
if ($db->query($phq)->rowCount() == 0)
{
?><div class="error">Разделов нет</div><?php
}
else
{
$phq = 'SELECT * FROM `adm_razd` ORDER BY `id` DESC';
$query = $db -> query($phq);
while ($row = $query -> fetch(PDO::FETCH_LAZY))
{
?><div class="block"><img src="/images/p2.png" class="ico" alt="*"/>
<a href="/adm/fortr.php?id=<?=$row -> id;?>"><?=$row -> name?> </a>(<?=$db->query('SELECT `id` FROM `adm_fort` WHERE `ref` = "'.$row->id.'"')->rowCount();?>)
</div><?php
}
}
require_once('../includes/Footers.php');
?>