Файл: klan_info.php
Строк: 386
<?php
include 'inc/mysql.php';
include 'inc/check.php';
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
switch($_GET[mod]){
default:
$req = mysql_query("SELECT * FROM `account` WHERE `id` = '$account[id]'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'<div class="paddings">';
echo"<img src='/pic/index/!.png' alt='*'/> Ошибка!</div>";
include 'inc/nogi.php';
exit;
}
$usdata = mysql_fetch_array($req);
if(empty($_GET[id])){
echo'<div class="paddings">';
echo"<img src='/pic/index/!.png' alt='*'/> Ошибка!</div>";
include 'inc/nogi.php';
exit;}
$req = mysql_query("SELECT * FROM `klan` where `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==1){
$clan = mysql_fetch_array($req);
$req = mysql_query("SELECT `id` FROM `account` where `klan`='$clan[lider]'");
////////////////////////////
$kk=mysql_num_rows($req);
}else{
echo'<div class="paddings">';
echo"<img src='/pic/main/!.png' alt='*'/> Нет такой гильдии!</div>";
include 'inc/nogi.php';
exit;
}
$nickas = strip_tags($clan[lider]);
if(empty($account[klan])){
$req = mysql_query("SELECT * FROM `klan_invite` where `usr`='$account[id]' and `klan`='$clan[lider]' ");
$avto=mysql_num_rows($req);
if($avto==0){
echo'<center><a href="klan_info.php?mod=zayavka&id='.$clan[lider].'" class="menu_link"><img src="pic/main/pers_sohran.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Заявка на вступление в гильдию</a></center>';
}else{
echo'<center><a href="klan_info.php?mod=nou&id='.$clan[lider].'" class="menu_link"><img src="pic/main/!.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Отменить заявку на вступление</a></center>';
}
}
echo'<div class="menudiv">Гильдия '.$clan[name].'</div><br />';
echo'<div class="paddings">';
include ("inc/exp_banda_info.php");
echo"<img src='/pic/main/up.png' alt='*'/> Уровень: $clan[lvl]
<br><img src='/pic/main/exp_banda.png' alt='*'/> Опыт: $clan[oput] (<font color=gold>$exp_banda%</font>)<br>
<img src='/pic/main/repa.gif' alt='*'/> Репутация: $clan[repa]
";
echo'<br><img src="/pic/main/obsak.png" alt="*"/> Общак: <img src="/pic/main/money.png" alt="*"/> '.number_format ($clan[money]).', <img src="/pic/main/baks.png" alt="*"/> '.number_format ($clan[baks]).'';
echo"<br><img src='/pic/main/timereg.png' alt='*'/> Создана: ";
$d = time()-$clan[reg];
echo ' <font color=00CC00>('.sec2day($d).' назад)</font>';
echo '</div><br />';
echo'<a href="klan_info.php?mod=pravila&id='.$clan[id].'"><img src="pic/main/avtologin.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Требования для вступления</a><br /><br />';
if($account[status]=="gm"){
echo'<center><div class="title-top">Управление гильдией</div><div class="separ2"></div></center>';
echo'<a href="gmpanel.php?mod=redakt&id='.$clan[id].'" class="menu_link"><img src="pic/main/forum.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Редактировать гильдию</a>';
$chat= mysql_query("SELECT COUNT(`id`) FROM `klan_chat`WHERE `klan`='$clan[lider]'");
$chat= mysql_result($chat, 0);
echo'<a href="gmpanel.php?mod=chat&id='.$clan[id].'" class="menu_link"><img src="pic/main/forum.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Чат гильдии <font color=00CC00>('.$chat.')</font></a>';
$kolic = mysql_query("SELECT COUNT(`id`) FROM `klan_hystory`WHERE `klan`='$clan[lider]'");
$kols = mysql_result($kolic, 0);
echo'<a href="gmpanel.php?mod=hystory&id='.$clan[id].'" class="menu_link"><img src="pic/main/forum.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> История гильдии <font color=00CC00>('.$kols.')</font></a>';
$vl= mysql_query("SELECT COUNT(`id`) FROM `klan_log`WHERE `klan`='$clan[lider]'");
$vl= mysql_result($vl, 0);
echo'<a href="gmpanel.php?mod=statyka&id='.$clan[id].'" class="menu_link"><img src="pic/main/forum.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Статистика вложений <font color=00CC00>('.$vl.')</font></a>';
}
echo'<center><div class="title-top">Состав банды: <img src="/pic/main/gild.png" alt="*"/> ('.$kk.') из ('.$clan[sostav].')</div>';
echo'<div class="paddings">';
$req = mysql_query("SELECT * FROM `klan` WHERE `id` = '$clan[id]'");
////////////////////////////
$cl = mysql_fetch_array($req);
$req2 = mysql_query("SELECT * FROM `account` WHERE `id` = '$cl[lider]'");
$pic2 = mysql_fetch_array($req2);
$req = mysql_query("SELECT `status`,`sex`,`login`,`id`,`last_active`,`klan`,`lvl` FROM `account` WHERE `id` = '$pic2[id]'");
$pic = mysql_fetch_array($req);
if($pic['status']=="gm"){
$nik = gradient(''.$pic[login].'','00FF00', '00CC00');
echo '<img src='pic/main/admins.png'> Лидер гильдии:<br /> <us><img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].'';
}else{
if($pic['status']=="moder"){
$nik = gradient(''.$pic[login].'','0066CC', 'AB82FF');
echo '<img src='pic/main/admins.png'> Лидер гильдии:<br /> <us><img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].'';
}else{
if($pic['status']=="bot"){
$nik = gradient(''.$pic[login].'','FFCC00', 'FF9933');
echo '<img src='pic/main/admins.png'> Лидер гильдии:<br /> <img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].'';
}else{
echo '<img src='pic/main/admins.png'> Лидер гильдии:<br /> <img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'">'.htmlspecialchars(stripslashes($pic['login'])).'</a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].'';
}}}
$d = time()-7000;
if($pic[last_active]<$d){echo" - <font color=red> Offline</font><br /><br />";}else{
echo" - <font color=00CC00> Online</font><br /><br />";}
$cop=10;
$ca=mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `klan`='$clan[lider]' and `id`!='$clan[lider]' "),0);
$cp=ceil($ca/$cop);
if(isset($_GET['page']) && is_numeric($_GET['page'])){
$page = $_GET['page'];
if($_GET['page']>$cp) $page=$cp;
if($_GET['page']<1)$page=1;
}else{
$page=1;
}
$start=$page*$cop-$cop;
$dlist = 'list1';
$req = mysql_query("SELECT `login`,`id`,`klan`,`lvl`,`exp` FROM `account` where `klan`='$clan[lider]' and `id`!='$clan[lider]' ORDER BY `exp` DESC LIMIT $start,$cop");
echo '<div class="separ2"></div>';
echo"<img src='/pic/main/drus.png' alt='*'/> Члены гильдии:<br/>";
$avto=mysql_num_rows($req);
$i=1;
if($avto>=1){
While($clan = mysql_fetch_array($req))
{
$req34 = mysql_query("SELECT `status`,`sex`,`login`,`id`,`last_active`,`lvl` FROM `account` WHERE `id` = '$clan[id]'");
$pic = mysql_fetch_array($req34);
if($pic['status']=="gm"){
$nik = gradient(''.$pic[login].'','00FF00', '00CC00');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].' -';
}else{
if($pic['status']=="moder"){
$nik = gradient(''.$pic[login].'','0066CC', 'AB82FF');
echo '<us><img src="pic/main/'.$pic[sex].'.png" alt="*"/><a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].' -';
}else{
if($pic['status']=="bot"){
$nik = gradient(''.$pic[login].'','FFCC00', 'FF9933');
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'"> '.$nik.'</us></a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].' -';
}else{
echo '<img src="pic/main/'.$pic[sex].'.png" alt="*"/> <a href="infa.php?id='.$pic['id'].'">'.htmlspecialchars(stripslashes($pic['login'])).'</a> <img src="/pic/main/up.png" alt="*"/> '.$pic[lvl].' -';
}}}
$d = time()-7000;
if($pic[last_active]<$d){echo" <font color=red>Offline</font><br>";}else{
echo" <font color=00CC00>Online</font><br>";}
}
echo '
<br />
<center>
Навигация:
';if($page-1>0){
echo '<a href="klan_info.php?id='.$cl[id].'&page='.($page-1).'"><</a> ';
}
if($page-1>0){
echo '<a href="klan_info.php?id='.$cl[id].'&page='.($page-1).'">'.($page-1).'</a> ';
}
echo '<b>'.$page.'</b>';
if($page+1<=$cp){
echo ' <a href="klan_info.php?id='.$cl[id].'&page='.($page+1).'">'.($page+1).'</a>';
}
if($page+1<=$cp){
echo ' <a href="klan_info.php?id='.$cl[id].'&page='.($page+1).'">></a>';
}
echo '</center>';
}else{
echo '<div class="separ2"></div>';
echo"<img src='/pic/index/!.png' alt='*'/> В гильдии никого нет.<br />";
}
echo '</div>';
break;
case 'zayavka':
if(empty($account[klan])){
mysql_query("DELETE FROM `klan_invite` WHERE `usr`='$account[id]' ");
mysql_query("INSERT INTO `klan_invite` SET `klan` = '".intval($_GET['id'])."',`usr` = '$account[id]'");
$req = mysql_query("SELECT * FROM `klan` where `lider`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==1){
$clan = mysql_fetch_array($req);
header ("Location: klan_info.php?id=$clan[id]"); exit;
}else{
header ("Location: home.php?"); exit;
}
}else{
header ("Location: home.php?"); exit;
}
break;
case 'nou':
if(empty($account[klan])){
mysql_query("DELETE FROM `klan_invite` WHERE `usr`='$account[id]' ");
$req = mysql_query("SELECT * FROM `klan` where `lider`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==1){
$clan = mysql_fetch_array($req);
header ("Location: klan_info.php?id=$clan[id]"); exit;
}else{
header ("Location: home.php?"); exit;
}
}else{
header ("Location: home.php?"); exit;
}
break;
case 'pravila':
$req = mysql_query("SELECT * FROM `account` WHERE `id` = '$account[id]'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'<div style="text-align:left;padding:6px;color:#a5a5a5" class="menu_link3">';
echo"<img src='/pic/index/!.png' alt='*'/> Ошибка!</div>";
include 'inc/nogi.php';
exit;
}
$usdata = mysql_fetch_array($req);
if(empty($_GET[id])){
echo'<div style="text-align:left;padding:6px;color:#a5a5a5" class="menu_link3">';
echo"<img src='/pic/index/!.png' alt='*'/> Ошибка!</div>";
include 'inc/nogi.php';
exit;}
$req = mysql_query("SELECT * FROM `klan` where `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==1){
$clan = mysql_fetch_array($req);
$req = mysql_query("SELECT `id` FROM `account` where `klan`='$clan[lider]'");
////////////////////////////
$kk=mysql_num_rows($req);
}else{
echo'<div style="text-align:left;padding:6px;color:#a5a5a5" class="menu_link3">';
echo"<img src='/pic/main/!.png' alt='*'/> Нет такой гильдии!</div>";
include 'inc/nogi.php';
exit;
}
echo'<div class="title-top">Требования для вступления</div><div class="separ2"></div>';
echo'<div style="text-align:left;padding:6px;color:#a5a5a5" class="menu_link3">';
if(!empty($clan[pravila])){
$koment = strip_tags($clan['pravila']);
$koment = smiles(tags($koment));
echo bb($koment);
echo'</div>';
}else{
echo'<img src="/pic/main/avtologin.png" alt="*"/> Нет требований.</div>';
}
echo'<a href="klan_info.php?id='.$clan[id].'" class="menu_link"><img src="pic/main/rotate.png" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Вернуться</a>';
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>