<?php 
require('../flowap/system.php');
switch($act) {
    default: 
    	$ids = functions::htmlred($_GET['url']); 
    	$blog = DB::$dbs->queryFetch('SELECT * FROM `razd` WHERE `urlt` = ? LIMIT 1', [$ids]);
	    if(empty($blog['id'])):
	        $_SESSION['err'] = 'Такого раздела не существует.';
	        header('location: /'); exit;
	    endif;
    	$title->SetTitle('Раздел - '.$blog['name']);
    	$title->GetHeader();
    	$sql = DB::$dbs->query("SELECT `name`,`urlt`,`time`,`message`,`idus`,`id`,`status` FROM `blog` WHERE `razdel` = ? ORDER BY `time` DESC LIMIT 10",[$blog['id']])->fetchAll(PDO::FETCH_BOTH);
        foreach ($sql as $blog): ?>
        	<div class="flowap3 flowap3d">
				<div class="fontniz">
					<div class="fontniz2" style="font-weight: 700;" title="кто написал">
						<?php echo functions::usvv($blog['idus']);?>
					</div>
					<time class="fontniz2" style="float: right;" title="время блога">
						<i class="far fa-clock"></i> <?php echo functions::vremja($blog['time']);?>
					</time>
				</div>
				<a title="прочитать полностью" href="/blog/<?php echo $blog['urlt'];?>" class="flowap5">
					<div class="bogess">
						<h1 class="clls"><?php echo $blog['name'];?></h1>
						<?php echo mb_substr(bbcode::notags($blog['message']), 0, 350, 'UTF-8');?>... 
						<div>
							<?php echo $nums1[$blog['status']];?>
						</div>
					</div>	
				</a>	
			</div>
    	<?php endforeach;
    	$title->GetFooter();
	break;
}
?>