<?
if (count($news) == 0) {
	?>
	<div class="msg error">
		Доступных новостей нету
	</div>
	<?
	} else {
	?>
		<div class= "container-fluid">
		<div class="mainpost">Свежие новости</div><br/><br/>
		<div class= "row d-inline-flex">
	<?
	$z = 2;
	foreach($news AS $p) {
		$z = ($z % 2 ? 1 : 2);
		?>
			<div class ="col-12 col-sm-4 col-md-20 p-2">
				<a href="/news/view/<?=$p['link']?>/">
				   <div class="card h-100">
					  <img class="card-img-top" style="" src="/files/news-images/mid/<?=$p['img']?>.jpg"/>
					  <h4 class="card-title text-center" style="height: 85px;margin:7px;"><br/><?=$p['title']?></h4>
				   </div>	
				</a>
			</div>
		<?	
		$z++;
	}
	?> </div> </div><?
}

if ($page['count'] > $page['count_max']) {
	echo '<div class="page-nav-fon">'. $page['display'] .'</div>';
}
