<?php
$all = Core::count("SELECT COUNT(*) FROM `user_sites` WHERE `id_user` = ?", array($user['id']));
if($all > 0){
	$Navig = new Navig($all);
	$start = $Navig -> start;
	$pages = 10;
	
	$q = Core::query("SELECT * FROM `user_sites` WHERE `id_user` = ? ORDER BY `host` DESC LIMIT $start, $pages", array($user['id']));
	while($post = $q -> fetch()){
		$cat = Core::query("SELECT `name` FROM `category` WHERE `id` = ?", array($post['category'])) -> fetch();
		echo '<div class="navig"><img src="http://www.google.com/s2/favicons?domain='.Protect::title($post['url']).'"> 
		<a target="_blank" href='.Protect::title($post['url']).'>'.Protect::title($post['title']).'</a> <a href="/stat/index/'.$post['id'].'"><img src="/style/images/s.png"></a><br />
                '.($post['mod'] == 1 ? '<font color="red">На модерации</font>' : 'Хосты: '.$post['host'].' | Хиты: '.$post['hit']).'<br />
		'.($post['ban'] == 1 ? '<font color="red">Заблокировано</font><br />' : NULL).'
		Описание: '.Protect::text(Protect::rez_text($post['opis'], 100)).'<br/>
		'.($post['prava']==1 ? '<a href=/cabinet/kod/'.$post['id'].'>Код счетчика</a>' : null).'
		</div>';
	}
	$Navig -> str('?');
}else{
	echo '<div class="navig">Площадки не найдены</div>';
}
?>
<div class="navig"><a href="/cabinet/creat_area"> <img src="/style/images/ups.png" alt="*" align="middle" />Добавить площадку</a></div>