Файл: Arhmobi_esdcms/faq/index.php
Строк: 26
<?php
include_once '../sys/inc/start.php';
$doc = new document();
$doc->title = __('FAQ');
$listing = new listing();
$post = $listing->post();
$post->title = 'Вопрос/Ответ - Категории';
$post->icon('faq');
$listing->display();
$pages = new pages($db->query("SELECT COUNT(*) FROM `faq_cat`")->fetchColumn());
$pages->this_page();
$q = $db->query("SELECT * FROM `faq_cat` ORDER BY `position` ASC LIMIT $pages->limit");
$listing = new listing();
while ($category = $q->fetch()) {
$post = $listing->post();
$post->url = "cat.php?id=$category[id]";
$post->title = '<b>'.text::toOutput($category['name']).'</b>';
$post->icon('c.faq');
$res = $db->query("SELECT COUNT(*) FROM `faq` WHERE `id_cat` = '$category[id]'");
$sh = $res->fetchColumn();
$post->counter = $sh;
$post->post = text::toOutput($category['description']);
}
$listing->display(__('Доступных Вам категорий нет'));
$pages->display('?'); // вывод страниц
if ($user->group >= 4) {
$doc->act(__('Создать категорию'), 'category.new.php');
}
?>