Файл: html/clan/clan_all.php
Строк: 457
<?php
require_once '../system/func.php';
//pagination(ссылка "index.php/*?", номер страницы:>0, максимум страниц:>0)
function pagination($href, $strlist, $maxstr) {
$strend = 0;
$output = "";
if ($strlist > 4) {
$output .= "<a onclick=showContent('/" . $href . "&list=1');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>1</u></a> .. ";
} elseif ($strlist == 4) {
$output .= "<a onclick=showContent('/" . $href . "&list=1');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>1</u></a>";
}
for ($i = -2; $i <= 3; $i++) {
$strnm = $i + $strlist;
if ($strnm + 1 == $maxstr) {
$strend = 1;
}
if ($strnm > 0) {
if ($i == 0) {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $strlist . "');><u style='margin-left:7px;margin-right:7px;font-size: 14px;text-decoration:none;'>" . $strlist . "</u></a>";
} elseif ($i == 3) {
if ($strlist < $maxstr) {
if ($strend == 0) {
$output .= ".. <a onclick=showContent('/" . $href . "&list=" . $maxstr . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $maxstr . "</u></a>";
} else {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $maxstr . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $maxstr . "</u></a>";
}
}
} else {
if ($strnm < $maxstr) {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $strnm . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $strnm . "</u></a>";
}
}
}
}
return $output;
}
//если получен айди клана
if (isset($_GET['see_clan']) && $_GET['see_clan'] != 0 && $_GET['see_clan'] != $user['id_clan']) {
//получмим параметры клана
if ($clan = $mc->query("SELECT * FROM `clan` WHERE `id`='" . $_GET['see_clan'] . "'")->fetch_array(MYSQLI_ASSOC)) {
if (isset($_GET['list'])) {
$limf = ($_GET['list'] - 1) * 10;
} else {
$limf = 0;
}
//получим игроков на странице
if ($clan_users = $mc->query("SELECT * FROM `users` WHERE `id_clan`='" . $_GET['see_clan'] . "' ORDER BY `reit` DESC LIMIT " . $limf . ",10")->fetch_all(MYSQLI_ASSOC)) {
//количество всех участников
$clan_usersall_count = $mc->query("SELECT * FROM `users` WHERE `id_clan`='" . $_GET['see_clan'] . "'")->num_rows;
//сторона клана по главе
$clan_side = $mc->query("SELECT `side` FROM `users` WHERE `id_clan`='" . $_GET['see_clan'] . "' ORDER BY `des` DESC LIMIT 1")->fetch_array(MYSQLI_ASSOC);
//количество онлайн
$clan_users_online = $mc->query("SELECT * FROM `users` WHERE `online`>'" . (time() - 60) . "'&&`id_clan`='" . $_GET['see_clan'] . "'")->num_rows;
//ico clan
$clan_ico = $clan_side['side'] == 0 || $clan_side['side'] == 1 ? '<img width="19px" height="19px" src="/img/icon/icoevil.png" alt="">' : '<img width="19px" height="19px" src="/img/icon/icogood.png" alt="">';
//позиция клана в рейтинге
$clan_pos = $mc->query("SELECT * FROM `clan` WHERE `reit`>='" . $clan['reit'] . "' ORDER BY `reit` DESC")->num_rows;
?>
<!-- -->
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04" style="width: 2%"></td>
<td class="block05" style="width: 96%">
<table style="width: 100%;margin-bottom: 1px;">
<tr>
<td style="width: 100%;text-align: center;">
<?= $clan_ico; ?>
<b style="font-size: 16px;"><?= $clan['name']; ?></b> <?= '(<font style="color:#2c781a">' . $clan_users_online . '</font>/' . $clan_usersall_count . ')'; ?>
<?= $clan_ico; ?>
</td>
</tr>
</table>
<table style="width: 100%;margin-bottom: 2px;">
<tr>
<td style="width: 100%;text-align: center;">
<a style="font-size: 20px;text-decoration: underline;" onclick="showContent('/top.php?clan');">
Рейтинг:
<?= $clan['reit'] . "(" . $clan_pos . ")"; ?>
</a>
</td>
</tr>
</table>
</td>
<td class="block06" style="width: 2%"></td>
</tr>
<tr>
<td class="block07" style="width: 2%"></td>
<td class="block08" style="width: 96%"></td>
<td class="block09" style="width: 2%"></td>
</tr>
</table>
<!-- -->
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04" style="width: 2%"></td>
<td class="block05" style="width: 96%">
<table style="width: 100%;margin-bottom: 2px;">
<tr>
<td style="width: 100%;text-align: center;">
<?= ceil($clan_usersall_count / 10) > 1 ? pagination("clan/clan_all.php?see_clan=" . $_GET['see_clan'], isset($_GET['list']) ? $_GET['list'] : 1, ceil($clan_usersall_count / 10)) : ""; ?>
</td>
</tr>
</table>
<?php
for ($i = 0; $i < count($clan_users); $i++) {
?>
<table onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''" style="width: 100%;margin-bottom: 8px;" onclick="this.style.backgroundColor = '#ddca9f';showContent('/profile/<?= $clan_users[$i]['id']; ?>')">
<tr>
<td style="width: 30px;text-align: center;">
<?= $i + $limf + 1; ?>
</td>
<td style="max-width: 100%;text-align: left;">
<!-- глава -->
<?= $clan_users[$i]['des'] == 3 ? "<img width='16px' height='16px' src='/img/img23.png'>" : ""; ?>
<!-- дес -->
<?= $clan_users[$i]['des'] == 2 ? $clan_ico : ""; ?>
<!-- ник -->
<?= $clan_users[$i]['online'] > (time() - 60) ? "<font style='color:#046902;'>" : ""; ?>
<!-- давно не был -->
<?= $clan_users[$i]['online'] < (time() - 3600000) && $clan_users[$i]['reit'] < 1 ? "<font style='color:666666;'>" : ""; ?>
<?= "<font style='text-decoration:underline;font-size:18px;'>" . $clan_users[$i]['name'] . "</font>"; ?>
<?= $clan_users[$i]['online'] < (time() - 3600000) && $clan_users[$i]['reit'] < 1 ? "</font>" : ""; ?>
<?= $clan_users[$i]['name'] == $user['name'] ? "</font>" : ""; ?>
<!-- чемп -->
<?= $clan_users[$i]['des'] >0 ? "<img width='20px' height='20px' src='/images/super/2su.png'>" : ""; ?>
</td>
<td style="width: 60px;text-align: center;">
<?= $clan_users[$i]['reit']; ?>
</td>
</tr>
</table>
<?php } ?>
</td>
<td class="block06" style="width: 2%"></td>
</tr>
<tr>
<td class="block07" style="width: 2%"></td>
<td class="block08" style="width: 96%"></td>
<td class="block09" style="width: 2%"></td>
</tr>
</table>
<?php
} else {
?>
<center><a style="text-decoration: underline;" onclick="showContent('main.php')">--Нет такого клана--</a></center>
<?php
}
} else {
?>
<center><a style="text-decoration: underline;" onclick="showContent('main.php')">--Нет такого клана--</a></center>
<?php
}
$footval = "clannone";
} elseif (isset($_GET['see_clan']) && $user['id_clan'] == $_GET['see_clan'] && $clan = $mc->query("SELECT * FROM `clan` WHERE `id`='" . $user['id_clan'] . "'")->fetch_array(MYSQLI_ASSOC)) {
//получмим параметры клана
if (isset($_GET['list'])) {
$limf = ($_GET['list'] - 1) * 10;
} else {
$limf = 0;
}
//получим игроков на странице
if ($clan_users = $mc->query("SELECT * FROM `users` WHERE `id_clan`='" . $user['id_clan'] . "' ORDER BY `reit` DESC LIMIT " . $limf . ",10")->fetch_all(MYSQLI_ASSOC)) {
//количество всех участников
$clan_usersall_count = $mc->query("SELECT * FROM `users` WHERE `id_clan`='" . $user['id_clan'] . "'")->num_rows;
//сторона клана по главе
$clan_side = $mc->query("SELECT `side` FROM `users` WHERE `id_clan`='" . $_GET['see_clan'] . "' ORDER BY `des` DESC LIMIT 1")->fetch_array(MYSQLI_ASSOC);
//количество онлайн
$clan_users_online = $mc->query("SELECT * FROM `users` WHERE `online`>'" . (time() - 60) . "'&&`id_clan`='" . $user['id_clan'] . "'")->num_rows;
//ico clan
$clan_ico = $clan_side['side'] == 0 || $clan_side['side'] == 1 ? '<img width=19px" height="19px" src="/img/icon/icoevil.png" alt="">' : '<img width=19px" height="19px "src="/img/icon/icogood.png" alt="">';
//позиция клана в рейтинге
$clan_pos = $mc->query("SELECT * FROM `clan` WHERE `reit`>='" . $clan['reit'] . "' ORDER BY `reit` DESC")->num_rows;
//если нет главы выдать первому десятнику
if($countGlav = $mc->query("SELECT COUNT(*) FROM `users` WHERE (`id_clan` = '".$user['id_clan']."' AND `des` = '3') ")->fetch_array(MYSQLI_ASSOC)){
if($countGlav['COUNT(*)'] <= 0 ){
$des1 = $mc->query("SELECT * FROM `users` WHERE (`id_clan` = '".$user['id_clan']."' AND `des` = '2')")->fetch_array(MYSQLI_ASSOC);
$mc->query("UPDATE `users` SET `des` = '3' WHERE `id` = '".$des1['id']."'");
}
}
?>
<!-- -->
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04" style="width: 2%"></td>
<td class="block05" style="width: 96%">
<table style="width: 100%;margin-bottom: 1px;">
<tr>
<td style="width: 100%;text-align: center;">
<?= $clan_ico; ?>
<b style="font-size: 16px;"><?= $clan['name']; ?></b>(<?= $clan_users_online == 0 ? $clan_users_online . '/' . $clan_usersall_count . ")" : '<font style="color:#2c781a">' . $clan_users_online . '</font>/' . $clan_usersall_count . ')'; ?>
<?= $clan_ico; ?>
</td>
</tr>
</table>
<table style="width: 100%;margin-bottom: 2px;">
<tr>
<td style="width: 100%;text-align: center;">
<a style="font-size: 20px;text-decoration: underline;" onclick="showContent('/top.php?clan');">
Рейтинг:
<?= $clan['reit'] . "(" . $clan_pos . ")"; ?>
</a>
</td>
</tr>
</table>
</td>
<td class="block06" style="width: 2%"></td>
</tr>
<tr>
<td class="block07" style="width: 2%"></td>
<td class="block08" style="width: 96%"></td>
<td class="block09" style="width: 2%"></td>
</tr>
</table>
<!-- -->
<table style="width: 100%;margin: auto;" >
<tr>
<td style="width: 50%; text-align: right;">
<button style="outline: none;height: 40px;width: 90%;margin-right: 5px" class="button_alt_00" onclick="showContent('/chatclan.php')">
Чат
</button>
</td>
<td style="width: 50%; text-align: left;">
<button style="outline: none;height: 40px;width: 90%;margin-left: 5px" class="button_alt_00" onclick="showContent('/huntb/grab/index.php')">
Грабежи
</button>
</td>
</tr>
</table>
<!-- -->
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04" style="width: 2%"></td>
<td class="block05" style="width: 96%">
<table style="width: 100%;margin-bottom: 8px;">
<tr>
<td style="width: 100%;text-align: center;">
<?= ceil($clan_usersall_count / 10) > 1 ? pagination("clan/clan_all.php?see_clan=" . $user['id_clan'], isset($_GET['list']) ? $_GET['list'] : 1, ceil($clan_usersall_count / 10)) : ""; ?>
</td>
</tr>
</table>
<?php
for ($i = 0; $i < count($clan_users); $i++) {
?>
<table onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''" style="width: 100%;margin-bottom: 8px;" onclick="this.style.backgroundColor = '#ddca9f';showContent('/profile/<?= $clan_users[$i]['id']; ?>')">
<tr>
<td style="width: 30px;text-align: center;">
<?= $i + $limf + 1; ?>
</td>
<td style="max-width: 100%;text-align: left;">
<!-- глава -->
<?= $clan_users[$i]['des'] == 3 ? "<img width='16px' height='16px' src='/img/img23.png'>" : ""; ?>
<!-- дес -->
<?= $clan_users[$i]['des'] == 2 ? $clan_ico : ""; ?>
<!-- ник -->
<?= $clan_users[$i]['online'] > (time() - 60) ? "<font style='color:#046902;'>" : ""; ?>
<!-- давно не был -->
<?= $clan_users[$i]['online'] < (time() - 3600000) && $clan_users[$i]['reit'] < 1 ? "<font style='color: #666666;'>" : ""; ?>
<?= "<font style='text-decoration:underline;font-size:18px;'>" . $clan_users[$i]['name'] . "</font>"; ?>
<?= $clan_users[$i]['online'] < (time() - 3600000) && $clan_users[$i]['reit'] < 1 ? "</font>" : ""; ?>
<?= $clan_users[$i]['name'] == $user['name'] ? "</font>" : ""; ?>
<!-- чемп -->
<?= $clan_users[$i]['des'] >0 ? "<img width='20px' height='20px' src='/images/super/2su.png'>" : ""; ?>
</td>
<td style="width: 60px;text-align: center;">
<?= $clan_users[$i]['reit']; ?>
</td>
</tr>
</table>
<?php } ?>
</td>
<td class="block06" style="width: 2%"></td>
</tr>
<tr>
<td class="block07" style="width: 2%"></td>
<td class="block08" style="width: 96%"></td>
<td class="block09" style="width: 2%"></td>
</tr>
</table>
<center><a style="text-decoration: underline; font-size:19px;" onclick="showContent('/clan/clan_all.php?exit&see_clan=<?=$user['id_clan'];?>')">Покинуть клан</a></center> </script>
<?php
}
$footval = "clan";
//если не в клане и лвл старше 14
} elseif ($user['level'] > 14) {
?>
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04"></td>
<td class="block05" style="text-align: center; font-size:15px;">
Вы можете дождаться и принять приглашения<br> другого клана либо создать свой.
<br><br>
Стоимость создания клана: 100
<img class="ico_head_all" src="/images/icons/plata.png">
<br><br>
<div style="text-align:left;"> Название клана:</div>
<form id='formid'>
<input onfocus="this.style.backgroundColor = '#e8cf98';" onblur="this.style.backgroundColor = '#c5af7f'" type="text" name="name" style="outline: none;margin-top: 6px;height: 35px;width: 96%;background-color: #c5af7f;border: 1px solid #7d4b11;padding: 3px;" value="" maxlength="100"/>
<button type='button' class="button_alt_01" style="margin-top: 6px; width:90%;" onclick="showContent('/clan/create.php?create&' + $('#formid').serialize())">Создать</button>
<br
</form>
</td>
<td class="block06"></td>
</tr>
<tr>
<td class="block07"></td>
<td class="block08"></td>
<td class="block09"></td>
</tr>
</table>
<?php
$footval = "clannone";
//или лвл ниже 15
} elseif ($user['level'] < 15) {
?>
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04"></td>
<td class="block05" style="text-align:center;">
Дождитесь праглашения в клан или с <b>15</b> уровня сможете создать свой клан!
</td>
<td class="block06"></td>
</tr>
<tr>
<td class="block07"></td>
<td class="block08"></td>
<td class="block09"></td>
</tr>
</table>
<?php
$footval = "clannone";
} else {
?>
<center><a style="text-decoration: underline;" onclick="showContent('main.php')">--Нет такого клана--</a></center>
<?php
$footval = "clannone";
}
if (isset($_GET['exit'])) {
if (empty($_GET['exit'])) {
message_yn(
"Покинуть клан",
"clan/clan_all.php?exit=yes&see_clan=" . $user['id_clan'],
"clan/clan_all.php?see_clan=" . $user['id_clan'],
"Да",
"Нет"
);
}
}
if (isset($_GET['exit']) && $_GET['exit'] == 'yes' && isset($_GET['see_clan']) == $user['id_clan']) {
$mc->query("UPDATE `users` SET `id_clan`='0' WHERE `id`='" . $user['id'] . "'");
?>
<script>
showContent('/main.php');
</script>
<?php
}
require_once '../system/foot/foot.php';