<?php
include 'core/system.php';



include 'core/func_smiles.php';
reg();
head('Клан');
$clans = $dbc->query("SELECT * FROM `clan` WHERE `id`='".$user['clan']."' LIMIT 1")->fetch_assoc();
$clan_id = $clans['id'];
if($user['clan']<=0){ header('location: clan.php');exit; }


if($clans['ob_hp']>0){ $fla ='<span class="info">(+)</span>'; }else{ $fla = ''; } 

$tour = 1;
if($tour==1){ $fly ='<span class="info">(+)</span>'; }else{ $fly = ''; } 

if($user['obb']==1){ $dbc->query(" update `users` set `obb` = 0 where `id` = '".$user['id']."'"); }

$levels = array(0,1000,3000,6000,15000,30000,50000,90000,120000,160000,200000,250000,300000,400000,500000,600000,800000,1000000,1500000,3000000,5000000,9000000,20000000,30000000,50000000,80000000,120000000,190000000,220000000,270000000,370000000,580000000,980000000,1580000000,2080000000,2780000000,4980000000,8230000000,12920000000,20920000000,30920000000,50920000000,70920000000,100920000000,200920000000,300920000000,400920000000,500920000000,700920000000,1000920000000,2000920000000,4000920000000,6000920000000,8000920000000,10000920000000);




if(isset($_GET['obb'])){ 


if($user['clan_rang']<4){ header("Location: my_clan?");exit;}


    ?><form action="my_clan.php?ob" method="post">


<input id="login" type="text" class="input-area" value="" name="ob">




<div class="form-submit">
<div class="form-submit"><input type="submit" class="btn" value="Отправить"/>



</div>


</form>
</div>
</div><? }
 
if(isset($_GET['ob'])){  


if(empty($_POST['ob'])){
    header("Location: my_clan.php?");

    }else{
         
    $ob = protect($_POST['ob']); 

if($user['clan_rang']<4){
    header("Location: index.php"); }



$dbc->query("UPDATE `clan` SET `opis`='".$ob."',`ob_time`='".time()."' ,`ob_us`='".$user['id']."' WHERE `id`='".$user['clan']."'"); 


$dbc->query("UPDATE `users` SET `obb`=1 WHERE `clan`='".$user['clan']."'"); 


header("Location: my_clan.php?");exit;



















}
}

$sklad = $dbc->query("SELECT * FROM `clan_sklad` WHERE `user` = '".$user['id']."' LIMIT 1")->fetch_assoc();




if($sklad['user']==0){$dbc->query("INSERT INTO `clan_sklad` SET `user` = '$user[id]', `clan`= '$user[clan]'");}



if(isset($_GET['inf']) AND !empty($_GET['us'])){
        $ank_id = int($_GET['us']);
$ank = $dbc->query("SELECT * FROM `users` WHERE `id`='".$ank_id."' AND `clan`='".$clan_id."' LIMIT 1")->fetch_assoc();
            if(!$ank){
echo '<div id="error">Такого пользователя не существует</div>';
            foot();
            exit;}
        if($ank['clan']!=$user['clan']){

        header("location:index.php");exit;}



$sklad = $dbc->query("SELECT * FROM `clan_sklad` WHERE `user` = '".$ank['id']."' LIMIT 1")->fetch_assoc(); 

echo '<img src="img/class/'.$ank['storona'].'/'.$ank['pers'].'/pers.png" width="12" height="12"><a href="pers.php?ank='.$ank['id'].'">'.$ank['login'].'</a>'.$clan_rang.'';


?></br>Опыт в Клане : <?=$ank['clan_oput']?><?
?></br>Опыт Сегодня : <?=$ank['day']?></br><?
if(!$sklad){ ?><center>Нет Данных</center><? foot(); exit;}



?>Внесено В Казну : <img src="img/money/money.png"><?=$sklad['gold']?> <img src="img/money/rubin.png"><?=$sklad['rub']?> <img src="img/stat/sera.png"><?=$sklad['sera']?></br><?
?>Внесено Сегодня : <img src="img/money/money.png"><?=$sklad['gold_day']?> <img src="img/money/rubin.png"><?=$sklad['rub_day']?> <img src="img/stat/sera.png"><?=$sklad['sera_day']?><?

foot();exit;







}










$nexexp = $levels[$clans['level']];


if($clans['clan_oput'] >= $nexexp){




    $bonus_level = 200;


    $dbc->query("UPDATE `clan` SET 

        `level`=`level`+1,
`kazna`=`kazna`+".$bonus_level." WHERE `id`='".$clans['id']."'");
    
    $dbc->query("INSERT INTO `clan_stena` SET
    `clan_id`='".$clans['id']."',
    `user_id`='".$clans['komandir']."',
`text`='<b>Новый уровень клана! Награда за достижение нового уровня +<img src=\"img/money/money.png\"> ".$bonus_level." в казну клана.</b>',
    `time`='".time()."'");
    }



if(isset($_GET['rang_down']) AND !empty($_GET['down_id'])){
		$ank_id = int($_GET['down_id']);
$ank = $dbc->query("SELECT * FROM `users` WHERE `id`='".$ank_id."' AND `clan`='".$clan_id."' LIMIT 1")->fetch_assoc();
if(!$ank){ header('location: index.php');exit;}
if($user['clan_rang']<4){ header('location: my_clan.php?');exit;}
if($ank['clan_rang']==1){ header('location: chat.php');exit;}
if($ank['clan_rang']== $user['clan_rang']){ header('location: chat.php');exit;}
if($ank['clan_rang']> $user['clan_rang']){ header('location: index.php');exit;} 
$dbc->query("INSERT INTO `clan_journal` SET

        `clan`='".$clan_id."',


`user`='".$user['id']."',


        `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a><font color=red> Понизил</font> <img src=img/class/".$ank['storona']."/".$ank['pers']."/pers.png><a href=\"pers.php?ank=".$ank['id']."\">".$ank['login']."</a>',


        `time`='".time()."'"); 
$dbc->query("UPDATE `users` SET `clan_rang` =`clan_rang`-1 WHERE `id`='".$ank['id']."'"); header('location:my_clan.php?global');exit;}






if(isset($_GET['rang_up']) AND !empty($_GET['up_id'])){
		$ank_id = int($_GET['up_id']);
$ank = $dbc->query("SELECT * FROM `users` WHERE `id`='".$ank_id."' AND `clan`='".$clan_id."' LIMIT 1")->fetch_assoc();
if(!$ank){ header('location: index.php');exit;}









if($ank['clan_rang']==5){ header('location: my_clan.php?global');exit;}
if($ank['clan_rang']==3 and $user['clan_rang']!=5){ header('location: index.php');exit;}
if($ank['clan_rang']==4){ header('location: index.php');exit;}
if($ank['clan_rang']== $user['clan_rang']){ header('location: index.php');exit;}
$dbc->query("INSERT INTO `clan_journal` SET

        `clan`='".$clan_id."',


`user`='".$user['id']."',


        `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> <font color=green>Повысил </font><img src=img/class/".$ank['storona']."/".$ank['pers']."/pers.png><a href=\"pers.php?ank=".$ank['id']."\">".$ank['login']."</a>',


        `time`='".time()."'"); 
$dbc->query("UPDATE `users` SET `clan_rang` =`clan_rang`+1 WHERE `id`='".$ank['id']."'"); header('location:my_clan.php?global');exit;}



if(isset($_GET['clean'])){ $dbc->query("DELETE FROM `clan_stena` WHERE `clan_id`='".$clan_id."'");


            header('location:my_clan.php?chat');


            exit;
            }      



if(isset($_GET['kik']) AND !empty($_GET['kik_id'])){
		$ank_id = int($_GET['kik_id']);
$ank = $dbc->query("SELECT * FROM `users` WHERE `id`='".$ank_id."' AND `clan`='".$clan_id."' LIMIT 1")->fetch_assoc();
			if(!$ank){
echo '<div id="error">Такого пользователя не существует</div>';
			foot();
			exit;}
		if($ank['id']==$clans['komandir']){

		echo 'Нельзя';
		foot();
		exit;}
if($user['clan_rang']<4){ header('location: index.php');exit;}
		$dbc->query("INSERT INTO `clan_journal` SET

		`clan`='".$clan_id."',


`user`='".$user['id']."',


		`text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> выгнал из клана <img src=img/class/".$ank['storona']."/".$ank['pers']."/pers.png><a href=\"pers.php?ank=".$ank['id']."\">".$ank['login']."</a>',

		`time`='".time()."'");
		$dbc->query("UPDATE `users` SET `clan_oput`=0,`clan`=0,`uron`=0,`clan_b`=0, `clan_rang`=0 , `day`=0 WHERE `id`='".$ank['id']."'");


$dbc->query("UPDATE `users` SET `max_health`=`max_health`-'".$clans['hp_bon']."', `strength`=`strength`-'".$clans['sila_bon']."', `defense`=`defense`-'".$clans['def_bon']."' WHERE `id`='".$ank['id']."' ");



$dbc->query("UPDATE `clan` SET `limit`=`limit`-1 WHERE `id`='".$clans['id']."'"); 


$dbc->query("delete from `clan_sklad` where `user` = '".$ank['id']."'");

		header("Location: my_clan.php?global");
		foot();
		exit;}
if(isset($_GET['global'])){
$member_q = $dbc->query("SELECT `id`,`login`,`clan_rang`,`clan_oput`,`pers`,`storona` FROM `users` WHERE `clan`='".$clan_id."' ORDER BY `clan_oput` DESC LIMIT 40 ");



	$i=0;
		$i+=$page;
		while($member = $member_q->fetch_assoc()){

		++$i;
if($member['clan_rang']==1){ $clan_rang='<span class="minor">Новичок</span>'; }
if($member['clan_rang']==2){ $clan_rang='<span class="info">Рядовой</span>'; }

if($member['clan_rang']==3){ $clan_rang='<span class="iSuperior">Ветеран</span>'; }

if($member['clan_rang']==4){ $clan_rang='<span class="iEpic">Генерал</span>'; }


if($member['clan_rang']==5){ $clan_rang='<span class="bluepost">Лидер</span>'; }
$member['clan_oput']=nifa($member['clan_oput']);

?><div class="b-panel-new lblue-panel"><div class="panel-inner2"><table width="100%"border="0"cellpadding="0"
cellspacing="0"><tbody><tr class="amulets-position"><td style="width: 36px;"><img src="img/class/<?=$member['storona']?>/<?=$member['pers']?>/pers.png" width="12" height="12"><a href="/pers.php?ank=<?=$member['id']?>"><?=$member['login']?></a> <?=$clan_rang?></td><td style="width:56px;"align="right"><a class="amulet-pos up" href="/my_clan.php?rang_up&amp;up_id=<?=$member['id']?>"></a><a class="amulet-pos down"
href="/my_clan.php?rang_down&amp;down_id=<?=$member['id']?>"></a>
<span style="float: right;"><a class="btn" href="my_clan.php?kik&amp;kik_id=<?=$member['id']?>">[Х]</a></span>
</td></tr></tbody></table></div></div></div><?


}
?></div><?
if($total > $set['str'])	{
pages($page, $total, 'my_clan.php?', 40);}foot();exit;}



	if(isset($_GET['exit']) AND $user['clan']>0){
$test_komand = $dbc->query("SELECT * FROM `clan` WHERE `id`='".$user['clan']."' LIMIT 1")->fetch_assoc();

$glava = $dbc->query("SELECT `id`,`login` FROM `users` WHERE `id`='".$test_komand['komandir']."'")->fetch_assoc();
		if($test_komand['komandir']==$user['id']){


echo '<div class="b-notice trsmgr"><div class="notify-inner"><center>
<span class="iLegendary">Глава клана не может покинуть клан!</span></center></div></div>';
		foot();
		exit;}

echo '
Покинуть клан '.$test_komand['name'].'?
<a href="my_clan.php?exit&amp;yes"><input class="label" type="submit" value="Да"></a><a href="my_clan.php"><input class="label" type="submit" value="Нет"></a>';
			if(isset($_GET['yes'])){
$dbc->query("INSERT INTO `clan_journal` SET `clan`='".$user['clan']."', `user`='".$user['id']."', `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> покидает клан!',

		`time`='".time()."'");
$dbc->query("UPDATE `users` SET `clan`=0,`clan_oput`=0,`uron`=0,`clan_b`=0,`clan_rang`=0 ,`day`=0 WHERE `id`='".$user['id']."'");


$dbc->query("UPDATE `users` SET `max_health`=`max_health`-'".$clans['hp_bon']."', `strength`=`strength`-'".$clans['sila_bon']."', `defense`=`defense`-'".$clans['def_bon']."' WHERE `id`='".$user['id']."' ");
$dbc->query("UPDATE `clan` SET `limit`=`limit`-1 WHERE `id`='".$clans['id']."'"); 
$dbc->query("delete from `clan_sklad` where `user` = '".$user['id']."'");
		header('Location: index.php'); }
	foot(); exit; }
	if(isset($_GET['chat_on']) AND !empty($_POST['text'])){
	$text = protect($_POST['text']);
	$dbc->query("INSERT INTO `clan_stena` SET
	`clan_id`='".$clan_id."',
	`user_id`='".$user['id']."',
	`text`='".$text."',
	`time`='".time()."'");
header("Location: my_clan.php?chat");
	exit;}
if(isset($_GET['chat'])){
$total_stena = $dbc->query(" select (`id`) FROM `clan_stena` WHERE `clan_id`='".$clan_id."'")->num_rows;
$stena_q = $dbc->query("SELECT * FROM `clan_stena` WHERE `clan_id`='".$clan_id."' ORDER BY `time` DESC LIMIT ".$page.", ".$set['str']." ");
		if($user['clan_rang']==5){

echo '<div class="center"><a class="btn" href="my_clan.php?clean">Очистить</a></span></div>';}

?><div class="mt5">

<div class="sblue-panel mt5">
<div class="panel-inner-2">
<div class="b-chat">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>
<h2 class="text-left no-p mb10">Чат Клана</h2>


</td><td align="right" style="text-align: right;">
(<a href="my_clan.php?chat">oбновить</a>)
</td></tr></table>


<form action="my_clan.php?chat_on" id="id3" method="post"><div style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input type="hidden" name="text" id="id3_hf_0" /></div>

<div class="mb5"><a href="smiles.php">Смайлики</a></div>
<textarea rows="2" cols="30" class="b-textarea chat-area" name="text" id="" maxlength="256"></textarea>
<button id="submitSent" type="submit" class="gr-btn">Отправить</button>
</form>

<div class="mt10">



</div></div></div><?




		if($total_stena ==0){
	echo '<center>Стена пуста</center>';}else{
while($stena=$stena_q->fetch_assoc()){
$ank = $dbc->query("SELECT `login`,`id`,`storona`,`pers` FROM `users` WHERE `id`='".$stena['user_id']."' LIMIT 1")->fetch_assoc();

echo '<img src="img/class/'.$ank['storona'].'/'.$ank['pers'].'/pers.png" width="12" height="12"><a href="pers.php?ank='.$ank['id'].'">'.$ank['login'].'</a> ('.clock($stena['time']).') '.$stena['text'].'<br><br>';}


?></div><?
			if($total_stena > $set['str'])			{
pages($page, $total_stena, 'my_clan.php?chat&amp;', $set['str']);}} foot();exit;}

?></div></div></div></div></div></div><?




if(isset($_GET['gold'])){
	if(empty($_POST['money'])){

echo'<div class="lblue-panel"><div class="panel-inner-2">Введите количество золота для пожертвования
<form id="idc" method="post"
action="/my_clan.php?gold "><div style="width:0px;height:0px;position: absolute;left:-100px;top:- 100px;overflow:hidden"><input type="hidden" name="idc_hf_0" id="idc_hf_0"></div><div class="form-field"><input type="text" value="" name="money" id="idb"
autocomplete="off"></div><div class="form-submit mt5"><input class="btn" type="submit"
value="Пожертвовать"></div></form></div></div>';

foot(); exit; }else{
	if($user['level']<10){		echo 'Пополнение доступно с 10 уровня</div></div>';				foot(); exit; }

			$money = int($_POST['money']);
if($user['gold']<$money){
			echo 'У вас нет столько денег!</div></div>';				foot();
				exit; }
$dbc->query("INSERT INTO `clan_journal` SET `clan`='".$clan_id."', `user`='".$user['id']."', `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> положил в казну <img src=\"img/money/money.png\"> ".$money."',		`time`='".time()."'");











$dbc->query("UPDATE `users` SET `gold`=`gold`-".$money." WHERE `id`='".$user['id']."'");


$dbc->query("UPDATE `clan_sklad` SET `gold`=`gold`+".$money." , `gold_day`=`gold_day`+".$money.", `activ` = 1 WHERE `user`='".$user['id']."'");

$dbc->query("UPDATE `clan` SET `kazna`=`kazna`+".$money." WHERE `id`='".$clan_id."'");
header('Location: my_clan.php'); }}
if(isset($_GET['serebro'])){
	if(empty($_POST['serebro'])){
echo'<div class="lblue-panel"><div class="panel-inner-2">Введите количество серебра для пожертвования<form id="idc" method="post"action="/my_clan.php?serebro "><div style="width:0px;height:0px;position: absolute;left:-100px;top:- 100px;overflow:hidden"><input type="hidden" name="idc_hf_0" id="idc_hf_0"></div><div class="form-field"><input type="text" value="" name="serebro" id="idb"autocomplete="off"></div><div class="form-submit mt5"><input class="btn" type="submit" value="Пожертвовать"></div></form></div></div>';
foot(); exit; }else{			$serebro = int($_POST['serebro']);
if($user['serebro']<$serebro){
			echo 'У вас нет столько денег!</div></div>';				foot();				exit; }
$dbc->query("INSERT INTO `clan_journal` SET `clan`='".$clan_id."', `user`='".$user['id']."', `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> положил в казну <img src=\"img/stat/sera.png\"> ".$serebro."',		`time`='".time()."'");



$dbc->query("UPDATE `users` SET `serebro`=`serebro`-".$serebro." WHERE `id`='".$user['id']."'");
$dbc->query("UPDATE `clan_sklad` SET `sera`=`sera`+".$serebro." , `sera_day`=`sera_day`+".$serebro.",`activ`=1 WHERE `user`='".$user['id']."'");


$dbc->query("UPDATE `clan` SET `sera`=`sera`+".$serebro." WHERE `id`='".$clan_id."'");
header('Location: my_clan.php'); }}
if(isset($_GET['rubin'])){
if(empty($_POST['rubin'])){
echo'<div class="lblue-panel"><div class="panel-inner-2">Введите количество рубинов для пожертвования<form id="idc" method="post"action="/my_clan.php?rubin "><div style="width:0px;height:0px;position: absolute;left:-100px;top:- 100px;overflow:hidden"><input type="hidden" name="idc_hf_0" id="idc_hf_0"></div><div class="form-field"><input type="text" value="" name="rubin" id="idb"autocomplete="off"></div><div class="form-submit mt5"><input class="btn" type="submit" value="Пожертвовать"></div></form></div></div>';

foot(); exit; }else{            $rubin = int($_POST['rubin']);
if($user['rub']<$rubin){
            echo 'У вас нет столько рубинов!</div></div>';                foot();                exit; }
$dbc->query("INSERT INTO `clan_journal` SET `clan`='".$clan_id."', `user`='".$user['id']."', `text`='<img src=img/class/".$user['storona']."/".$user['pers']."/pers.png><a href=\"pers.php?ank=".$user['id']."\">".$user['login']."</a> положил в казну <img src=\"img/money/rubin.png\"> ".$rubin."',        `time`='".time()."'");



$dbc->query("UPDATE `users` SET `rub`=`rub`-".$rubin." WHERE `id`='".$user['id']."'");
$dbc->query("UPDATE `clan_sklad` SET `rub`=`rub`+".$rubin." , `rub_day`=`rub_day`+".$rubin.",`activ`=1 WHERE `user`='".$user['id']."'");

$dbc->query("UPDATE `clan` SET `rub`=`rub`+".$rubin." WHERE `id`='".$clan_id."'");
header('Location: my_clan.php'); }}
if(isset($_GET['p'])){
?><a class="btn" href="my_clan.php?gold"><img src="img/ico.png" alt="">Пожертвовать Золото</a><a class="btn" href="my_clan.php?serebro"><img src="img/ico.png" alt="">Пожертвовать Серебро</a><a class="btn" href="my_clan.php?rubin"><img src="img/ico.png" alt="">Пожертвовать Рубины</a><? }

?><div class="page-title"><img src="img/new/clan.png
" alt="с" width="12px" height="12px"><span class="va-m"><?=$clans['name']?></

span><div class="font-small c-body
mt5"><span class="va-m">Опыт Клана
</span>&nbsp;<img src="images/icons/exp.png




">

<span class="va-m"><?=$clans['clan_oput']?>/<?=$nexexp?>

</span></div><span class="guild-lvl-badge"><?=$clans['level']?> ур.</span>   <br><img src="img/money/money.png"><?=$clans['kazna']?> <img src="img/stat/sera.png"><?=$clans['sera']?>
<img src="img/money/rubin.png"><?=$clans['rub']?></br>Мощь Клана: <?=$clans['sila_arm']?></div><?

?>




<center><div class="example3"






style="text-align:center"><img src="/img/new/alt.jpg" width="100%"> 



<div class="example_text"> <a href="altar.php?">Активировать Алтарь</a></div></div></center><?


if(!empty($clans['opis'])){


$ob_us = $dbc->query("SELECT * FROM `users` WHERE `id`='".$clans['ob_us']."' LIMIT 1")->fetch_assoc();

?><div class="b-panel-new dblue-panel bordered mt2">

<div class="panel-inner-2"><div class="font-small text-italic c-verygray"><span class="info">
<img src="img/class/<?=$ob_us['storona']?>/<?=$ob_us['pers']?>/pers.png" width="12" height="12"><a href="pers.php?ank=<?=$ob_us['id']?>"><?=$ob_us['login']?></a> : <?=$clans['opis']?></br>  <?=clock($clans['ob_time'])?>
 

     </div></div></div>



<?


}

?><a class="btn nav-btn" href="/my_clan.php?p"><img src="img/new/bag.png" class="link-icon"> Казна</a><?
?><a class="btn nav-btn" href="/list_arm.php?"><img src="img/new/bag.png" class="link-icon"> Войска Клана</a><?


?><a class="btn nav-btn" href="/my_clan.php?chat"><img src="img/stat/oput.png" class="link-icon"> Чат Клана</a><?
?><a class="btn nav-btn" href="/bul.php"><img src="img/stat/oput.png" class="link-icon"> Клановая Магия</a><?
?><a class="btn nav-btn" href="/clan_kuz.php"><img src="img/stat/oput.png" class="link-icon"> Кузница</a><?


?><a class="btn nav-btn" href="/oboroten.php"><img src="img/stat/oput.png" class="link-icon"> Оборотень <?=$fla?></a><?

?><a class="btn nav-btn" href="/clan_journal.php"><img src="img/stat/oput.png" class="link-icon"> Клан Журнал</a><?


?><a class="btn nav-btn" href="/def.php"><img src="img/stat/oput.png" class="link-icon"> Защита От Валькирий </a><?
?><a class="btn nav-btn" href="/view_osada.php"><img src="img/stat/oput.png" class="link-icon"> Осада</a><?


if($user['clan_rang']>=4){
?></a><a class="btn nav-btn" href="/my_clan.php?global"><img src="img/stat/oput.png" class="link-icon">Управление</a><?
?></a><a class="btn nav-btn" href="/clan_online.php"><img src="img/stat/oput.png" class="link-icon">Поиск Игроков</a><?

if($user['clan_rang']>=4){
?><a class="btn nav-btn" href="/my_clan.php?obb"><img src="img/stat/oput.png" class="link-icon"> Объявление</a><? }


?></a><a class="btn nav-btn" href="/arm.php"><img src="img/stat/oput.png" class="link-icon">Нанять Воинов</a><?

}




$member_q = $dbc->query("SELECT `id`,`login`,`level`,`clan_oput`,`pers`,`clan_rang`,`storona` FROM `users` WHERE `clan`='".$clan_id."' ORDER BY `clan_rang` desc , `clan_oput` DESC LIMIT ".$page.",40 ");


?><div class="name">Участники клана: <?=$clans['limit']?>/40 </div><div class="row"><div class="lblue-panel"><?

	$i=0;
		$i+=$page;
		while($member = $member_q->fetch_assoc()){

		++$i;
if($member['clan_rang']==1){ $clan_rang='<span class="minor">Новичок</span>'; }
if($member['clan_rang']==2){ $clan_rang='<span class="info">Рядовой</span>'; }

if($member['clan_rang']==3){ $clan_rang='<span class="iSuperior">Ветеран</span>'; }

if($member['clan_rang']==4){ $clan_rang='<span class="iEpic">Генерал</span>'; }


if($member['clan_rang']==5){ $clan_rang='<span class="bluepost">Лидер</span>'; }
$member['clan_oput']=nifa($member['clan_oput']);
?><div class="b-list"><div class="list-el first"><?
echo $i.'.<img src="img/class/'.$member['storona'].'/'.$member['pers'].'/pers.png" width="12" height="12"><a href="pers.php?ank='.$member['id'].'">'.$member['login'].'</a> <img src="images/icons/exp.png">'.$member['clan_oput'].' '.$clan_rang.'';


?><span style="float: right;"><a href="my_clan.php?inf&amp;us=<?=$member['id']?>">[Инфо]</a></span><?


echo '</div></div><div class="list-el"></div>';
}
?></div>
<a class="btn nav-btn" href="clan.php"><img src="img/stat/oput.png" class="link-icon"> Сильнейшие Кланы</a>

<?
if($total > $set['str'])	{
pages($page, $total, 'clan.php?clan='.$clan_id.'&amp;member&amp;', $set['str']);
	}
?>
<?
if($user['clan_rang']<4){
echo '<a class="btn nav-btn" href="/my_clan.php?exit"><img src="img/new/bag.png" class="link-icon"> Покинуть Клан</a>	';
	
}
?>
<?

foot();
?>
