<div class="event">
<h1><a href='/user/<? echo $ank['id'];?>'><? echo $ank['nick'];?></a> / Список нарушений</h1>
</div>
<div class="content">
<div class="block">
<ul>
<?
if(isset($_GET['unlock']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ban` WHERE `id` = '".intval($_GET['unlock'])."' AND `id_user` = '$ank[id]'"),0)!=0 && $ku['status']>0)
{
mysql_query("UPDATE `kolhoz_ban` SET `inlock`='$ku[id]' WHERE `id_user` = '$ank[id]' AND `id` = '".intval($_GET['unlock'])."'") or die(mysql_error());
$_SESSION['msg'] = 'Игрок успешно разблокирован';
header("Location:/user-$ank[id]/bans");
}
if(isset($_GET['delete']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ban` WHERE `id` = '".intval($_GET['delete'])."' AND `id_user` = '$ank[id]'"),0)!=0 && ($ku['status']==3 || $ku['status']==1))
{
mysql_query("DELETE FROM `kolhoz_ban` WHERE `id_user` = '$ank[id]' AND `id` = '".intval($_GET['delete'])."'");
}
$num=0;
$q=mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$ank[id]' ORDER by `id` ASC");
while($post=mysql_fetch_array($q))
{
$num++;
$us_ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$post[id_who]'"));
if($post['izg']==1)$vidban='Изгнание ('.($post['time']>0?'до '.vremja($post['time']).'':'Навсегда').')';
elseif($post['izg']==0)$vidban='Обет Молчания <span class="minor">до '.vremja($post['time']).'</span>';
elseif($post['izg']==2)$vidban='Бан в чате <span class="minor">до '.vremja($post['time']).'</span>';
elseif($post['izg']==3)$vidban='Бан на форуме <span class="minor">до '.vremja($post['time']).'</span>';
if(isset($post['inlock'])){$us_loc=mysql_fetch_array(mysql_query("SELECT `pol`,`id` FROM `kolhoz_user` WHERE `id` = '$post[inlock]'"));}
echo "<li><span class='minor'><span>$num</span>.</span><span> <span>$vidban</span>, выдал".($us_ban['pol']==0?'a':null)." <span>";
echo on_k($us_ban['id']);
echo "<a href='/user/$us_ban[id]'>".nc($us_ban['id'])."</a></span><span>, (".output_text($post['msg']).")</span>".(isset($post['inlock'])?" разблокировал".($us_loc['pol']==0?'a':null)." ".(on_k($us_loc['id']))." <a href='/user/$us_ban[id]'>".nc($us_loc['id'])."</a>":"".($ku['status']>0 && $post['time']>$time?" <a href='/user-$ank[id]/unlock-$post[id]/bans'>[разблокировать]</a>":null)."".($ku['status']==3?" <a href='/user-$ank[id]/delete-$post[id]/bans'>[удалить]</a>":null)."")."</li>";
}
echo '</ul>';
if($ku['status']>0 && $ku['id']!=$ank['id'] && $ank['id']!==1){echo "<div class='pt'><div><a class='epic' href='/user-$ank[id]/ban'>Выдать Обет молчания</a></div>";
echo "<div><a class='epic' href='/user-$ank[id]/izg'>Выдать Изгнание</a></div>";
}
include_once 'inc/foot.php';
?>