Файл: hostbiter.ru/Modules/page/wiki.php
Строк: 6
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
$title = 'Раздел информации';
require ($_SERVER['DOCUMENT_ROOT'].'/Core/myhead.php');
switch($_GET['list']){
default:
$max = 10;
$wikis = $db->prepare("SELECT * FROM `wiki`");
$wikis->execute();
$k_post = $wikis->rowCount();
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$all = $db->prepare("SELECT * FROM `wiki` ORDER BY `id` ASC LIMIT $start,$max");
$all -> execute();
$all = $all -> fetchAll();
foreach($all as $row){
?>
<div id="border" class="border2"><a href="wiki.php?list=wiki&id=<?=$row['id']?>"><img src="/image/forward.png" alt="" /> <?=$row['name']?></a></div>
<?
}
if($k_page >1){
echo str('?',$k_page,$page);
}
break;
case 'wiki':
$id = abs(intval($_GET['id']));
$wiki = $db->prepare("SELECT * FROM `wiki` WHERE `id` = ? ");
$wiki->execute([$id]);
$wiki = $wiki->fetch();
?>
<FIELDSET>
<LEGEND><b> <?=$wiki['name']?> </b></LEGEND><br />
<?=$wiki['text']?>
</FIELDSET>
<div><img src="/image/back.gif" alt="" /> <a href="/page/wiki.php">Назад</a></div>
<?
break;
}
require ($_SERVER['DOCUMENT_ROOT'].'/Core/myfoot.php');
?>