Файл: help/faq.php
Строк: 27
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
if ($id) {
$type = $db -> query("SELECT `id` FROM `faq`");
if ($type -> num_rows > 0) $the = $type -> fetch_assoc(); else $the = false;
} else $the = false;
$diz -> head('ЧЗВ (FAQ)');
$diz -> title('ЧЗВ (FAQ)');
$count = $db -> dbcount('COUNT(`id`)','faq');
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$posts = $db -> query("SELECT `id` FROM `faq`");
if ($posts -> num_rows > 0) {
$for = $db -> query("SELECT * FROM `faq` ORDER BY `sid` DESC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
echo '<div class="fon"><a href="faq'.$assoc['id'].'">'.$assoc['name'].'</a></div>';
}
}else echo '<div class="fon">Инфо-ии пока нет!</div>';
$act = './?id='.$id;
echo ''.$func -> pagenav($act,$page,$total).'';
echo '<div class="levo"><a href="./" class="levo_tuch">'.$diz -> img('back.png').' Назад</a></div>';
echo '<div class="levo"><a href="/" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
} else header('location: '.ROOT.'aut.php');
?>