File size: 880B
<?php
include_once('./system/config.php');
$sys['title'] = 'Все категории';
include_once('./system/head.php');
$c_cat = mysql_result(mysql_query("SELECT COUNT(*) FROM `cat` "), 0);
echo '<div class="title">Все категории:</div>';
nav_start($c_cat, 10);
if ($c_cat != 0) {
$sql_cat = mysql_query("SELECT * FROM `cat` ORDER BY `id` DESC LIMIT $start, 10");
while ($cat = mysql_fetch_assoc($sql_cat)) {
$notes = mysql_result(mysql_query("SELECT COUNT(*) FROM `note` WHERE `id_cat` = '".$cat['id']."' "), 0);
echo '<div class="content"><a href="http://'.txt($_SERVER['HTTP_HOST']).'/category-'.$cat['id'].'.xhtml">'.$cat['title'].'</a> ['.$notes.']</div>';
}
} else { echo '<div class="error">Категорий нет !</div>'; }
view_nav('http://'.txt($_SERVER['HTTP_HOST']).'/all_category.xhtml/');
include_once('./system/foot.php');
?>