<?
only_reg();
$ID = (isset($_GET['id']) ? (int) $_GET['id'] : 0);
$ank = user::get_user($ID);

if (!$ank['id'] || $ID == 0 || $user['id'] == $ID) {
	header('Location: ?func=list');
	exit;
}

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_black` WHERE `id_user` = '$ID' AND `id_black` = '$user[id]'"),0) == 0) {
	$_SESSION['message'] = __('Пользователь не находится в вашем черном списке');
	header('Location: ?func=add&id=' . $ID);
	exit;
}

$black = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_black` WHERE `id_user` = '$ID' AND `id_black` = '$user[id]' LIMIT 1"));

$_SESSION['sid'] = mt_rand(000, 999);
$set['title'] = __('Чёрный список/Бан/' . $ank['nick']);
include_once H . 'sys/inc/thead.php';
title();
aut(); 
err();

?>
<div class="foot"><b><?= __('Бан')?></b></div>

<div class="nav2"><?= __('Забанил')?>: <?= $ank['icon']?> <?= $ank['link']?></div>

<div class="nav2">
<?= __('Нарушение')?>: <?= text($black['msg'])?><br />
</div>

<div class="nav2">
<?= __('Разделы')?>: <br />
<?
$array = explode(';', $black['razdel']);

foreach($array AS $name){
	if ($name){
		$num++;
		echo $num . ') ' . $array_name[$name] . '<br />';
	}
}
?>
</div>

<div class="nav2">
<?= __('Забанен')?>: <?= ($black['time'] == 0 ? __('навсегда') : __('до') . ' ' . vremja($black['time']))?> (<?= ($black['time'] > time() || $black['time'] == 0 ? 
	'<span style="color: green;">Активен</span>' : '<span style="color: red;">Время истекло</span>')?>)
</div>

<div class="foot"><b><?= __('Бан')?></b></div>