Файл: hostbiter.ru/Modules/page/news.php
Строк: 10
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
$title = 'Новости хостинга';
require ($_SERVER['DOCUMENT_ROOT'].'/Core/myhead.php');
$news = $db->prepare("SELECT * FROM `news`");
$news->execute();
$newsc = $news->rowCount();
$max = 10;
$k_post = $newsc;
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$all = $db->prepare("SELECT * FROM `news` ORDER BY `time` DESC LIMIT $start,$max");
$all -> execute([$user['id']]);
$all = $all -> fetchAll();
if($k_post > 0){
foreach($all as $row){
?>
<div id="border"><div class="tag"><?=$row['name']?> <small> <?=date("d.m.Y/H:i",$row['time'])?></small>
</div><br/>
<?=$row['text']?>
</div>
<?
}
if($k_page >1){
echo str('?',$k_page,$page);
}
}else{
echo '<div id="border" class="border2">Нет сообщений!</div>';
}
require ($_SERVER['DOCUMENT_ROOT'].'/Core/myfoot.php');
?>