<?php
require_once ('system/func.php');
auth(); // Закроем от не авторизованных
$title = 'Настройки клана';
require_once ('system/header.php');

$id = abs(intval($_GET['id']));
if($id)$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$id."'"));
else $clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$user[id_clan]."'"));

if($user[id_clan] == $clan[id]){
echo '<div class="ribbon mb2"><div class="rl"><div class="rr">
			Настройки клана		</div></div></div>
<div class="hr_g mb2"><div><div></div></div></div>';

if($user['id_clan'] == $clan['id'] and $user['clan_rang'] >= 4)echo "<div class='main_link'><div class='ssilki_dop p_0'><img src='/images/icons/settings.png' width ='28px'> Изменить описание</div></div></a>";
if($user['id_clan'] == $clan['id'] and $user['clan_rang'] >= 4)echo "<div class='main_link'><div class='ssilki_dop p_0'><img src='/images/icons/settings.png' width ='28px'> Обьявление</div></div></a>";
echo "<a href='/clan/?my_delete'><div class='main_link'><div class='ssilki_dop p_0'><img src='/images/icons/settings.png' width ='28px'> Покинуть клан</div></div></a>";
echo '<div class="hr_g mb2"><div><div></div></div></div>';
}else{
header('Location: http://legepoh.ru/clans/');
exit;
}
require_once ('system/footer.php');
?>