<?
include '../config.php';
include '../func.php';

head();
$error = '';
if($error){ echo $error;
}else{
////////////////////////////////////////
echo "<div class=\"head\"><b>Статусы</b></div><div class=\"main\">"; 

$file=file('status.txt');
$id = num($_GET['id']);

$all = mysql_result(mysql_query("SELECT count(*) FROM `status_base` WHERE `id_razd` = '".$id."'"), 0);
if($all==0){
    echo 'Статусов нет<br/>';
}else{
if($all){
$onpage = 10;
$allpage = ceil($all/$onpage);
$this_page = (isset($_GET['p'])) ? intval($_GET['p']) : 1 ;
if($this_page < 1 || $this_page > $allpage)$this_page = 1;
$start = $this_page*$onpage - $onpage;
$result=mysql_query("SELECT * FROM `status_base` WHERE `id_razd`='".num($_GET['id'])."' AND `checked`='1' limit ".$start.",".$onpage."");
while($arr=mysql_fetch_array($result))
{
	$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$arr['name']."'"));
    
	echo '<b>'.$user['login'].'</b>';
	if(!empty($arr['icq'])) echo ' (<b>'.$arr['icq'].'</b>)';
    echo '<br/><b>'.$arr['date'].'</b><br />';
	echo nl2br($arr['text']);
    
    if($level_session>=3){
	echo '<br><a href="../panel.php?act=icq_status_red&id='.$arr['id'].'">[Изм]</a><a href="../panel.php?act=icq_status_delete&id='.$arr['id'].'">[Уд]</a>';
	
    }
echo '<hr>';
}
echo '<div class="input"><b>Страницы:</b> ';
navigation($allpage,"watch.php?id=".$id."&p={p}",1,1);
}
echo '</div>';
}




//////////////////////////////////////
}
pod_navig();
foot();
?>