<?php


echo "<div class='event'><h1>Доска позора</h1></div>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ban`"),0) or die(mysql_error());
$k_page=k_page($k_post,5);
$page=page($k_page);
$start=5*$page-5;
if (empty($k_post))
{
	 echo "<div class='feedback'>\n";
	 echo "Нарушители отсутствуют.\n";
	 echo "</div>\n";

	 
}	 
$q=mysql_query("SELECT * FROM `kolhoz_ban` ORDER BY `id` DESC  LIMIT $start, 5") or die(mysql_error());
while ($post = mysql_fetch_assoc($q))
{
$baninfo=mysql_query("SELECT * FROM `kolhoz_user` WHERE id = '".$post['id_user']."'") or die(mysql_error());
$ban = mysql_fetch_array($baninfo);
$baninfoadm=mysql_query("SELECT * FROM `kolhoz_user` WHERE id = '".$post['id_who']."'") or die(mysql_error());
$banadm = mysql_fetch_array($baninfoadm);
if($post['izg'] == "1"){$method="Изгнание";}
if($post['izg'] == "0"){$method="Обет молчания";}
echo "<div class='block'>\n";
echo "
<img src='img/icons/rules.png'> <span class='epic'>".$method."</span> до: <b>".vremja($post['time'])."</b><br/>
Нарушитель: <a href='/?user=".intval($ban['id'])."'>".hsc($ban['nick'])."</a><br />";
if ($banadm['pol']==1){echo "<img src='img/icons/on.png' width='16' height='16' alt='o'> <span class='title'>Забанил:</span> ";}
if ($banadm['pol']==0){echo "<img src='img/icons/ona.png' width='16' height='16' alt='o'> <span class='title'>Забанила:</span> ";} 
echo "<a href='/?user=".intval($banadm['id'])."'>".hsc($banadm['nick'])."</a><br />
Причина: ".output_text($post['msg'])."
";
echo "</div>\n";
}
echo "<div class='feedback'>";
if ($k_page>1)str("/?baned&",$k_page,$page); // Вывод страниц
echo "</div>";
include_once 'inc/foot.php';

?>