File size: 7.59Kb
<?php
require_once '../core/system.php';
echo only_reg();
echo ban();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(id) FROM `clan` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '".intval($_GET['id'])."'"));
} else {
$_SESSION['err'] = "Клан не найден";
header('Location: /');
exit();
}
$header = $clan['name'];
require_once H.'core/head.php';
$igrone = mysql_num_rows(mysql_query("SELECT `plem` FROM `user` WHERE `clan` = '".$id."' and `online` > '".($tm-10800)."' "));
if($user['prava'] > 3){
$req = mysql_query("SELECT `desk`,`desk_kto` FROM `clan` WHERE `id` = '".$clan['id']."'");
$desk = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
$kkto = mysql_fetch_array(mysql_query("SELECT `id`,`prava`,`nick`,`font` FROM `user` WHERE `id` = '".$desk['desk_kto']."'"));
if($avto > 0){
if($kkto['prava'] == 5){
$status="<font color='ffc22b'>[A]</font>";
}
if($kkto['prava'] == 4){
$status="<font color='ffc22b'>[a]</font>";
}
if($kkto['prava'] == 3){
$status="<font color='ffc22b'>[M]</font>";
}
if($kkto['prava'] == 2){
$status="<font color='ffc22b'>[m]</font>";
}
echo'</div><div class="foot center">
<div class="ob"><font size="2">
<font color="DADBDC">Объявление от</font>
<a href="/user/'.$kkto['id'].'/">';
echo online($kkto['id']);
echo'<font color="'.$kkto['font'].'">'.$kkto['nick'].'</font>';
if($kkto['prava'] > 1){
echo $status ;
}
echo'</a> </font> </br> '.smiles($desk['desk']).'</div></div></div>
<hr>';
}
}
if(isset($_GET['exit'])) {
if($user['clan']!=$clan['id']){
$_SESSION['err'] = "Ошибка";
header('Location: /clan/'.abs(intval($_GET['id'])).'/');
exit();
}
if($user['dolz']=='основатель' and $igroki>1){
$_SESSION['err'] = "В клане остались игроки";
header('Location: /clan/'.abs(intval($_GET['id'])).'/');
exit();
}
echo'</div>
<div class="foot center">
<table class="d-grey" width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 5px;">
<tbody>
<tr>
<div class="inpc-ar">
<div class="empty2"></div>
Вы уверены, что хотите покинуть клан '.$clan['name'].'?</div>
<div class="empty2"></div>
<td width="40%"><a class="big-but" href="?yes">
<div class="imgwrap"><img src="/images/icon/ok.png"></div>Покинуть клан</a></td>
<td width="40%"><a class="big-but" href="?id='.abs(intval($_GET['id'])).'">
<div class="imgwrap"><img src="/images/icon/error.png"></div>Отмена</a></td>
</tbody></table>
</div></div>
</div>';
require_once H.'core/foot.php';
exit;
}
if(isset($_GET['yes'])){
if($user['clan']!=$clan['id']){
$_SESSION['err'] = "Ошибка";
header('Location: /clan/'.abs(intval($_GET['id'])).'/');
exit();
}
if($user['dolz']=='основатель' and $igroki > 1){
$_SESSION['err'] = "В клане остались игроки";
header('Location: /clan/'.abs(intval($_GET['id'])).'/');
exit();
}
$t = time();
mysql_query("DELETE FROM `bonus` WHERE `usr` = ".$user['id']." and `name` = 'Алтарь клана'");
mysql_query("UPDATE `clan` SET `kol` = `kol`-1 where `id`='$clan[id]'");
mysql_query("INSERT INTO `zur` set `kto` = ".$user['id'].", `name` = 'покинул клан', `time` = '".$t."', `clan`='$user[clan]'");
mysql_query("UPDATE `user` SET `clan`='', `dolz`='', `rukzak`=`rukzak`-$clan[storage_bon], `rating`='' WHERE `id` = '$user[id]'");
$_SESSION['message']='Вы покинули клан';
header('Location: /');
}
mysql_query("UPDATE `user` set `mesto` = 'Клан' where `id` = '".$user['id']."'");
echo"<div class='foot'><a href='/forum/post/topic/990/?page=end'>Рейтинг</a>: <img src='/images/icon/rating_".$clan['plem'].".png'>".$clan['rating']."";
$go = floor($clan['gold']/100);
$gold = $clan['gold'];
$b = mb_strlen($gold);
$s = $gold[$b-2].$gold[$b-1];
if($user['clan']==$clan['id'] or $user['prava']>=4){echo"<span class='float-right'><a href='/clan/kazna?id=".$clan['id']."'>Казна</a>: <img src='/images/icon/gold.png'>".$go." <img src='/images/icon/silver.png'>".$s."</span>";
}
echo"</div></div><hr>
<div class='foot'>
<a class='mini-fight' href='/clan/achievements?id=".$clan['id']."'><img src='/images/icon/exp.png'> Достижения</a>
</div>
<table class='foot' width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";
if($user['clan']==$clan['id'] or $user['prava'] > 3){
echo"
<td width='49%'><a class='big-but' href='/clan_forum/?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/forum_".$clan['plem'].".png'></div>Форум клана</a></td>
<td width='49%'><a class='big-but' href='/clan/chat?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/chat_".$clan['plem'].".png'></div>Чат клана</a></td></tr>
<td width='49%'><a class='big-but' href='/clan/zur?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/zur_".$clan['plem'].".png'></div>Журнал клана</a></td>
<td width='49%'><a class='big-but' href='/clan/build?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/build_".$clan['plem'].".png'></div>Постройки клана</a></td></tbody></table>";
echo'<hr>
<div class="foot">
<a class="mini-fight" href="/clan/offensive?id='.$clan['id'].'"><img src="/images/icon/stat/sila.png"> Наступления</a>
</div>';
} else {
echo"<td width='49%'><a class='big-but' href='/clan_forum/?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/forum_".$clan['plem'].".png'></div>Форум клана</a></td>
<td width='49%'><a class='big-but' href='/clan/build?id=".$clan['id']."'><div class='imgwrap'><img src='/images/icon/build_".$clan['plem'].".png'></div>Постройки клана</a></td></tbody></table>";
}
echo"<hr>
<div class='d-grey center'>
<div class='empty2'></div>Состав клана (".$igrone."/".$clan['kol']."/".$clan['max_kol'].") </div>";
$k_post = $clan['kol'];
$k_page = k_page($k_post, 10);
$page = page($k_page);
$start = 10*$page-10;
$q = mysql_query("SELECT `id`, `nick`, `plem`, `prava`, `font`, `level`, `rating`, `mesto`, `dolz` FROM `user` WHERE `clan`='".intval($_GET['id'])."' ORDER BY `online` DESC LIMIT $start, 10");
echo "<div class='d-List'><div class='d-grey'>";
while($post = mysql_fetch_array($q)) {
if($post['prava'] == 5){$status="<font color='ffc22b'>[A]</font>";$color="#F7990D";}
if($post['prava'] == 4){$status="<font color='ffc22b'>[a]</font>";$color="EBC621";}
if($post['prava'] == 3){$status="<font color='ffc22b'>[M]</font>";}
if($post['prava'] == 2){$status="<font color='ffc22b'>[m]</font>";}
echo '<a href="/user/'.$post['id'].'/">';
echo"<div class='empty'></div>";
echo online($post['id']);
echo' <font color="'.$post['font'].'">'.$post['nick'].'</font> ';
if($post['prava'] > 1){
echo $status;
}
echo', <img src="/images/icon/level.png">'.$post['level'].', <img src="/images/icon/rating_'.$clan['plem'].'.png">'.$post['rating'].', '.$post['dolz'].' ('.$post['mesto'].') </a>';
}
echo'</div></div>';
if($k_page > 1){
echo "<div class='line'></div>";
str('?composition&',$k_page,$page);
}
if($user['clan']==$clan['id'] and ($user['dolz']!='основатель' && $user['dolz']!='заместитель')){
echo"</div><hr><div class='foot'><div class='empty'></div>
<a class='inpc-ar center' href='?exit'>Покинуть клан</a>
<div class='empty'></div>
</div></div>";
}
if($user['clan']==$clan['id'] and ($user['dolz']=='основатель' or $user['dolz']=='заместитель')){
echo"</div><hr><div class='foot'><div class='empty'></div>
<a class='inpc-ar center' href='/clan/upravlenie?id=".$clan['id']."'>Управление кланом</a>
<div class='empty'></div>
</div></div>";
}
require_once H.'core/foot.php';
?>