<?php
require_once '../core/system.php';
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$get_id'"),0) == true) {
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$get_id'"));
if (!isset($_GET['confirm'])) {
header('Location: change_rank?id='.$player['id'].'');
$_SESSION['confirm'] = '<div class="center player">
Вы действительно хотите исключить этого игрока?</div>
<div class="mini-line"></div>
<div class="player menuList">
<li><a href="kick?id='.$player['id'].'&confirm=1"><img src="/images/icon/ok.png">Да</a></li>
<li><a href="change_rank?id='.$player['id'].'"><img src="/images/icon/error.png">Нет</a></li>
</div>';
exit();
}
}else{
header('Location: /');
exit();
}
if ($user['clan_prava'] < 3 || $user['clan_prava'] < $player['clan_prava'] || $user['clan_id'] != $player['clan_id']) {
header('Location: /user/'.$player['id'].'/');
exit();
}
if (isset($_GET['confirm']) == '1') {
if ($user['id'] != $player['id']) {
mysql_query("UPDATE `user` SET `clan_id` = '0' WHERE `id` = '$player[id]' LIMIT 1");
$text = '<img src="/images/icon/'.$user['storona'].'.png" /> <a href="/user/'.$user['id'].'/">'.$user['nick'].'</a> исключил игрока <img src = "/images/icon/'.$player['storona'].'.png" /> <a href="/user/'.$player['id'].'/">'.$player['nick'].'</a> из клана';
mysql_query("update `user` set `clan_jornal` =`clan_jornal` +1  where `id`<> '$user[id]' and `clan_id`= '".$user['clan_id']."'");
mysql_query("INSERT INTO `jr_rekrut` SET `clan_id` = '".$user['clan_id']."', `text` = '$text'");
$_SESSION['message'] = 'Игрок исключен';
}
header('Location: /user/'.$player['id'].'/');
exit();
}
?>