3029 lines
172 KiB
PHP
3029 lines
172 KiB
PHP
<?php
|
||
/* @var User $u */
|
||
|
||
use Clan\ItemStorage;
|
||
use Clan\Register;
|
||
use Core\Config;
|
||
use Core\Db;
|
||
use Helper\Conversion;
|
||
use User\Clan;
|
||
|
||
if (!defined('GAME')) {
|
||
die();
|
||
}
|
||
|
||
$userclan = new Clan($u->info);
|
||
$newclan = new Register();
|
||
if (!empty($newclan->getNewClanId())) {
|
||
Db::sql('update users set clan = ?, clan_delay = ?, clan_prava = ?, clan_zv = 0 where id = ?',
|
||
[$newclan->getNewClanId(), strtotime("+60 day"), 'glava', $u->info['id']]);
|
||
}
|
||
|
||
$res = Db::getRow('select * from clan where id = ?', [$u->info['clan']]);
|
||
$cpr = explode('|', $u->info['clan_prava']);
|
||
|
||
if (
|
||
!isset($_GET['events']) &&
|
||
!isset($_GET['diplom']) &&
|
||
!isset($_GET['control']) &&
|
||
!isset($_GET['deposit']) &&
|
||
!isset($_GET['titul']) &&
|
||
!isset($_GET['rules']) &&
|
||
!isset($_GET['info']) &&
|
||
!isset($_GET['members'])
|
||
) {
|
||
$_GET['events'] = 1;
|
||
}
|
||
|
||
//Возможности текущего титула
|
||
$tt = [
|
||
0 => ['000000000', 'Доступные каналы'],
|
||
1 => [0, 'Просмотр событий клана'],
|
||
2 => [0, 'Создание событий клана'],
|
||
3 => [0, 'Просмотр хранилища'],
|
||
4 => [0, 'Использование вещей из хранилища'],
|
||
5 => [0, 'Изъятие предметов из хранилища'],
|
||
6 => [0, 'Просмотр казны и списка игроков, пополнявших казну'],
|
||
7 => [0, 'Пополнение казны и доступ к абилкам'],
|
||
8 => [0, 'Использование казны'],
|
||
9 => [0, 'Прием в клан'],
|
||
10 => [0, 'Изгнание из клана'],
|
||
11 => [0, 'Редактирование информации о клане'],
|
||
12 => [0, 'Клановые союзы и альянсы'],
|
||
13 => [0, 'Управление клановыми союзами и альянсами'],
|
||
14 => [0, 'Обьявление войны'],
|
||
15 => [0, 0],
|
||
16 => [0, 0],
|
||
17 => [0, 0],
|
||
18 => [0, 0],
|
||
19 => [0, 0],
|
||
20 => [0, 0],
|
||
];
|
||
|
||
if ($u->info['clan_prava'] != 'glava') {
|
||
$utitl = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "' . $u->info['clan_prava'] . '" LIMIT 1')
|
||
);
|
||
if (!isset($utitl['id'])) {
|
||
$utitl = mysql_fetch_array(mysql_query('select * from clan_tituls where id = 2 limit 1'));
|
||
}
|
||
} else {
|
||
$utitl = mysql_fetch_array(mysql_query('select * from clan_tituls where id = 1 limit 1'));
|
||
}
|
||
|
||
if (isset($utitl['id'])) {
|
||
$i = 1;
|
||
while ($i < count($tt)) {
|
||
if ($utitl['prava'][$i] > 0) {
|
||
$tt[$i][0] = 1;
|
||
}
|
||
$i++;
|
||
}
|
||
}
|
||
|
||
$u->info['tt'] = $tt;
|
||
|
||
//Уровень клана
|
||
$lvl_exp = [
|
||
0 => 0,
|
||
1 => 500000,
|
||
2 => 2000000,
|
||
3 => 5500000,
|
||
4 => 10500000,
|
||
5 => 20500000,
|
||
6 => 35500000,
|
||
7 => 65500000,
|
||
8 => 100000000,
|
||
9 => 200000000,
|
||
10 => 300000000,
|
||
11 => 1000000000,
|
||
|
||
];
|
||
|
||
if ($res && $res['exp'] >= $lvl_exp[$res['level'] + 1]) {
|
||
$res['level']++;
|
||
mysql_query('UPDATE `clan` SET `level` = "' . $res['level'] . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1');
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","0","127.0.0.1","Администрация","Клановое сообщение","Ваш клан достиг уровня ' . $res['level'] . '!"
|
||
)'
|
||
);
|
||
}
|
||
$r1 = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $res['id'] . '" AND `date` = "' . date(
|
||
'dmY'
|
||
) . '" LIMIT 1'
|
||
)
|
||
); // читаем позицию клана
|
||
//Права клана
|
||
$lvl_prava = [
|
||
0 => [8, 0, 0, 0, 0, 50, 20, 200],
|
||
1 => [12, 1, 0, 0, 0, 50, 20, 200],
|
||
2 => [16, 1, 0, 0, 0, 50, 20, 200],
|
||
3 => [20, 1, 0, 0, 0, 50, 20, 200],
|
||
4 => [24, 1, 1, 0, 0, 100, 40, 200],
|
||
5 => [28, 1, 1, 0, 0, 100, 40, 200],
|
||
6 => [32, 1, 1, 0, 0, 100, 40, 200],
|
||
7 => [36, 1, 1, 0, 0, 200, 80, 200],
|
||
8 => [40, 1, 1, 1, 1, 200, 80, 200],
|
||
9 => [44, 1, 1, 1, 1, 200, 80, 200],
|
||
10 => [48, 1, 1, 1, 1, 200, 80, 200],
|
||
11 => [52, 1, 1, 1, 1, 200, 80, 200],
|
||
]
|
||
|
||
?>
|
||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||
<style>
|
||
body {
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_44.jpg);
|
||
}
|
||
|
||
.a {
|
||
text-decoration: none;
|
||
color: #333333;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.a:hover {
|
||
text-decoration: none;
|
||
color: #333333;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.clanimg {
|
||
padding-right: 5px;
|
||
margin-bottom: -2px;
|
||
}
|
||
|
||
.infimg {
|
||
margin-left: 2px;
|
||
margin-bottom: -1px;
|
||
}
|
||
|
||
#clanpanel {
|
||
width: 100%;
|
||
height: 32px;
|
||
color: #333333;
|
||
font-weight: bold;
|
||
font-size: 11px;
|
||
min-width: 1250px;
|
||
}
|
||
|
||
#clanpanel .head {
|
||
float: left;
|
||
width: 75px;
|
||
height: 18px;
|
||
font-size: 11px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_03.jpg);
|
||
background-repeat: no-repeat;
|
||
}
|
||
|
||
#clanpanel .panel {
|
||
float: left;
|
||
width: 100%;
|
||
height: 32px;
|
||
font-size: 11px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_08.jpg);
|
||
background-repeat: repeat-x;
|
||
}
|
||
|
||
#clanpanel .foot {
|
||
float: left;
|
||
width: 75px;
|
||
height: 12px;
|
||
font-size: 11px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_27.jpg);
|
||
background-repeat: no-repeat;
|
||
}
|
||
|
||
.tabs ul {
|
||
list-style: none;
|
||
float: left;
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
.name {
|
||
float: left;
|
||
color: #990000;
|
||
height: 32px;
|
||
padding-left: 85px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_s3r3_07.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 15px;
|
||
}
|
||
|
||
.clanicon {
|
||
padding-right: 10px;
|
||
margin-bottom: -2px;
|
||
}
|
||
|
||
.tabs .events {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_09.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .control {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_11.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .deposit {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_13.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .clanart {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_17.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .rules {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_19.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .info {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_21.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .members {
|
||
float: left;
|
||
height: 32px;
|
||
padding-left: 60px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_23.jpg);
|
||
background-repeat: no-repeat;
|
||
line-height: 32px;
|
||
padding-right: 20px;
|
||
}
|
||
|
||
.tabs .last {
|
||
float: right;
|
||
width: 15px;
|
||
height: 32px;
|
||
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_25.jpg);
|
||
background-repeat: no-repeat;
|
||
}
|
||
|
||
|
||
#clancontent {
|
||
width: 100%;
|
||
float: left;
|
||
padding-top: 25px;
|
||
}
|
||
|
||
.legtitle {
|
||
font-weight: bold;
|
||
padding: 0 5px;
|
||
color: #990000;
|
||
}
|
||
|
||
.legcontent {
|
||
padding: 0 5px;
|
||
}
|
||
|
||
.section {
|
||
width: 100%;
|
||
margin: 0 0 30px;
|
||
}
|
||
|
||
ul.tabs {
|
||
height: 28px;
|
||
line-height: 25px;
|
||
list-style: none;
|
||
margin: 0;
|
||
padding: 0;
|
||
font-size: 10px;
|
||
color: #666;
|
||
}
|
||
|
||
.tabs li {
|
||
float: left;
|
||
position: relative;
|
||
cursor: pointer;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.tabs li a {
|
||
color: #666;
|
||
font-size: 10px;
|
||
}
|
||
|
||
li.current a {
|
||
color: #333333;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.box {
|
||
width: 100%;
|
||
float: left;
|
||
display: none;
|
||
padding-top: 25px;
|
||
}
|
||
|
||
.box.visible {
|
||
display: block;
|
||
}
|
||
|
||
.modpow {
|
||
background-color: #ddd5bf;
|
||
}
|
||
|
||
.mt {
|
||
background-color: #b1a993;
|
||
padding: 5px 10px;
|
||
}
|
||
|
||
.md {
|
||
padding: 10px;
|
||
}
|
||
</style>
|
||
|
||
<script>
|
||
function openMod(title, dat) {
|
||
var d = document.getElementById('useMagic');
|
||
if (d) {
|
||
document.getElementById('modtitle').innerHTML = `
|
||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||
<tr>
|
||
<td valign="top">${title}</td>
|
||
<td width="30" valign="top">
|
||
<div align="right">
|
||
<a title="Закрыть" onClick="closeMod(); return false;" href="#">x</a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>`;
|
||
document.getElementById('moddata').innerHTML = dat;
|
||
d.style.display = '';
|
||
}
|
||
}
|
||
|
||
function closeMod() {
|
||
var d = document.getElementById('useMagic');
|
||
if (d) {
|
||
document.getElementById('modtitle').innerHTML = '';
|
||
document.getElementById('moddata').innerHTML = '';
|
||
d.style.display = 'none';
|
||
}
|
||
}
|
||
|
||
function addNewEvent() {
|
||
const html = `
|
||
<form method="post" action="main.php?clan&events&add=<?=$code?>">
|
||
Заголовок: <input name="titleadd" style="335px;" type="text"><br>
|
||
<textarea name="textadd" style="412px;" rows="5"></textarea><br>
|
||
<div align="right"><input type="submit" value="Добавить событие"></div>
|
||
</form>
|
||
`;
|
||
openMod('Добавить событие', html);
|
||
}
|
||
|
||
function addNewTitul() {
|
||
const html = `
|
||
<form method="post" action="main.php?clan&titul&add=<?=$code?>">
|
||
Название титула: <input name="tituladd" style="235px;" type="text"><br>
|
||
<small style="left">(не более 30-ти символов)</small>
|
||
<input style="right" type="submit" value="Добавить титул">
|
||
</form>
|
||
`;
|
||
openMod('Добавить титул', html);
|
||
}
|
||
|
||
// С этим мигающим кулаком надо что-то делать..
|
||
document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));
|
||
</script>
|
||
<div style="text-align: right;">
|
||
<input type="button" class="btn" value="Обновить" onclick="location='main.php?clan=1';">
|
||
<input type="button" class="btn" value="Вернуться" onclick="location='main.php';">
|
||
</div>
|
||
<div id="useMagic" style="display:none; position:absolute; border:solid 1px #776f59; left: 50px; top: 186px;"
|
||
class="modpow">
|
||
<div class="mt" id="modtitle"></div>
|
||
<div class="md" id="moddata"></div>
|
||
</div>
|
||
|
||
<?php
|
||
if ($userclan->isAwaitingConfirmation()) {
|
||
exit('<div>Заявка на регистрацию клана ' . $userclan->printClan() . ' в процессе рассмотрения.</div>');
|
||
}
|
||
|
||
if (!$res) {
|
||
$clans = Db::getRows('select name, align, level from clan where status = 1 order by align, level desc, name');
|
||
?>
|
||
<script>document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));</script>
|
||
<div style="text-align: right;">
|
||
<input type="button" class="btn" value="Обновить" onclick="location='main.php?clan=1';">
|
||
<input type="button" class="btn" value="Вернуться" onclick="location='main.php';">
|
||
</div>
|
||
<div>Вы можете вступить в один из существующих кланов, либо же создать свой.</div>
|
||
<div style="border: 1px solid seashell; margin: 10px 0; padding: 0 10px;">
|
||
<h3>Заявка на регистрацию клана</h3>
|
||
<ul style="list-style: circle">
|
||
<li>При подаче заявки с вас снимается сумма необходимая для регистрации клана.</li>
|
||
<li>В случаи отказа в регистрации клана (по любой причине), еврокредиты возвращаются персонажу.</li>
|
||
<li>Администрация вправе отказать в регистрации без объяснения причин.</li>
|
||
<li style="color: crimson;">При регистрации клана, глава клана в течении 60 дней не имеет право передавать своё главенство другому игроку.</li>
|
||
<li>Стоимость регистрации клана: <?= Register::REGISTER_COST_EKR ?> екр.</li>
|
||
</ul>
|
||
<div style="margin: 0 50px;">
|
||
<?php if (Register::REGISTER_COST_EKR > $u->info['money2']): ?>
|
||
<span style="color: red">× У вас недостаточно еврокредитов! В наличии: <?= $u->info['money2'] ?> екр.</span>
|
||
<?php else: ?>
|
||
<?= Register::printForm() ?>
|
||
<?php endif; ?>
|
||
</div>
|
||
Дописать сам факт регистрации.
|
||
</div>
|
||
<div style="border: 1px solid seashell; margin: 10px 0; padding: 0 10px;">
|
||
<h3>Заявка на вступление в клан</h3>
|
||
<form method="post">
|
||
<?php foreach ($clans as $clan): ?>
|
||
<label>
|
||
<input type="radio" name="joinclan" value="<?= $clan['name'] ?>">
|
||
<img src="<?= Config::img() ?>/i/align/align<?= $clan['align'] ?>.gif" alt="Склонность"> <?= $clan['name'] ?> [<?= $clan['level'] ?>]
|
||
</label><br>
|
||
<?php endforeach; ?>
|
||
<button type="submit">Подать заявку</button>
|
||
</form>
|
||
Дописать логотип и, собственно, вступление.
|
||
</div>
|
||
<?php
|
||
exit;
|
||
}
|
||
?>
|
||
|
||
<?php
|
||
$storage = new ItemStorage();
|
||
|
||
if ($u->info['clan_prava'] != 'glava') {
|
||
if (isset($_GET['clan_exit']) && $u->newAct($_GET['sd4']) == true) {
|
||
if ($u->info['money'] >= 50) {
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> покинул клан. (50 кр.)';
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`, `time`, `ddmmyyyy`, `uid`, `ip`, `login`, `title`, `text`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . date(
|
||
'd.m.Y'
|
||
) . '", "0", "127.0.0.1", "Администрация", "Клановое сообщение", "' . mysql_real_escape_string(
|
||
$txt
|
||
) . '")'
|
||
);
|
||
if ($usr['level'] < 10) {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
}
|
||
$storage->remove(7);
|
||
} else {
|
||
echo '<script>setTimeout("alert(\'Для выхода из клана требуется наличие 50 кр.\');",500)</script>';
|
||
}
|
||
}
|
||
?>
|
||
<input style="float:right;margin:1px;margin-right:50px;color:red;" type="button" value="Покинуть клан (50 кр.)"
|
||
onClick="document.location='main.php?clan&clan_exit=1&sd4=<?= $u->info['nextAct'] ?>'">
|
||
<?php } ?>
|
||
<br>
|
||
<div class="section">
|
||
<div id="clanpanel">
|
||
<div class="head" style="position:relative"><img
|
||
src="//img.new-combats.tech/i/align/align<?= $res['align']; ?>.gif"
|
||
style="position:absolute;top:23px;left:40px;"/></div>
|
||
<div class="panel" style="white-space:nowrap;min-width:1000px;">
|
||
<div class="name" onclick='location.href="main.php?clan&events"' title="События клана"
|
||
style="cursor:pointer"><img class="clanicon"
|
||
src="//img.new-combats.tech/i/clan/<?= $res['name_mini']; ?>.gif"><?= $res['name']; ?>
|
||
</div>
|
||
<ul class="tabs">
|
||
<!--<li class="events"><a href="main.php?clan&events">События</a></li>-->
|
||
<?php if ($tt[11][0] == 1) { ?>
|
||
<li class="control"><a href="main.php?clan&control">Управление</a></li><?php } ?>
|
||
<?php if ($tt[3][0] == 1) { ?>
|
||
<li class="deposit"><a href="main.php?clan&deposit">Хранилище</a></li><?php } ?>
|
||
<?php if ($tt[11][0] > 0) { ?>
|
||
<li class="clanart"><a href="main.php?clan&titul">Титулы</a></li><?php } ?>
|
||
<li class="rules"><a href="main.php?clan&rules">Права</a></li>
|
||
<li class="info"><a href="main.php?clan&info">О клане</a></li>
|
||
<li class="members"><a href="main.php?clan&members">Соклановцы</a></li>
|
||
<?php if ($tt[12][0] == 1) { ?>
|
||
<li class="rules"><a href="main.php?clan&diplom">Дипломатия</a></li>
|
||
<?php } ?>
|
||
<li class="last"></li>
|
||
</ul>
|
||
</div>
|
||
<div class="foot"></div>
|
||
</div><?php if (isset($_GET['events'])) { ?>
|
||
<div class="box visible">
|
||
<style>
|
||
.leftimg {
|
||
float: left; /* Выравнивание по левому краю */
|
||
margin: 17px 17px 17px 7px; /* Отступы вокруг картинки */
|
||
}
|
||
|
||
.rightimg {
|
||
float: right; /* Выравнивание по правому краю */
|
||
margin: 17px 7px 17px 17px; /* Отступы вокруг картинки */
|
||
}
|
||
|
||
.dnbx {
|
||
width: 25px;
|
||
height: 22px;
|
||
background-color: #ecece4;
|
||
vertical-align: middle;
|
||
text-align: center;
|
||
display: inline-block;
|
||
margin: 1px;
|
||
padding-top: 3px;
|
||
cursor: default;
|
||
}
|
||
|
||
.dnbx1 {
|
||
width: 25px;
|
||
height: 22px;
|
||
background-color: #ecece4;
|
||
vertical-align: middle;
|
||
text-align: center;
|
||
display: inline-block;
|
||
margin: 1px;
|
||
padding-top: 3px;
|
||
cursor: default;
|
||
}
|
||
|
||
.dnbx5 {
|
||
height: 22px;
|
||
background-color: #ecece4;
|
||
vertical-align: middle;
|
||
text-align: center;
|
||
display: inline-block;
|
||
margin: 1px;
|
||
padding-top: 3px;
|
||
cursor: default;
|
||
}
|
||
|
||
.dnbx:hover {
|
||
width: 25px;
|
||
height: 22px;
|
||
background-color: #dbdad5;
|
||
vertical-align: middle;
|
||
text-align: center;
|
||
display: inline-block;
|
||
margin: 1px;
|
||
padding-top: 3px;
|
||
cursor: default;
|
||
}
|
||
|
||
.dnbx2 {
|
||
width: 25px;
|
||
height: 22px;
|
||
background-color: #b5b4b1;
|
||
color: #ecebe6;
|
||
vertical-align: middle;
|
||
text-align: center;
|
||
display: inline-block;
|
||
margin: 1px;
|
||
padding-top: 3px;
|
||
cursor: default;
|
||
}
|
||
</style>
|
||
<?php if ($tt[7][0] > 0 && $u->info['room'] != 263) { ?>
|
||
<fieldset>
|
||
<?php
|
||
} ?>
|
||
|
||
<fieldset style="border:1px dashed #eeeeee">
|
||
<legend><span class="legtitle">События</span></legend>
|
||
<?php
|
||
|
||
$c_r = '';
|
||
$c_c = '';
|
||
$c_p = '';
|
||
|
||
if (isset($_GET['add'], $_POST['textadd']) && $tt[2][0] == 1) {
|
||
$lmsg = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id` FROM `clan_news` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > ' . (time() - 10) . ' LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($lmsg['id'])) {
|
||
$c_r .= '<font color="#FF0000"><b>Нельзя добавлять сообщения чаще одного раза в 10 секунд</b></font><br>';
|
||
} else {
|
||
$tadd = htmlspecialchars($_POST['textadd'], null);
|
||
$ttadd = htmlspecialchars($_POST['titleadd'], null);
|
||
if (str_replace(' ', '', str_replace(' ', '', $tadd)) == '') {
|
||
$c_r .= '<font color="#FF0000"><b>Нельзя отправлять пустое событие</b></font><br>';
|
||
} elseif (str_replace(' ', '', str_replace(' ', '', $ttadd)) == '') {
|
||
$c_r .= '<font color="#FF0000"><b>Нельзя отправлять пустой заголовок</b></font><br>';
|
||
} else {
|
||
$tadd = str_replace("\n", '<br>', $tadd);
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","' . $u->info['id'] . '","' . $u->info['ip'] . '","' . $u->info['login'] . '","' . mysql_real_escape_string(
|
||
$ttadd
|
||
) . '","' . mysql_real_escape_string($tadd) . '"
|
||
)'
|
||
);
|
||
$c_r .= '<font color="#FF0000"><b>Событие было успешно добавлено</b></font><br>';
|
||
}
|
||
}
|
||
} elseif (isset($_GET['delete']) && $tt[2][0] == 1) {
|
||
$upd = mysql_query(
|
||
'UPDATE `clan_news` SET `delete` = "' . $u->info['id'] . '" WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0" AND `uid` != "0" AND `id` = "' . mysql_real_escape_string(
|
||
$_GET['delete']
|
||
) . '" LIMIT 1'
|
||
);
|
||
if ($upd) {
|
||
$c_r .= '<font color="#FF0000"><b>Событие было успешно удалено</b></font><br>';
|
||
} else {
|
||
$c_r .= '<font color="#FF0000"><b>Событие не найдено</b></font><br>';
|
||
}
|
||
}
|
||
|
||
$dd = date('d');
|
||
$mm = date('m');
|
||
$yy = date('Y');
|
||
|
||
if (isset($_GET['mm'])) {
|
||
$mm = ceil((int)$_GET['mm']);
|
||
}
|
||
if (isset($_GET['dd'])) {
|
||
$dd = ceil((int)$_GET['dd']);
|
||
}
|
||
if (isset($_GET['yy'])) {
|
||
$yy = ceil((int)$_GET['yy']);
|
||
}
|
||
|
||
$mml = ceil($mm) - 1;
|
||
$mmr = ceil($mm) + 1;
|
||
$yyl = $yy;
|
||
$yyr = $yy;
|
||
if ($mml < 1) {
|
||
$yyl--;
|
||
$mml = 12;
|
||
}
|
||
if ($mmr > 12) {
|
||
$yyr++;
|
||
$mmr = 1;
|
||
}
|
||
$dds = ['', 'пн', 'вт', 'ср', 'чт', 'пт', '<font color="#981115">сб</font>', '<font color="#981115">вс</font>'];
|
||
$mms = ['', 'январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'];
|
||
$num = 0;
|
||
$lday = 0;
|
||
for ($i = 0; $i < 7; $i++) {
|
||
$dayofweek = date('w', mktime(0, 0, 0, $mm, $day_count, $yy));
|
||
$dayofweek = $dayofweek - 1;
|
||
if ($dayofweek == -1) {
|
||
$dayofweek = 6;
|
||
}
|
||
|
||
if ($dayofweek == $i) {
|
||
$week[$num][$i] = $day_count;
|
||
$lday = $day_count;
|
||
$day_count++;
|
||
} else {
|
||
$week[$num][$i] = "";
|
||
}
|
||
}
|
||
|
||
function freenews($d, $m, $y)
|
||
{
|
||
global $res;
|
||
$r = $d;
|
||
if ($d < 9) {
|
||
$d = '0' . $d;
|
||
}
|
||
if ($m < 9) {
|
||
$m = '0' . ((int)$m);
|
||
}
|
||
$n = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id` FROM `clan_news` WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0" AND `ddmmyyyy` = "' . $d . '.' . $m . '.' . $y . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($n['id'])) {
|
||
$r = '<a style="text-decoration:underline;" href="?clan&events&ftr=1&mm=' . $m . '&yy=' . $y . '&dd=' . $d . '">' . $r . '</a>';
|
||
}
|
||
return $r;
|
||
}
|
||
|
||
$i = 1;
|
||
$c_c .= '<div style="width:260px;border:1px solid #9d9d9d;padding:10px;background-color:#ecebe7">';
|
||
if ($tt[2][0] > 0) {
|
||
$c_c .= '<center><input type="button" value="Добавить событие" onClick="addNewEvent();"></center><br>';
|
||
}
|
||
$c_c .= '<div><span style="float:left" class="dnbx" title="' . $mms[$mml] . ' ' . $yyl . '" onclick="location=\'?clan&events&mm=' . $mml . '&yy=' . $yyl . '\'"><</span><span style="float:right" class="dnbx" onclick="location=\'?clan&events&mm=' . $mmr . '&yy=' . $yyr . '\'" title="' . $mms[$mmr] . ' ' . $yyr . '">></span><center class="dnbx5">' . $yy . ' ' . $mms[ceil(
|
||
$mm
|
||
)] . '</center></div><br>';
|
||
while ($i <= 49) {
|
||
if ($i <= 7) {
|
||
$c_c .= '<small class="dnbx1"><b>' . $dds[$i] . '</b></small>';
|
||
} else {
|
||
if ($i - 7 > 7) {
|
||
$lday++;
|
||
if (date('d', mktime(0, 0, 0, $mm, $lday)) == $lday) {
|
||
if ($lday == date('d') && $mm == ceil(date('m')) && $yy == date('Y')) {
|
||
$c_c .= '<span class="dnbx2">' . freenews($lday, $mm, $yy) . '</span>';
|
||
} else {
|
||
$c_c .= '<span class="dnbx">' . freenews($lday, $mm, $yy) . '</span>';
|
||
}
|
||
} else {
|
||
$c_c .= '<span class="dnbx1"> </span>';
|
||
}
|
||
} else {
|
||
if ($week[0][$i - 8] > 0) {
|
||
if ($week[0][$i - 8] == date('d') && $mm == ceil(date('m')) && $yy == date('Y')) {
|
||
$c_c .= '<span class="dnbx2">' . freenews(
|
||
$week[0][$i - 8], $mm, $yy
|
||
) . '</span>';
|
||
} else {
|
||
$c_c .= '<span class="dnbx"">' . freenews(
|
||
$week[0][$i - 8], $mm, $yy
|
||
) . '</span>';
|
||
}
|
||
} elseif ($lday > 0) {
|
||
$c_c .= '<span class="dnbx1"> </span>';
|
||
}
|
||
}
|
||
}
|
||
if ($i == 7 || $i == 14 || $i == 21 || $i == 28 || $i == 35 || $i == 42) {
|
||
if ($lday > 0 || $i != 14) {
|
||
$c_c .= '<br>';
|
||
}
|
||
}
|
||
$i++;
|
||
}
|
||
$c_c .= '</div>';
|
||
|
||
if ($tt[1][0] == 1) {
|
||
$cnftr = '';
|
||
if (isset($_GET['ftr'])) {
|
||
if ($_GET['ftr'] == 1) {
|
||
$dd1 = $dd;
|
||
$mm1 = $mm;
|
||
$yy1 = $yy;
|
||
if ($dd1 < 9) {
|
||
$dd1 = '0' . $dd1;
|
||
}
|
||
if ($mm1 < 9) {
|
||
$mm1 = '0' . $mm1;
|
||
}
|
||
$cnftr = ' AND `ddmmyyyy` = "' . mysql_real_escape_string(
|
||
$dd1 . '.' . $mm1 . '.' . $yy1
|
||
) . '"';
|
||
}
|
||
}
|
||
$pg = round((int)$_GET['pg']);
|
||
if ($pg < 1) {
|
||
$pg = 1;
|
||
}
|
||
$pgssee = ceil(($pg - 1) * 5);
|
||
|
||
$pgs = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT COUNT(`id`) FROM `clan_news` WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0"' . $cnftr
|
||
)
|
||
);
|
||
$pgs = $pgs[0];
|
||
$pga = ceil($pgs / 5);
|
||
|
||
$i = 1;
|
||
while ($i <= $pga) {
|
||
if ($pg == $i) {
|
||
$c_p .= ' <b>' . $i . '</b> ';
|
||
} else {
|
||
if (isset($_GET['ftr'])) {
|
||
$c_p .= ' <a href="?clan&events&dd=' . $dd . '&mm=' . $mm . '&yy=' . $yy . '&ftr=' . $_GET['ftr'] . '&pg=' . $i . '">' . $i . '</a> ';
|
||
} else {
|
||
$c_p .= ' <a href="?clan&events&pg=' . $i . '">' . $i . '</a> ';
|
||
}
|
||
}
|
||
$i++;
|
||
}
|
||
|
||
if ($c_p != '') {
|
||
$c_p = 'Страицы: ' . $c_p;
|
||
}
|
||
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_news` WHERE `clan` = "' . $res['id'] . '" AND `delete` < 1' . $cnftr . ' ORDER BY `id` DESC LIMIT ' . mysql_real_escape_string(
|
||
$pgssee
|
||
) . ',5'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
if ($pl['uid'] > 0) {
|
||
$login = User::getLogin($pl['uid']);
|
||
if ($tt[2][0] == 1) {
|
||
$pl['text'] = '<img src="' . Config::img() . '/i/clear.gif" width="13" height="13" title="Удалить событие" class="leftimg" style="cursor:pointer" onclick="location=\'main.php?clan&events&pg=' . ceil(
|
||
$pg
|
||
) . '&delete=' . $pl['id'] . '\'">' . $pl['text'];
|
||
}
|
||
} else {
|
||
$login = '';
|
||
}
|
||
|
||
$c_r .= '
|
||
<table width="100%" border="0" style="border:1px solid #aeaeae" cellspacing="0" cellpadding="5">
|
||
<tr>
|
||
<td bgcolor="#c4c3c1"><div style="float:left"><i>' . date(
|
||
'd.m.Y H:i', $pl['time']
|
||
) . '</i> <a class="a" href="javascript:void(0)">' . $pl['title'] . '</a></div><div style="float:right">' . $login . '</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>' . $pl['text'] . '</td>
|
||
</tr>
|
||
</table><br>';
|
||
}
|
||
}
|
||
if ($c_r == '') {
|
||
$c_r .= '<br><br><br><br><br><br><br><br><center><b>Событий пока нет или глава клана не предоставил вам к ним доступ</b></center>';
|
||
}
|
||
|
||
?>
|
||
<table width="100%" border="0" cellspacing="0" cellpadding="10">
|
||
<tr>
|
||
<td align="left" valign="top"><?= $c_r ?></td>
|
||
<td width="300" align="center" valign="top"><?= $c_c ?></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="right" valign="top"><?= $c_p ?></td>
|
||
<td align="left" valign="top"> </td>
|
||
</tr>
|
||
</table>
|
||
</fieldset>
|
||
</div>
|
||
<?php }elseif (isset($_GET['control'])) { ?>
|
||
<script>
|
||
function changeLogin(selObj) {
|
||
selid = selObj.options[selObj.selectedIndex].value;
|
||
$('#sn_titul').val($('#slg' + selid).attr('vtitul'));
|
||
$('#sn_zvanie').val($('#slg' + selid).attr('vzvanie'));
|
||
$('#sn_canals').val($('#slg' + selid).attr('vcanals'));
|
||
|
||
if ($('#slg' + selid).attr('vtitul') == 'глава клана') {
|
||
$('#rp_titul').attr({'disabled': 'disabled'});
|
||
$('#sn_zvanie').attr({'disabled': 'disabled'});
|
||
$('#sn_canals').attr({'disabled': 'disabled'});
|
||
$('#rp_save').attr({'disabled': 'disabled'});
|
||
} else {
|
||
$('#rp_titul').attr({'disabled': false});
|
||
$('#sn_zvanie').attr({'disabled': false});
|
||
$('#sn_canals').attr({'disabled': false});
|
||
$('#rp_save').attr({'disabled': false});
|
||
}
|
||
}
|
||
</script>
|
||
<div class="box visible">
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Тип управления кланом: <a
|
||
href="javascript:void(0)"><?php if ($res['politic'] == 1) { ?>Диктатура<?php } else { ?>Демократия<?php } ?></a>
|
||
</div>
|
||
<?php
|
||
$c_pr = [
|
||
100, //принять
|
||
50, //выгнать
|
||
100, //сменить главу
|
||
];
|
||
|
||
if (isset($_POST['svb_canals']) && $tt[11][0] == 1) {
|
||
echo '<font color="#FF0000"><b>Каналы чата сохранены</b></font><br>';
|
||
$res['canals'] = $_POST['svb_canals'];
|
||
$rce = explode();
|
||
$i = 1;
|
||
while ($i <= 9) {
|
||
|
||
$i++;
|
||
}
|
||
mysql_query(
|
||
'UPDATE `clan` SET `canals` = "' . mysql_real_escape_string(
|
||
$res['canals']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
} elseif (isset($_POST['svb_site']) && $tt[11][0] == 1) {
|
||
echo '<font color="#FF0000"><b>Клановый сайт сохранен</b></font><br>';
|
||
$res['site'] = $_POST['svb_site'];
|
||
$rce = explode();
|
||
$i = 1;
|
||
while ($i <= 9) {
|
||
|
||
$i++;
|
||
}
|
||
mysql_query(
|
||
'UPDATE `clan` SET `site` = "' . mysql_real_escape_string(
|
||
$res['site']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
|
||
} elseif (isset($_POST['svb_give_money']) && $tt[7][0] == 1) {
|
||
$mn = round((int)$_POST['svb_give_money'], 2);
|
||
if ($mn >= 0.01) {
|
||
if ($res['money1'] < $mn) {
|
||
echo '<font color="#FF0000"><b>В клане недостаточно средств</b></font><br>';
|
||
} else {
|
||
$res['money1'] -= $mn;
|
||
$u->info['money'] += $mn;
|
||
echo '<font color="#FF0000"><b>Вы успешно сняли с казны клана ' . $mn . ' кр.</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money1` = "' . mysql_real_escape_string(
|
||
$res['money1']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `users` SET `money` = "' . mysql_real_escape_string(
|
||
$u->info['money']
|
||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","1","' . $u->info['login'] . '","' . mysql_real_escape_string(
|
||
$mn
|
||
) . '","' . $u->info['id'] . '")'
|
||
);
|
||
}
|
||
}
|
||
} elseif (isset($_POST['svb_give_money2']) && $u->info['clan_prava'] == 'glava') {
|
||
$mn = round((int)$_POST['svb_give_money2'], 2);
|
||
if ($mn >= 0.01) {
|
||
if ($res['money2'] < $mn) {
|
||
echo '<font color="#FF0000"><b>В клане недостаточно Екр.</b></font><br>';
|
||
} else {
|
||
|
||
$res['money2'] -= $mn;
|
||
$u->info['money2'] += $mn;
|
||
echo '<font color="#FF0000"><b>Вы успешно сняли с казны клана ' . $mn . ' Екр.</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money2` = "' . mysql_real_escape_string(
|
||
$res['money2']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `users` SET `money2` = "' . mysql_real_escape_string(
|
||
$u->info['money2']
|
||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . (mysql_real_escape_string(
|
||
$mn
|
||
) * -1) . '","' . $u->info['id'] . '")'
|
||
);
|
||
|
||
}
|
||
}
|
||
} elseif (isset($_POST['svb_take_money']) && $tt[6][0] == 1) {
|
||
$mn = round((int)$_POST['svb_take_money'], 2);
|
||
if ($mn >= 0.01) {
|
||
if ($u->info['money'] < $mn) {
|
||
echo '<font color="#FF0000"><b>У вас недостаточно средств</b></font><br>';
|
||
} elseif ($res['money1'] + $mn > 99999) {
|
||
echo '<font color="#FF0000"><b>В казне клана не может быть больше 99999кр.</b></font><br>';
|
||
} else {
|
||
$res['money1'] += $mn;
|
||
$u->info['money'] -= $mn;
|
||
echo '<font color="#FF0000"><b>Вы успешно положили в казну клана ' . $mn . ' кр.</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money1` = "' . mysql_real_escape_string(
|
||
$res['money1']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `users` SET `money` = "' . mysql_real_escape_string(
|
||
$u->info['money']
|
||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","2","' . $u->info['login'] . '","' . mysql_real_escape_string(
|
||
$mn
|
||
) . '","' . $u->info['id'] . '")'
|
||
);
|
||
}
|
||
}
|
||
} elseif (isset($_POST['svb_take_money2']) && $tt[6][0] == 1) {
|
||
$mn = round((int)$_POST['svb_take_money2'], 2);
|
||
if ($mn >= 0.01) {
|
||
if ($u->info['money2'] < $mn) {
|
||
echo '<font color="#FF0000"><b>У вас недостаточно Екр.</b></font><br>';
|
||
} else {
|
||
$maxs = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT SUM(`val`) AS val FROM `clan_operations` WHERE `uid` = "' . $u->info['id'] . '" AND `clan` = "' . $res['id'] . '" AND `type` = 3'
|
||
)
|
||
);
|
||
if (!isset($maxs['val'])) {
|
||
$maxs['val'] = 0;
|
||
}
|
||
if ($maxs['val'] + $mn > 100) {
|
||
echo '<font color="#FF0000"><b>Максимальная сумма взноса: 100 Екр. Можете положить еще: ' . (100 - $maxs['val']) . ' Екр.</b></font><br>';
|
||
} else {
|
||
$res['money2'] += $mn;
|
||
$u->info['money2'] -= $mn;
|
||
echo '<font color="#FF0000"><b>Вы успешно положили в казну клана ' . $mn . ' екр.</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money2` = "' . mysql_real_escape_string(
|
||
$res['money2']
|
||
) . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `users` SET `money2` = "' . mysql_real_escape_string(
|
||
$u->info['money2']
|
||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . mysql_real_escape_string(
|
||
$mn
|
||
) . '","' . $u->info['id'] . '")'
|
||
);
|
||
}
|
||
}
|
||
}
|
||
} elseif (isset($_POST['invite']) && ($_POST['invite'] == 'Принять' || $_POST['invite'] == 'Выгнать' || $_POST['invite'] == 'Назначить') && $tt[11][0] == 1) {
|
||
if ($_POST['invite'] == "Выгнать" && $tt[10][0] == 1) {
|
||
$usr = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string(
|
||
$_POST['logingo']
|
||
) . '" AND `clan` = "' . $res['id'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
//$ttus = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "'.$usr['clan_prava'].'" LIMIT 1'));
|
||
if (!isset($usr['id'])) {
|
||
echo '<font color="#FF0000"><b>Игрок не найден в клане</b></font><br>';
|
||
} elseif ($tt['prioritet'] >= $utitl['prioritet']) {
|
||
echo '<font color="#FF0000"><b>Игрок старше вас по званию, либо звания совпадают</b></font><br>';
|
||
} elseif ($u->info['money'] < $c_pr[1]) {
|
||
echo '<font color="#FF0000"><b>У вас не достаточно кр. для исключения игрока из клана (Требуется: ' . $c_pr[1] . ' кр.)</b></font><br>';
|
||
} elseif ($usr['clan_prava'] == 'galva' && $u->info['clan_prava'] != 'glava') {
|
||
echo '<font color="#FF0000"><b>Игрок старше вас по званию, либо звания совпадают</b></font><br>';
|
||
} else {
|
||
$storage->remove(8);
|
||
if ($usr['level'] < 10) {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "0" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "' . time() . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
}
|
||
$u->info['money'] -= $c_pr[1];
|
||
mysql_query(
|
||
'UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
$c_r .= '<font color="#FF0000"><b>Игрок "' . $usr['login'] . '" был исключен из клана за ' . $c_pr[1] . ' кр.</b></font><br>';
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> исключил из клана игрока <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $usr['login'] . '</a>[' . $usr['level'] . ']<a target="_blank" title="Инф. о ' . $usr['login'] . '" href="info/' . $usr['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $usr['cityreg'] . '.gif"></a>';
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","0","127.0.0.1","Администрация","Клановое сообщение","' . mysql_real_escape_string(
|
||
$txt
|
||
) . '"
|
||
)'
|
||
);
|
||
}
|
||
} elseif ($_POST['invite'] == "Назначить" && $u->info['clan_prava'] == 'glava') {
|
||
$usr = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string(
|
||
$_POST['logingo']
|
||
) . '" AND `clan` = "' . $res['id'] . '" AND `banned` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($usr['id'])) {
|
||
echo '<font color="#FF0000"><b>Игрок не найден в клане</b></font><br>';
|
||
} elseif ($u->info['money'] < $c_pr[2]) {
|
||
echo '<font color="#FF0000"><b>У вас не достаточно кр. для назначения игрока на пост главы клана (Требуется: ' . $c_pr[2] . ' кр.)</b></font><br>';
|
||
} elseif ($usr['clan_prava'] == 'galva') {
|
||
echo '<font color="#FF0000"><b>Игрок уже является главой клана</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = "glava", `clan` = "' . $res['id'] . '", `mod_zvanie` = "глава клана", `align` = "' . $res['align'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
$u->info['money'] -= $c_pr[2];
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = "2", `mod_zvanie` = "новичок", `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
$c_r .= '<font color="#FF0000"><b>Игрок "' . $usr['login'] . '" был назначен главой клан за ' . $c_pr[0] . ' кр.</b></font><br>';
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> назначил игрока <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $usr['login'] . '</a>[' . $usr['level'] . ']<a target="_blank" title="Инф. о ' . $usr['login'] . '" href="info/' . $usr['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $usr['cityreg'] . '.gif"></a> на должность <b>Главы клана</b>';
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","0","127.0.0.1","Администрация","Клановое сообщение","' . mysql_real_escape_string(
|
||
$txt
|
||
) . '"
|
||
)'
|
||
);
|
||
}
|
||
} elseif ($_POST['invite'] == "Принять" && $tt[9][0] == 1) {
|
||
$is_cl = Db::getValue('select count(*) from users where clan = ?', [$res['id']]);
|
||
$usr = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string(
|
||
$_POST['logingo']
|
||
) . '" AND `clan` != "' . $res['id'] . '" AND `clan_zv` = "' . $res['id'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($usr['id'])) {
|
||
echo '<font color="#FF0000"><b>Подходящий игрок не найден или не подал заявку в Ваш клан.</b></font><br>';
|
||
} elseif ($usr['clan_prava'] == 'galva') {
|
||
echo '<font color="#FF0000"><b>Игрок уже является главой клана</b></font><br>';
|
||
} elseif ($usr['clan_delay'] + 10 * 24 * 60 * 60 > time()) {
|
||
echo '<font color="#FF0000"><b>У игрока задержка на вступление в клан до ' . date(
|
||
'd.m.Y H:i', $usr['clan_delay'] + 10 * 24 * 60 * 60
|
||
) . '</b></font><br>';
|
||
} elseif ($u->info['money'] < $c_pr[0]) {
|
||
echo '<font color="#FF0000"><b>У вас не достаточно кр. для приема игрока в клан (Требуется: ' . $c_pr[0] . ' кр.)</b></font><br>';
|
||
} elseif ($usr['clan'] != '0' || $usr['align'] != '0') {
|
||
echo '<font color="#FF0000"><b>Персонаж уже находится в клане, либо имеет склонность</b></font><br>';
|
||
} elseif ($is_cl >= $lvl_prava[$res['level']][0]) {
|
||
echo '<font color="#FF0000"><b>Достигнут лимит приглашений. Повысте уровень клана.</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = "2",`clan` = "' . $res['id'] . '",`mod_zvanie` = "",`align` = "' . $res['align'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
$u->info['money'] -= $c_pr[0];
|
||
mysql_query(
|
||
'UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Игрок "' . $usr['login'] . '" был принят в клан за ' . $c_pr[0] . ' кр.</b></font><br>';
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> принял в клан игрока <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $usr['login'] . '</a>[' . $usr['level'] . ']<a target="_blank" title="Инф. о ' . $usr['login'] . '" href="info/' . $usr['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $usr['cityreg'] . '.gif"></a>';
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","0","127.0.0.1","Администрация","Клановое сообщение","' . mysql_real_escape_string(
|
||
$txt
|
||
) . '"
|
||
)'
|
||
);
|
||
}
|
||
}
|
||
}
|
||
?>
|
||
<?php if ($tt[9][0] > 0) { ?>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<input style="width:144px;" value="Пригласить в клан"
|
||
onClick="openMod('<b>Пригласить игрока в клан</b>','<form action=\'main.php?clan&control&priem\' method=\'post\'>Логин: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"
|
||
type="button"/>
|
||
(это вам обойдется в <?= $c_pr[0] ?><b> кр.</b>)<br/>
|
||
(Для приема в клан персонаж должен подать заявку через Регистратуру Кланов)<br/>
|
||
Список подавших заявку:
|
||
<?php
|
||
|
||
$spnew = mysql_query('SELECT * FROM `users` WHERE `clan_zv`="' . $res['id'] . '" AND `clan`= 0');
|
||
while ($plnew = mysql_fetch_array($spnew)) {
|
||
echo '<b>' . $plnew['login'] . '[' . $plnew['level'] . ']</b><a href="/info/' . $plnew['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a>';
|
||
}
|
||
|
||
?>
|
||
<br/>
|
||
</div>
|
||
<?php } ?>
|
||
<?php if ($tt[10][0] > 0) { ?>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<input type="button" style="width:144px;" value="Выгнать из клана"
|
||
onClick="openMod('<b>Выгнать игрока из клана</b>','<form action=\'main.php?clan&control&unpriem\' method=\'post\'>Логин: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Выгнать\'></form>');">
|
||
(это вам обойдется в <?= $c_pr[1] ?><b> кр.</b>)<br/>
|
||
</div>
|
||
<?php } ?>
|
||
<?php if ($u->info['clan_prava'] == 'glava') { ?>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<input style="width:144px;" value="Сменить главу клана"
|
||
onClick="openMod('<b>Назначить главу клана</b>','<form action=\'main.php?clan&control&newglava\' method=\'post\'>Логин: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Назначить\'></form>');"
|
||
type="button"/> (глава клана вправе сложить с себя полномочия, назначив главой клана другого
|
||
персонажа)<br/>
|
||
<br>
|
||
<form method="post" enctype="multipart/form-data" action="?clan&control&save_canals">
|
||
<div style="display:inline-block;width:150px;">Клан сайт:</div>
|
||
<input style="width:211px;" id="svb_canals" value="<?= $res['site'] ?>" name="svb_site" type="text"/>
|
||
<input name="Отправить" type="submit" id="rp_save" value="Сохранить"/><br/>
|
||
</div>
|
||
</form>
|
||
|
||
<!-- ТУТ -->
|
||
</div>
|
||
<?php } ?>
|
||
<?php if ($tt[11][0] > 0) { ?>
|
||
<fieldset>
|
||
<legend><span class="legtitle">Редактирование статуса персонажа</span></legend>
|
||
<?php
|
||
if (isset($_GET['saveuser']) && $tt[11][0] == 1) {
|
||
//[rp_login] => 0 [rp_titul] => 0 [rp_zvanie] => [rp_canals] =>
|
||
$c_r = '';
|
||
$usr = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `users` WHERE `id` = "' . mysql_real_escape_string(
|
||
$_POST['rp_login']
|
||
) . '" AND `clan` = "' . $res['id'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($usr['id'])) {
|
||
if ($usr['clan_prava'] != 'glava') {
|
||
$tt = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "' . $usr['clan_prava'] . '" LIMIT 1')
|
||
);
|
||
if ($tt['prioritet'] < $utitl['prioritet']) {
|
||
//новый титул
|
||
if ((int)$_POST['rp_titul'] > 0) {
|
||
$tt_new = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `id` = "' . mysql_real_escape_string(
|
||
$_POST['rp_titul']
|
||
) . '" AND `clan` = "' . $res['id'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($tt_new['id'])) {
|
||
if ($tt_new['prioritet'] < $utitl['prioritet']) {
|
||
mysql_query(
|
||
'UPDATE `users` SET `clan_prava` = "' . $tt_new['id'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
$c_r .= '<font color="#FF0000"><b>Игроку "' . $usr['login'] . '" был присвоен титул "' . $tt_new['name'] . '"</b></font><br>';
|
||
if ($tt_new['prioritet'] < $tt['prioritet']) {
|
||
//понижен
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> понизил титул игроку <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $usr['login'] . '</a>[' . $usr['level'] . ']<a target="_blank" title="Инф. о ' . $usr['login'] . '" href="info/' . $usr['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $usr['cityreg'] . '.gif"></a> до "<b>' . $tt_new['name'] . '</b>"';
|
||
} else {
|
||
//присвоен
|
||
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> присвоил титул "<b>' . $tt_new['name'] . '</b>" игроку <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $usr['login'] . '</a>[' . $usr['level'] . ']<a target="_blank" title="Инф. о ' . $usr['login'] . '" href="info/' . $usr['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $usr['cityreg'] . '.gif"></a>';
|
||
}
|
||
|
||
mysql_query(
|
||
'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES (
|
||
"' . $res['id'] . '","' . time() . '","' . date(
|
||
'd.m.Y'
|
||
) . '","0","127.0.0.1","Администрация","Клановое сообщение","' . mysql_real_escape_string(
|
||
$txt
|
||
) . '"
|
||
)'
|
||
);
|
||
|
||
} else {
|
||
$c_r .= '<font color="#FF0000"><b>Вы не можете назначать титул старше вашего титула</b></font><br>';
|
||
}
|
||
}
|
||
}
|
||
mysql_query(
|
||
'UPDATE `users` SET `mod_zvanie` = "' . mysql_real_escape_string(
|
||
$_POST['rp_zvanie']
|
||
) . '",`ccanals` = "' . mysql_real_escape_string(
|
||
$_POST['rp_canals']
|
||
) . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
|
||
);
|
||
$c_r .= '<font color="#FF0000"><b>Информация успешно сохранена</b></font><br>';
|
||
|
||
} else {
|
||
$c_r .= '<font color="#FF0000"><b>Игрок старше вас по званию, либо звания совпадают</b></font><br>'; // Тут
|
||
}
|
||
} else {
|
||
$c_r .= '<font color="#FF0000"><b>Игрок старше вас по званию, либо звания совпадают</b></font><br>';
|
||
}
|
||
} else {
|
||
$c_r .= '<font color="#FF0000"><b>Игрок не состоит в клане ' . $res['name'] . '</b></font><br>';
|
||
}
|
||
}
|
||
echo $c_r;
|
||
?>
|
||
<form method="post" action="main.php?clan&control&saveuser">
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Логин:</div>
|
||
<select onchange="changeLogin(this);" style="width:211px;" name="rp_login">
|
||
<option value="0" style="color:#CCCCCC">выберите логин</option>
|
||
<?php
|
||
$sp = mysql_query(
|
||
'SELECT `id`,`login`,`clan_prava`,`ccanals`,`mod_zvanie` FROM `users` WHERE `clan` = "' . $res['id'] . '"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$cp = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `id` = "' . mysql_real_escape_string(
|
||
$pl['clan_prava']
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if ($pl['clan_prava'] == 'glava') {
|
||
$cp['name'] = 'глава клана';
|
||
}
|
||
echo '<option id="slg' . $pl['id'] . '" value="' . $pl['id'] . '" vtitul="' . $cp['name'] . '" vzvanie="' . $pl['mod_zvanie'] . '" vcanals="' . $pl['ccanals'] . '">' . $pl['login'] . '</option>';
|
||
}
|
||
?></select>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Титул:</div>
|
||
<input id="sn_titul" style="width:211px;" disabled="disabled" name="rp_canals" type="text"/>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Присвоить титул:</div>
|
||
<select style="width:211px;" id="rp_titul" name="rp_titul">
|
||
<option value="0" style="color:#CCCCCC">не менять</option>
|
||
<?php
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0" LIMIT 25'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
echo '<option value="' . $pl['id'] . '">' . $pl['name'] . '</option>';
|
||
}
|
||
?></select>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Реликты</div>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Звание в клане:</div>
|
||
<input style="width:211px;" id="sn_zvanie" name="rp_zvanie" type="text"/>
|
||
</div>
|
||
<div>
|
||
<div style="display:inline-block;width:150px;">Каналы чата:</div>
|
||
<input style="width:211px;" id="sn_canals" name="rp_canals" type="text"/><br/>
|
||
<small>(Перепешите через запятую номера доступных каналов. Например: 1,3,7. Доступные каналы:
|
||
1-9)</small> <input name="Отправить" type="submit" id="rp_save" value="Сохранить"/>
|
||
</div>
|
||
</form>
|
||
</fieldset>
|
||
<form method="post" enctype="multipart/form-data" action="?clan&control&save_canals">
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-top:10px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:150px;">Каналы чата:</div>
|
||
<input style="width:211px;" id="svb_canals" value="<?= $res['canals'] ?>" name="svb_canals"
|
||
type="text"/> <input name="Отправить" type="submit" id="rp_save" value="Сохранить"/><br/>
|
||
<small>(Перепешите через запятую номера открытых каналов. Например: 2,4,8. Доступные каналы:
|
||
1-9)</small>
|
||
</div>
|
||
</form>
|
||
<?php } ?>
|
||
<?php if ($tt[5][0] == 1) { ?>
|
||
<?php if ($tt[7][0] > 0 && $res['money2'] > 0 && $u->info['admin'] > 0) { ?>
|
||
<fieldset>
|
||
<legend><span class="legtitle">Заказать изображение</span></legend>
|
||
<form action="?clan&control&buy_imgae" method="post" enctype="multipart/form-data">
|
||
<?php
|
||
/* Обработка изображения и данных */
|
||
|
||
if (isset($_GET['gdload'])) {
|
||
echo '<b style="color:red">Изображение было успешно загружено на сервер! Воспользоваться им возможно в инвентаре, в разделе "Галерея".</b><br>';
|
||
} elseif (isset($_POST['img_load1type'])) {
|
||
$data = [
|
||
'obraz' => $_FILES['load_image1'],
|
||
'sex' => round((int)$_POST['img_load3type']),
|
||
'w' => '',
|
||
'h' => '',
|
||
'type' => round((int)$_POST['img_load1type']),
|
||
'animation' => round((int)$_POST['img_load2type']),
|
||
];
|
||
|
||
$ers = '';
|
||
|
||
if ($data['sex'] != 0 && $data['sex'] != 1) {
|
||
$ers = 'Ошибка! Вы не выбрали пол кому будет доступно изображение!';
|
||
} elseif ($data['animation'] != 0 && $data['animation'] != 1) {
|
||
$ers = 'Ошибка! Вы не выбрали тип изображения: Анимированное, не анимированное!';
|
||
} elseif ($data['type'] < 1 || $data['type'] > 18) {
|
||
$ers = 'Ошибка! Вы не выбрали тип слота замещения изображения!';
|
||
}
|
||
|
||
$types = [
|
||
1 => ['Образ', 120, 220, 100],
|
||
2 => ['Заглушка (снизу)', 120, 40, 15],
|
||
3 => ['Заглушка (сверху)', 120, 20, 5],
|
||
4 => ['Шлем', 60, 60, 25],
|
||
5 => ['Наручи', 60, 40, 25],
|
||
6 => ['Левая рука', 60, 60, 25],
|
||
7 => ['Правая рука', 60, 60, 25],
|
||
8 => ['Броня', 60, 80, 25],
|
||
9 => ['Пояс', 60, 40, 25],
|
||
10 => ['Ботинки', 60, 40, 25],
|
||
11 => ['Поножи', 60, 80, 25],
|
||
12 => ['Перчатки', 60, 40, 25],
|
||
13 => ['Кольца №1', 20, 20, 10],
|
||
14 => ['Кулон', 60, 20, 25],
|
||
15 => ['Серьги', 60, 20, 25],
|
||
16 => ['Заглушка под информацию о персонаже', 244, 287, 5],
|
||
17 => ['Кольцо №2', 20, 20, 10],
|
||
18 => ['Кольцо №3', 20, 20, 10],
|
||
];
|
||
|
||
$data['price'] = $types[$data['type']][3];
|
||
|
||
|
||
if ($data['price'] > $res['money2']) {
|
||
$ers = 'Ошибка! В казне клана недостаточно Евро-кредитов для приобретения данного изображения.';
|
||
}
|
||
|
||
if ($ers != '') {
|
||
echo '<b style="color:red">' . $ers . '</b><br>';
|
||
} else {
|
||
/* Сохраняем изображение */
|
||
$imgname = md5(rand(0, 1000000000000) . '&' . rand(0, 10000000) . '&' . microtime());
|
||
$upload = new Uploader('load_image1', $imgname);
|
||
$upload->setMaxFileSize(.35);
|
||
$upload->setSavePath('clan_prw/');
|
||
$upload->setDimensions($types[$data['type']][1], $types[$data['type']][2]);
|
||
$file = $upload->saveimg();
|
||
|
||
if ($file) {
|
||
$size = getimagesize(
|
||
"/clan_prw/" . htmlspecialchars($file[1], null)
|
||
);
|
||
|
||
$bag = 0;
|
||
|
||
if ($types[$data['type']][1] != $size[0] || $types[$data['type']][2] != $size[1]) {
|
||
$bag = 1;
|
||
}
|
||
|
||
mysql_query(
|
||
'INSERT INTO `reimage` (`login`,`uid`,`time`,`src`,`clan`,`type`,`sex`,`animation`,`w`,`h`,`bag`) VALUES (
|
||
"' . $u->info['login'] . '",
|
||
"' . $u->info['id'] . '","' . time() . '",
|
||
"' . mysql_real_escape_string(htmlspecialchars($file[1], null)) . '",
|
||
"' . $u->info['clan'] . '",
|
||
"' . mysql_real_escape_string($data['type']) . '",
|
||
"' . mysql_real_escape_string($data['sex']) . '",
|
||
"' . mysql_real_escape_string($data['animation']) . '",
|
||
"' . mysql_real_escape_string((int)$size[0]) . '",
|
||
"' . mysql_real_escape_string((int)$size[1]) . '",
|
||
"' . $bag . '"
|
||
)'
|
||
);
|
||
|
||
$res['money2'] -= $data['price'];
|
||
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money2` = "' . $res['money2'] . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
die('<meta http-equiv="refresh" content="0; URL=/main.php?clan&control&gdload">');
|
||
} else {
|
||
|
||
echo '<b style="color:red">' . Uploader::$error . '</b><br>';
|
||
}
|
||
}
|
||
}
|
||
|
||
?>
|
||
<select name="img_load1type">
|
||
<option value="0"><b>Выберите тип изображения</b></option>
|
||
<option value="0"><b>Образ</b></option>
|
||
<option value="1">- Образ [Размер: 120x220] (100 екр.)</option>
|
||
<option value="2">- Заглушка (снизу) [Размер: 120x40] (15 екр.)</option>
|
||
<option value="3">- Заглушка (сверху) [Размер: 120x20] (5 екр.)</option>
|
||
<option value="0"><b>Слоты под обмундирование</b></option>
|
||
<option value="4">- Шлем [Размер: 60x60] (25 екр.)</option>
|
||
<option value="5">- Наручи [Размер: 60x40] (25 екр.)</option>
|
||
<option value="6">- Левая рука [Размер: 60x60] (25 екр.)</option>
|
||
<option value="7">- Правая рука [Размер: 60x60] (25 екр.)</option>
|
||
<option value="8">- Броня [Размер: 60x80] (25 екр.)</option>
|
||
<option value="9">- Пояс [Размер: 60x40] (25 екр.)</option>
|
||
<option value="10">- Ботинки [Размер: 60x40] (25 екр.)</option>
|
||
<option value="11">- Поножи [Размер: 60x80] (25 екр.)</option>
|
||
<option value="12">- Перчатки [Размер: 60x40] (25 екр.)</option>
|
||
<option value="13">- Кольца №1 [Размер: 20x20] (10 екр.)</option>
|
||
<option value="17">- Кольца №2 [Размер: 20x20] (10 екр.)</option>
|
||
<option value="18">- Кольца №3 [Размер: 20x20] (10 екр.)</option>
|
||
<option value="14">- Кулон [Размер: 60x20] (25 екр.)</option>
|
||
<option value="15">- Серьги [Размер: 60x20] (25 екр.)</option>
|
||
<option value="16">Заглушка под информацию о персонаже [Размер: 244x287] (5 екр.)</option>
|
||
</select><br/>
|
||
<select name="img_load2type" id="img_load2type">
|
||
<option value="0">Анимация (Отключена)</option>
|
||
<option>Анимация (Включена)(СТОИМОСТЬ ИЗОБРАЖЕНИЯ УДВАИВАЕТСЯ)</option>
|
||
</select><br/>
|
||
<select name="img_load3type" id="img_load3type">
|
||
<option value="-1">Выберите пол</option>
|
||
<option value="0">Для мужчин</option>
|
||
<option value="1">Для женщин</option>
|
||
</select><br/>
|
||
<small style="color:red;">Размер изображения не должен привышать 350 кб!</small>
|
||
<br/>
|
||
<input type="file" name="load_image1" id="load_image1"/>
|
||
<button type="submit">Отправить</button>
|
||
<br/>
|
||
<small style="color:red;">Внимание!</small>
|
||
<small> Изображения нарушающие правила игры, <a href="#">правила публикации изображения</a>, либо
|
||
содержащие элементы оскорбляющие достоинство других людей будут блокироваться без компенсации
|
||
денежных средств и без возможности замены изображения на новое.</small>
|
||
</form>
|
||
</fieldset>
|
||
<?php }
|
||
?>
|
||
<fieldset>
|
||
<legend><span class="legtitle">Казна клана</span></legend>
|
||
<form method="post" action="?clan&control&give_money">
|
||
Кр. в казне клана: <?= $res['money1'] ?>
|
||
<br/>
|
||
<?php if ($tt[7][0] > 0) { ?>
|
||
Забрать из казны Кр: <input id="svb_give_money" name="svb_give_money" value="0" type="text"/> <input
|
||
type="submit" value=">>"/>
|
||
<?php
|
||
}
|
||
?>
|
||
</form>
|
||
<?php if ($tt[6][0] > 0) { ?>
|
||
<form method="post" action="?clan&control&take_money">
|
||
<div style="border-top:1px solid #cac9c7;margin-top:5px;padding-top:5px;">
|
||
Положить Кр в казну: <input id="svb_take_money" name="svb_take_money" value="0" type="text"/>
|
||
<input type="submit" value=">>"/>
|
||
<small>(при себе: <?= $u->info['money'] ?>кр.)</small>
|
||
</div>
|
||
</form>
|
||
<?php } ?>
|
||
|
||
<hr>
|
||
<form method="post" action="?clan&control&give_money">
|
||
Екр. в казне клана: <?= $res['money2'] ?>. <br/>
|
||
<input type="button" value="Список операций"/><br/>
|
||
<?php if ($u->info['clan_prava'] == 'glava') { ?>
|
||
<br>
|
||
Забрать из казны Екр: <input id="svb_give_money2" name="svb_give_money2" value="0" type="text"/>
|
||
<input type="submit" value=">>"/>
|
||
<?php
|
||
|
||
}
|
||
?>
|
||
</form>
|
||
|
||
|
||
<?php if ($tt[6][0] > 0) { ?>
|
||
<form method="post" action="?clan&control&take_money">
|
||
<div style="border-top:1px solid #cac9c7;margin-top:5px;padding-top:5px;">
|
||
Положить Екр в казну: <input id="svb_take_money2" name="svb_take_money2" value="0" type="text"/>
|
||
<input type="submit" value=">>"/>
|
||
<small>(при себе: <?= $u->info['money2'] ?>кр.)</small>
|
||
</div>
|
||
</form>
|
||
|
||
<?php
|
||
}
|
||
?>
|
||
</fieldset>
|
||
<?php } ?>
|
||
<?php if ($tt[11][0] > 0 && $tt[3][0] == 1) { ?>
|
||
<form method="post" action="?clan&control&vipiska">
|
||
<div style="margin-top:5px;padding-top:5px;">
|
||
Заказать выписку для хранилища: <small>(услуга стоит 1кр.)</small> <input id="svb_vipiska"
|
||
name="svb_vipiska"
|
||
value="<?= date('d.m.Y') ?>"
|
||
type="text"/> <input
|
||
type="submit" value="Заказать"/>
|
||
</div>
|
||
</form>
|
||
<?php } ?>
|
||
</div>
|
||
<?php
|
||
} elseif (isset($_GET['diplom']) && $tt[12][0] == 1) {
|
||
|
||
if ($tt[14][0] == 1) {
|
||
if (isset($_GET['clanwars'])) {
|
||
//RadioGroup1
|
||
$cln = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan` WHERE `name` = "' . mysql_real_escape_string($_POST['logingo']) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($cln['id'])) {
|
||
$clntn = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $res['id'] . '" ORDER BY `id` DESC LIMIT 1 '
|
||
)
|
||
);
|
||
$clnta = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $cln['id'] . '" ORDER BY `id` DESC LIMIT 1 '
|
||
)
|
||
);
|
||
if ($cln['id'] == $res['id']) {
|
||
|
||
$rn = [
|
||
'<font color="#FF0000"><b>Остроумно, но здесь так делать нельзя :-)</b></font><br>',
|
||
'<font color="#FF0000"><b>Это будет очень сложно сделать, Ваши сокланы против!</b></font><br>',
|
||
'<font color="#FF0000"><b>Не уподобляйтесь большинству, защищайте интересы своего клана!</b></font><br>'];
|
||
echo $rn[rand(0, 2)];
|
||
} elseif ($clnta['global'] < $clntn['global'] / 2) {
|
||
echo '<font color="#FF0000"><b>Противник слишком слаб</b></font><br>';
|
||
} elseif ($cln['join1'] == $res['join1'] && $res['join1'] > 0) {
|
||
echo '<font color="#FF0000"><b>Вы состоите в союзе с этим кланом</b></font><br>';
|
||
} elseif ($cln['join2'] == $res['join2'] && $res['join2'] > 0) {
|
||
echo '<font color="#FF0000"><b>Вы состоите в альянсе с этим кланом</b></font><br>';
|
||
} else {
|
||
$lwar = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_wars` WHERE `time_finish` > ' . time() . ' AND ((`clan1` = "' . $cln['id'] . '" AND `clan2` = "' . $res['id'] . '") OR (`clan2` = "' . $cln['id'] . '" AND `clan1` = "' . $res['id'] . '")) LIMIT 1 '
|
||
)
|
||
);
|
||
if (!isset($lwar['id'])) {
|
||
$mkr = 10;
|
||
$tpcw = 1;
|
||
if ($_POST['RadioGroup1'] == 2) {
|
||
$mkr = 20;
|
||
$tpcw = 2;
|
||
}
|
||
if (isset($lwar['id'])) { // было true == true
|
||
echo '<font color="#FF0000"><b>Нельзя обьявить войну прямо сейчас</b></font><br>';
|
||
} elseif ($mkr > $res['money2']) {
|
||
echo '<font color="#FF0000"><b>В казне клана не достаточно средств</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `clan` SET `money2` = `money2` - ' . $mkr . ' WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_wars` (`clan1`,`clan2`,`time_start`,`time_finish`,`type`,`text`) VALUES ("' . $res['id'] . '","' . $cln['id'] . '","' . time() . '","' . (time() + 60 * 60 * 24) . '","' . $tpcw . '","Война!")'
|
||
);
|
||
mysql_query(
|
||
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","4","' . $u->info['login'] . '","clanwar_' . $mkr . '_' . $cln['id'] . '","' . $u->info['id'] . '")'
|
||
);
|
||
echo '<font color="#FF0000"><b>Вы успешно обьявили войну клану "' . $cln['name'] . '" за ' . $mkr . ' екр.</b></font><br>';
|
||
}
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Вы уже ведете войну с данным кланом</b></font><br>';
|
||
}
|
||
}
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Клан с таким названием не найден</b></font><br>';
|
||
}
|
||
}
|
||
}
|
||
|
||
?>
|
||
<br/><br/>
|
||
<fieldset>
|
||
<legend><span class="legtitle">Клановые войны</span></legend>
|
||
<?php
|
||
$warc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT COUNT(`id`) FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '" LIMIT 1'
|
||
)
|
||
);
|
||
$warc = $warc[0];
|
||
if ($tt[14][0] == 1) {
|
||
if ($warc < 3) {
|
||
?>
|
||
<input onClick="openMod('<b>Объявить войну клану</b>','<form action=\'main.php?clan&diplom&clanwars\' method=\'post\'>Название клана: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br><label><input type=\'radio\' name=\'RadioGroup1\' value=\'1\' id=\'RadioGroup1_0\'>Обычная война (10 екр.)</label><br><span style=\'float:left\'><label><input type=\'radio\' name=\'RadioGroup1\' value=\'2\' id=\'RadioGroup1_1\'>Кровавая война (20 екр.)</label></span><input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"
|
||
type="submit" name="button" id="button" value="Начать войну"/>
|
||
<?php
|
||
echo '<font color="#FF0000"><b>Зафиксированны войны: ' . $warc . ' шт.</b></font><br>';
|
||
} else {
|
||
echo '<font color="#FF0000"><b>У Вашего клана уже 3 и более войн</b></font><br>';
|
||
}
|
||
|
||
}
|
||
?>
|
||
<br/>
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<?php
|
||
$ms = '';
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$cln1 = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $pl['clan1'] . '" LIMIT 1')
|
||
);
|
||
$cln2 = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $pl['clan2'] . '" LIMIT 1')
|
||
);
|
||
$ms .= '<div style="border:1px solid #CECECE;padding:10px;">Война между кланами <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $cln1['name_mini'] . '.gif">' . $cln1['name'] . '</b> и <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $cln2['name_mini'] . '.gif">' . $cln2['name'] . '</b>.<br>';
|
||
if ($pl['text'] != '') {
|
||
$ms .= 'Причина войны: <i>' . $pl['text'] . '</i><br>';
|
||
}
|
||
$ms .= 'Время войны: ' . date('d.m.Y H:i', $pl['time_start']) . ' - ' . date(
|
||
'd.m.Y H:i', $pl['time_finish']
|
||
) . '</div>';
|
||
}
|
||
if ($ms == '') {
|
||
?>
|
||
В данный момент Ваш клан не ведет войн.
|
||
<?php
|
||
} else {
|
||
echo $ms;
|
||
}
|
||
?>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend><span class="legtitle">Союзы и альянсы</span></legend>
|
||
<?php if ($tt[13][0] == 1) {
|
||
if (isset($_GET['joint']) && $tt[13][0] == 1) {
|
||
if ($_GET['joint'] == 1) {
|
||
//вступление в союз
|
||
$nm = htmlspecialchars($_POST['logingo'], null);
|
||
$cnm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `name` = "' . mysql_real_escape_string(
|
||
$nm
|
||
) . '" AND `type` = "1" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($cnm['id'])) {
|
||
$cnmz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . $cnm['id'] . '" AND `clan` = "' . $res['id'] . '" AND `time_end` = "0" AND `time_start` = "0" AND `type` = "1" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($cnmz['id'])) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже подал заявку в данный союз</b></font><br>';
|
||
} elseif ($res['join1'] > 0) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже находится в союзе</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "' . $cnm['id'] . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Вы успешно подали заявку в союз "' . $cnm['name'] . '"</b></font><br>';
|
||
mysql_query(
|
||
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","1")'
|
||
);
|
||
}
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Альянс или союз с такиим названием не существует</b></font><br>';
|
||
}
|
||
} else {
|
||
//вступление в альянс
|
||
$nm = htmlspecialchars($_POST['logingo'], null);
|
||
$cnm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `name` = "' . mysql_real_escape_string(
|
||
$nm
|
||
) . '" AND `type` = "2" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($cnm['id'])) {
|
||
$cnmz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . $cnm['id'] . '" AND `clan` = "' . $res['id'] . '" AND `time_end` = "0" AND `time_start` = "0" AND `type` = "2" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($cnmz['id'])) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже подал заявку в данный альянс</b></font><br>';
|
||
} elseif ($res['join1'] == 0) {
|
||
echo '<font color="#FF0000"><b>Для вступления в альянс требуется вступить в союз</b></font><br>';
|
||
} elseif ($res['join2'] > 0) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже находится в альянсе</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "' . $cnm['id'] . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Вы успешно подали заявку в альянс "' . $cnm['name'] . '"</b></font><br>';
|
||
mysql_query(
|
||
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","2")'
|
||
);
|
||
}
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Альянс или союз с такиим названием не существует</b></font><br>';
|
||
}
|
||
}
|
||
} elseif (isset($_GET['newjoint']) && $tt[13][0] == 1) {
|
||
if ($_GET['newjoint'] == 1) {
|
||
//союзы
|
||
if ($res['join1'] > 0) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже состоит в союзе</b></font><br>';
|
||
} else {
|
||
$nm = htmlspecialchars($_POST['logingo'], null);
|
||
if (str_replace(' ', '', str_replace(' ', '', $nm)) == '') {
|
||
echo '<font color="#FF0000"><b>Введите название союза</b></font><br>';
|
||
} else {
|
||
$cnm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id` FROM `clan_joint` WHERE `name` = "' . mysql_real_escape_string(
|
||
$nm
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($cnm['id'])) {
|
||
mysql_query(
|
||
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string(
|
||
$nm
|
||
) . '","1","' . $res['id'] . '","' . $res['id'] . '")'
|
||
);
|
||
$id = mysql_insert_id();
|
||
$res['join1'] = $id;
|
||
mysql_query(
|
||
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","1","' . time() . '")'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Вы успешно создали союз "' . $nm . '"</b></font><br>';
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Альянс или союз с такиим названием уже существует</b></font><br>';
|
||
}
|
||
}
|
||
}
|
||
} else {
|
||
//альянсы
|
||
if ($res['join1'] == 0) {
|
||
echo '<font color="#FF0000"><b>Ваш клан должен состоять в союзе</b></font><br>';
|
||
} elseif ($res['join2'] > 0) {
|
||
echo '<font color="#FF0000"><b>Ваш клан уже состоит в альянсе</b></font><br>';
|
||
} else {
|
||
$nm = htmlspecialchars($_POST['logingo'], null);
|
||
if (str_replace(' ', '', str_replace(' ', '', $nm)) == '') {
|
||
echo '<font color="#FF0000"><b>Введите название альянса</b></font><br>';
|
||
} else {
|
||
$cnm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id` FROM `clan_joint` WHERE `name` = "' . mysql_real_escape_string(
|
||
$nm
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($cnm['id'])) {
|
||
mysql_query(
|
||
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string(
|
||
$nm
|
||
) . '","2","' . $res['id'] . '","' . $res['id'] . '")'
|
||
);
|
||
$id = mysql_insert_id();
|
||
$res['join2'] = $id;
|
||
mysql_query(
|
||
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","2","' . time() . '")'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join2` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Вы успешно создали альянс "' . $nm . '"</b></font><br>';
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Альянс или союз с такиим названием уже существует</b></font><br>';
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} elseif (isset($_GET['cancel']) && $tt[13][0] == 1) {
|
||
$zvn = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `id` = "' . mysql_real_escape_string(
|
||
$_GET['cancel']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($zvn['id'])) {
|
||
echo '<font color="#FF0000"><b>Заявка на вступление не найдена</b></font><br>';
|
||
} else {
|
||
$rzv = '';
|
||
if ($zvn['clan'] == $res['id']) {
|
||
//отмена присоединения
|
||
$szu = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $zvn['alians'] . '" LIMIT 1')
|
||
);
|
||
if ($szu['type'] == 1) {
|
||
$rzv = 'Клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $res['name_mini'] . '.gif">' . $res['name'] . '</b> отказался от присоединения к союзу <b>' . $szu['name'] . '</b>.';
|
||
} else {
|
||
$rzv = 'Клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $res['name_mini'] . '.gif">' . $res['name'] . '</b> отказался от присоединения к альянсу <b>' . $szu['name'] . '</b>.';
|
||
}
|
||
} elseif ($zvn['alians'] == $res['join1']) {
|
||
//отказ в присоединении к союзу
|
||
$szu = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $zvn['alians'] . '" LIMIT 1')
|
||
);
|
||
$zvy = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $zvn['clan'] . '" LIMIT 1')
|
||
);
|
||
$rzv = 'Союз <b>' . $szu['name'] . '</b> отказал клану <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b> в присоединении.';
|
||
} elseif ($zvn['alians'] == $res['join2']) {
|
||
//отказ в присоединении к альянсу
|
||
$szu = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $zvn['alians'] . '" LIMIT 1')
|
||
);
|
||
$zvy = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $zvn['clan'] . '" LIMIT 1')
|
||
);
|
||
$rzv = 'Альянс <b>' . $szu['name'] . '</b> отказал клану <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b> в присоединении.';
|
||
}
|
||
if ($rzv != '') {
|
||
echo '<font color="#FF0000"><b>' . $rzv . '</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $zvn['id'] . '"'
|
||
);
|
||
}
|
||
}
|
||
} elseif (isset($_GET['ok']) && $tt[13][0] == 1) {
|
||
$zvn = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `id` = "' . mysql_real_escape_string(
|
||
$_GET['ok']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($zvn['id'])) {
|
||
echo '<font color="#FF0000"><b>Заявка на вступление не найдена</b></font><br>';
|
||
} else {
|
||
$rzv = '';
|
||
if ($zvn['alians'] == $res['join1']) {
|
||
//присоединение к союзу
|
||
$szu = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $zvn['alians'] . '" LIMIT 1')
|
||
);
|
||
$zvy = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $zvn['clan'] . '" LIMIT 1')
|
||
);
|
||
$rzv = 'Союз <b>' . $szu['name'] . '</b> принял клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b>.';
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "1"'
|
||
);
|
||
//mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","1")');
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "' . $zvn['alians'] . '" WHERE `id` = "' . $szu['id'] . '"'
|
||
);
|
||
} elseif ($zvn['alians'] == $res['join2']) {
|
||
//присоединение к альянсу
|
||
$szu = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $zvn['alians'] . '" LIMIT 1')
|
||
);
|
||
$zvy = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $zvn['clan'] . '" LIMIT 1')
|
||
);
|
||
$rzv = 'Альянс <b>' . $szu['name'] . '</b> принял клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b>.';
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "2" AND `time_end` = "0"'
|
||
);
|
||
//mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","2")');
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join2` = "' . $zvn['alians'] . '" WHERE `id` = "' . $szu['id'] . '"'
|
||
);
|
||
}
|
||
if ($rzv != '') {
|
||
echo '<font color="#FF0000"><b>' . $rzv . '</b></font><br>';
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_start` = "' . time() . '" WHERE `id` = "' . $zvn['id'] . '"'
|
||
);
|
||
}
|
||
}
|
||
}
|
||
?>
|
||
<?php if ($res['join1'] == 0 && $res['level'] > 0) { ?>
|
||
<input type="submit" name="button" id="button" value="Создать союз"
|
||
onClick="openMod('<b>Создать союз</b>','<form action=\'main.php?clan&diplom&newjoint=1\' method=\'post\'>Название: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"/>
|
||
<input type="submit" name="button" id="button" value="Присоединиться к союзу"
|
||
onClick="openMod('<b>Присоединиться к союзу</b>','<form action=\'main.php?clan&diplom&joint=1\' method=\'post\'>Название: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"/>
|
||
<?php }
|
||
|
||
if ($res['join2'] == 0 && $res['level'] > 0) { ?>
|
||
<input type="submit" name="button" id="button" value="Присоединиться к альянсу"
|
||
onClick="openMod('<b>Присоединиться к альянсу</b>','<form action=\'main.php?clan&diplom&joint=2\' method=\'post\'>Название: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"/>
|
||
<input type="submit" name="button" id="button" value="Создать альянс"
|
||
onClick="openMod('<b>Создать альянс</b>','<form action=\'main.php?clan&diplom&newjoint=2\' method=\'post\'>Название: <input type=\'text\' style=\'width:244px;\' id=\'logingo\' name=\'logingo\'><br> <input style=\'float:right;\' type=\'submit\' name=\'invite\' value=\'Принять\'></form>');"/>
|
||
<br/><br/><?php } ?><?php } ?>
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<?php
|
||
$ms = '';
|
||
|
||
//Собственные союзы и альянсы
|
||
if ($res['join1'] > 0) {
|
||
$j1 = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $res['join1'] . '" LIMIT 1')
|
||
);
|
||
if (isset($j1['id'])) {
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">';
|
||
$ms .= 'Вы состоите в клановом союзе <b>' . $j1['name'] . '</b>.';
|
||
if ($j1['clan_glava'] != $res['id']) {
|
||
$ms .= ' <a href="main.php?clan&diplom&delclanme=1"><img title="Покинуть союз" width="13" height="13" src="//img.new-combats.tech/i/clear.gif"></a>';
|
||
}
|
||
$ms .= '<Br>Состав союза: ';
|
||
|
||
$i = 0;
|
||
if (isset($_GET['delclanme'])) {
|
||
if ($j1['clan_glava'] != $res['id'] && ($u->info['clan_prava'] == 'glava' || $u->info['admin'] > 0)) {
|
||
$dels = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `clan` = "' . $res['id'] . '" AND `alians` = "' . $j1['id'] . '" AND `time_end` = "0" AND `time_start` > 0 LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($dels['id'])) {
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<div><b><font color=red>Вы успешно покинули союз "' . $j1['name'] . '"</font></b></div>';
|
||
header('location: main.php?clan&diplom');
|
||
} else {
|
||
echo '<div><b><font color=red>Ваш клан не состоит в данном союзе</font></b></div>';
|
||
|
||
}
|
||
} else {
|
||
echo '<div><b><font color=red>Вы не можете покинуть данный союз</font></b></div>';
|
||
}
|
||
} elseif ($j1['clan_glava'] == $res['id'] && ($u->info['clan_prava'] == 'glava' || $u->info['admin'] > 0)) {
|
||
if (isset($_GET['delclan'])) {
|
||
$delc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan` WHERE `id` = "' . mysql_real_escape_string(
|
||
$_GET['delclan']
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
$dels = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `clan` = "' . $delc['id'] . '" AND `alians` = "' . $j1['id'] . '" AND `time_end` = "0" AND `time_start` > 0 LIMIT 1'
|
||
)
|
||
);
|
||
|
||
if (isset($delc['id']) && isset($dels['id'])) {
|
||
if ($delc['id'] != $res['id']) {
|
||
mysql_query(
|
||
'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
|
||
);
|
||
mysql_query(
|
||
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<div><b><font color=red>Клан "' . $delc['name'] . '" был исключен из данного союза</font></b></div>';
|
||
header('location: main.php?clan&diplom');
|
||
} else {
|
||
echo '<div><b><font color=red>Клан ответственный за союз не может покинуть данный союз</font></b></div>';
|
||
}
|
||
} else {
|
||
echo '<div><b><font color=red>Клан не состоит в данном союзе</font></b></div>';
|
||
}
|
||
}
|
||
}
|
||
$sp1 = mysql_query(
|
||
'SELECT `u`.*,`s`.* FROM `clan_join` AS `u` LEFT JOIN `clan` AS `s` ON `s`.`id` = `u`.`clan` WHERE `u`.`alians` = "' . $j1['id'] . '" AND `u`.`time_end` = "0" AND `u`.`time_start` > 0'
|
||
);
|
||
while ($pl1 = mysql_fetch_array($sp1)) {
|
||
if ($i > 0) {
|
||
$ms .= ',';
|
||
}
|
||
$ms .= ' <a href="javascript:void(0)"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $pl1['name_mini'] . '.gif">' . $pl1['name'] . '</a>';
|
||
if ($j1['clan_glava'] == $res['id']) {
|
||
if ($res['id'] != $pl1['clan']) {
|
||
if ($u->info['clan_prava'] == 'glava' || $u->info['admin'] > 0) {
|
||
$ms .= ' <a title="Выгнать из союза" href="main.php?clan&diplom&delclan=' . $pl1['clan'] . '"><img width="13" height="13" src="//img.new-combats.tech/i/clear.gif"></a>';
|
||
}
|
||
}
|
||
}
|
||
$i++;
|
||
}
|
||
if ($j1['clan_glava'] == $res['id'] && ($u->info['clan_prava'] == 'glava' || $u->info['admin'] > 0)) {
|
||
$ms .= '<br>Вы основатель союза, можете ограничить каналы союза чата:<br>';
|
||
$cnls = '<i>выключено</i>';
|
||
|
||
$sp1 = mysql_query(
|
||
'SELECT `u`.*,`s`.* FROM `clan_join` AS `u` LEFT JOIN `clan` AS `s` ON `s`.`id` = `u`.`clan` WHERE `u`.`alians` = "' . $j1['id'] . '" AND `u`.`time_end` = "0" AND `u`.`time_start` > 0'
|
||
);
|
||
while ($pl1 = mysql_fetch_array($sp1)) {
|
||
$ms .= '<form method="post" action="?clan&diplom&savecanals=' . $pl1['id'] . '"><a style="display:inline-block;width:210px;" href="javascript:void(0)"><img src="//img.new-combats.tech/i/clan/' . $pl1['name_mini'] . '.gif">' . $pl1['name'] . '</a> ' . $cnls . ' <input type="submit" value="сохранить"></form>';
|
||
}
|
||
}
|
||
//Перечисляем открытые каналы клана
|
||
|
||
$ms .= '</div>';
|
||
}
|
||
}
|
||
if ($res['join2'] > 0) {
|
||
$j1 = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $res['join2'] . '" LIMIT 1')
|
||
);
|
||
if (isset($j1['id'])) {
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">';
|
||
$ms .= 'Вы состоите в клановом альянсе <b>' . $j1['name'] . '</b>. Состав альянса: ';
|
||
|
||
$sp1 = mysql_query(
|
||
'SELECT `u`.*,`s`.* FROM `clan_join` AS `u` LEFT JOIN `clan` AS `s` ON `s`.`id` = `u`.`clan` WHERE `u`.`alians` = "' . $j1['id'] . '" AND `u`.`time_end` = "0" AND `u`.`time_start` > 0'
|
||
);
|
||
$i = 0;
|
||
while ($pl1 = mysql_fetch_array($sp1)) {
|
||
if ($i > 0) {
|
||
$ms .= ', ';
|
||
}
|
||
$ms .= '<a href="javascript:void(0)"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $pl1['name_mini'] . '.gif">' . $pl1['name'] . '</a>';
|
||
$i++;
|
||
}
|
||
$ms .= '<br>Вы основатель альянса.<br>';
|
||
$ms .= '</div>';
|
||
}
|
||
}
|
||
|
||
//Союзы и альянсы в которых состоит клан
|
||
|
||
|
||
if ($ms == '') {
|
||
?>
|
||
<center>В данный момент у вашего клана нет дипломатических отношений.</center>
|
||
<?php } else {
|
||
echo $ms;
|
||
} ?>
|
||
</div>
|
||
<?php if ($tt[13][0] == 1) { ?>
|
||
<br/>
|
||
<center>Заявки на союзы</center>
|
||
<br/>
|
||
<table width="100%" border="0" cellspacing="0" cellpadding="2">
|
||
<tr>
|
||
<td width="50%" align="center" valign="top">
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<a href="javascript:void(0)">Ваши заявки на установление союза</a>
|
||
<br/>
|
||
<br/>
|
||
<?php
|
||
$ms = '';
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `clan` = "' . mysql_real_escape_string(
|
||
$res['id']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" AND `type` = "1"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$suz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $pl['alians'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;text-align:left;margin-bottom:5px;padding-bottom:5px;">Вы подали заявку на вступление в союз <b>' . $suz['name'] . '</b>.<br><div style="float:left;">Время подачи заявки: ' . date(
|
||
'd.m.Y H:i', $pl['time']
|
||
) . '</div><a style="float:right;" href="?clan&diplom&cancel=' . $pl['id'] . '">Отменить</a><br></div>';
|
||
}
|
||
if ($ms == '') {
|
||
?>
|
||
С Вами никто не подавал заявки
|
||
<?php } else {
|
||
echo $ms;
|
||
} ?>
|
||
</div>
|
||
</td>
|
||
<td align="center" valign="top">
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<a href="javascript:void(0)">Заявки на установление союза с вами</a>
|
||
<br/>
|
||
<br/>
|
||
<?php
|
||
$ms = '';
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . mysql_real_escape_string(
|
||
$res['join1']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" AND `type` = "1"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$suz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $pl['alians'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
$clz = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1')
|
||
);
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;text-align:left;margin-bottom:5px;padding-bottom:5px;">Клан <a href="javascript:void(0)"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clz['name_mini'] . '.gif">' . $clz['name'] . '</a> подал заявку на вступление в Ваш союз <b>' . $suz['name'] . '</b>.<br><div style="float:left;">Время подачи заявки: ' . date(
|
||
'd.m.Y H:i', $pl['time']
|
||
) . '</div><div style="float:right;"><a href="?clan&diplom&ok=' . $pl['id'] . '">Принять</a> <a href="?clan&diplom&cancel=' . $pl['id'] . '">Отказать</a></div><br></div>';
|
||
}
|
||
if ($ms == '') {
|
||
?>
|
||
С Вами никто не подавал заявки
|
||
<?php } else {
|
||
echo $ms;
|
||
} ?>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<br/>
|
||
<center>Заявки на альянсы</center>
|
||
<br/>
|
||
<table width="100%" border="0" cellspacing="0" cellpadding="2">
|
||
<tr>
|
||
<td width="50%" align="center" valign="top">
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<a href="javascript:void(0)">Ваши заявки на установление альянса</a>
|
||
<br/>
|
||
<br/>
|
||
<?php
|
||
$ms = '';
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `clan` = "' . mysql_real_escape_string(
|
||
$res['id']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" AND `type` = "2"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$suz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $pl['alians'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;text-align:left;margin-bottom:5px;padding-bottom:5px;">Вы подали заявку на вступление в альянс <b>' . $suz['name'] . '</b>.<br><div style="float:left;">Время подачи заявки: ' . date(
|
||
'd.m.Y H:i', $pl['time']
|
||
) . '</div><a style="float:right;" href="?clan&diplom&cancel=' . $pl['id'] . '">Отменить</a><br></div>';
|
||
}
|
||
if ($ms == '') {
|
||
?>
|
||
С Вами никто не подавал заявки
|
||
<?php } else {
|
||
echo $ms;
|
||
} ?>
|
||
</div>
|
||
</td>
|
||
<td align="center" valign="top">
|
||
<div style="border:1px solid #CECECE;padding:10px;">
|
||
<a href="javascript:void(0)">Заявки на установление альянса с вами</a>
|
||
<br/>
|
||
<br/>
|
||
<?php
|
||
$ms = '';
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . mysql_real_escape_string(
|
||
$res['join2']
|
||
) . '" AND `time_start` = "0" AND `time_end` = "0" AND `type` = "2"'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
$suz = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $pl['alians'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
$clz = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1')
|
||
);
|
||
$ms .= '<div style="border-bottom:1px solid #cac9c7;text-align:left;margin-bottom:5px;padding-bottom:5px;">Клан <a href="javascript:void(0)"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clz['name_mini'] . '.gif">' . $clz['name'] . '</a> подал заявку на вступление в Ваш альянс <b>' . $suz['name'] . '</b>.<br><div style="float:left;">Время подачи заявки: ' . date(
|
||
'd.m.Y H:i', $pl['time']
|
||
) . '</div><div style="float:right;"><a href="?clan&diplom&ok=' . $pl['id'] . '">Принять</a> <a href="?clan&diplom&cancel=' . $pl['id'] . '">Отказать</a></div><br></div>';
|
||
}
|
||
if ($ms == '') {
|
||
?>
|
||
С Вами никто не подавал заявки
|
||
<?php } else {
|
||
echo $ms;
|
||
} ?>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<?php } ?>
|
||
</fieldset>
|
||
<?php } elseif (isset($_GET['deposit'])) {
|
||
|
||
$itmc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT COUNT(`id`) FROM `items_users` WHERE `uid` = "-21' . $res['id'] . '" AND `delete` = 0 LIMIT 1'
|
||
)
|
||
);
|
||
$itmc = $itmc[0];
|
||
$itms = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `iu`.*,`im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` >= 0 AND `iu`.`delete` = "0"
|
||
AND `iu`.`id` = "' . mysql_real_escape_string($_GET['ungive_itm']) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($itms['data'])) {
|
||
$ps = Conversion::dataStringToArray($itms['data']);
|
||
}
|
||
$ps['cl'] = explode('#', $ps['toclan']);
|
||
$use_s = $ps['cl'][1];
|
||
if (isset($_GET['ungive_itm']) && $ps['cl'][0] == $res['id'] && ($tt[14][0] == 1 || ($u->info['id'] == $use_s))) {
|
||
$itm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `iu`.*,`im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` >= 0 AND `iu`.`delete` = "0"
|
||
AND `iu`.`id` = "' . mysql_real_escape_string($_GET['ungive_itm']) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($itm['id'])) {
|
||
$btlud = mysql_fetch_array(
|
||
mysql_query('SELECT `id`,`battle` FROM `users` WHERE `id` = "' . $itm['uid'] . '" LIMIT 1')
|
||
);
|
||
if ($u->testBattle($btlud['battle']) == true) {
|
||
echo '<font color="#FF0000"><b>Нельзя изымать предметы с персонажа в бою</b></font><br>';
|
||
} else {
|
||
echo $storage->backToOwner($itm['id']);
|
||
}
|
||
}
|
||
} elseif (isset($_GET['take_itm']) && $tt[4][0] == 1) {
|
||
$itm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `iu`.*,`im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid`="-21' . $res['id'] . '" AND `iu`.`delete`="0"
|
||
AND `iu`.`id` = "' . mysql_real_escape_string($_GET['take_itm']) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($itm['id'])) {
|
||
echo $storage->take($itm['id']);
|
||
}
|
||
} elseif (isset($_GET['give_itm'])) {
|
||
$itm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `iu`.*,`im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%"
|
||
AND `iu`.`id` = "' . mysql_real_escape_string($_GET['give_itm']) . '" LIMIT 1'
|
||
)
|
||
);
|
||
if ($itmc >= $lvl_prava[$res['level']][5]) {
|
||
echo '<font color="#FF0000"><b>Хранилище переполнено</b></font><br>';
|
||
} elseif (isset($itm['id'])) {
|
||
echo $storage->put($itm['id']);
|
||
}
|
||
}
|
||
if ($tt[4][0] == 1) {
|
||
$itm_clan = $u->genInv(
|
||
66,
|
||
'(`iu`.`uid` = "-21' . $u->info['clan'] . '" OR `iu`.`data` LIKE "%toclan=' . $u->info['clan'] . '#%") AND `iu`.`delete` = 0 AND `iu`.`inShop` = 0 ORDER BY `lastUPD` DESC'
|
||
);
|
||
} else {
|
||
$itm_clan[2] = '<br /><br /><center>У вас нет доступа к использованию хранилища</center>';
|
||
}
|
||
$itm_user = $u->genInv(
|
||
65,
|
||
'`iu`.`uid` = ' . $u->info['id'] . ' AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%" ORDER BY `lastUPD` DESC'
|
||
);
|
||
|
||
?>
|
||
<div class="box visible">
|
||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||
<tr>
|
||
<td width="50%" valign="top">
|
||
<fieldset style="margin:0;padding:0">
|
||
<legend><span
|
||
class="legtitle">Хранилище (предметов : <?= $itmc ?>/<?= $lvl_prava[$res['level']][5] ?>)</span>
|
||
</legend>
|
||
<?php if ($itm_clan[2] != '') { ?>
|
||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||
<?= $itm_clan[2] ?>
|
||
</table>
|
||
<?php } else {
|
||
echo '<center><br />Хранилище клана пусто<br /><br /></center>';
|
||
} ?>
|
||
</fieldset>
|
||
</td>
|
||
<td width="50%" valign="top">
|
||
<fieldset style="margin:0;padding:0">
|
||
<legend><span class="legtitle">Рюкзак</span></legend>
|
||
<?php if ($itm_user[2] != '') { ?>
|
||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||
<?= $itm_user[2] ?>
|
||
</table>
|
||
<?php } else {
|
||
echo '<center><br />Рюкзак пуст<br /><br /></center>';
|
||
} ?>
|
||
</fieldset>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<?php } elseif (isset($_GET['titul']) && $tt[11][0] == 1) { ?>
|
||
<script>
|
||
function editTitul(id) {
|
||
if ($('#edpnltitul' + id).css('display') === 'none') {
|
||
$('#edpnltitul' + id).css({'display': ''});
|
||
} else {
|
||
$('#edpnltitul' + id).css({'display': 'none'});
|
||
}
|
||
}
|
||
</script>
|
||
<div class="box visible">
|
||
<?php
|
||
if (isset($_POST['tituladd'])) {
|
||
//Добавляем новый титул
|
||
$tc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT COUNT(*) FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0" LIMIT 25'
|
||
)
|
||
);
|
||
if ($tc[0] >= 20) {
|
||
echo '<font color="#FF0000"><b>Нельзя добавлять более 25-ти титулов, для добавления нового сотрите старые</b></font><br>';
|
||
} else {
|
||
$nm = htmlspecialchars($_POST['tituladd'], null);
|
||
if (str_replace(' ', '', str_replace(' ', '', $nm)) == '') {
|
||
echo '<font color="#FF0000"><b>Название титула не должно быть пустым</b></font><br>';
|
||
} else {
|
||
mysql_query(
|
||
'INSERT INTO `clan_tituls` (`clan`,`user_add`,`time_add`,`name`) VALUES ("' . $res['id'] . '","' . $u->info['id'] . '","' . time() . '","' . mysql_real_escape_string($nm) . '")'
|
||
);
|
||
echo '<font color="#FF0000"><b>Титул был успешно добавлен</b></font><br>';
|
||
}
|
||
}
|
||
} elseif (isset($_GET['save'])) {
|
||
//сохраняем титул
|
||
$tc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `id` = "' . mysql_real_escape_string(
|
||
$_GET['save']
|
||
) . '" AND `delete` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($tc['id'])) {
|
||
$tc['info'] = htmlspecialchars($_POST['t_info'], null);
|
||
$i = 1;
|
||
$tc['canals'] = '';
|
||
while ($i <= 9) {
|
||
if ($_POST['t_klan' . $i]) {
|
||
$tc['canals'] .= '1';
|
||
} else {
|
||
$tc['canals'] .= '0';
|
||
}
|
||
$i++;
|
||
}
|
||
$i = 0;
|
||
$tc['prava'] = '';
|
||
while ($i <= 20) {
|
||
if ($_POST['t_tr' . $i]) {
|
||
$tc['prava'] .= '1';
|
||
} else {
|
||
$tc['prava'] .= '0';
|
||
}
|
||
$i++;
|
||
}
|
||
|
||
preg_match('/#([a-f\d]{6})/i', $_POST['colorsp'], $colorCode); // #dedede
|
||
$colorCode = isset($colorCode[0]) ? substr($colorCode[0], 1) : '000000';
|
||
|
||
// Тут
|
||
|
||
if ($tc['prava'][11] == 1) {
|
||
mysql_query(
|
||
'UPDATE `clan_tituls` SET `prioritet` = 1, `info` = "' . mysql_real_escape_string(
|
||
$tc['info']
|
||
) . '", `color` = "' . $colorCode . '", `canals` = "' . $tc['canals'] . '", `prava` = "' . $tc['prava'] . '" WHERE `id` = "' . $tc['id'] . '" LIMIT 1'
|
||
);
|
||
} else {
|
||
mysql_query(
|
||
'UPDATE `clan_tituls` SET `prioritet` = 0, `info` = "' . mysql_real_escape_string(
|
||
$tc['info']
|
||
) . '", `color` = "' . $colorCode . '", `canals` = "' . $tc['canals'] . '", `prava` = "' . $tc['prava'] . '" WHERE `id` = "' . $tc['id'] . '" LIMIT 1'
|
||
);
|
||
}
|
||
echo '<font color="#FF0000"><b>Титул был успешно сохранен</b></font><br>';
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Титул не найден</b></font><br>';
|
||
}
|
||
} elseif (isset($_GET['delete'])) {
|
||
$tc = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `id` = "' . mysql_real_escape_string(
|
||
$_GET['delete']
|
||
) . '" AND `delete` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($tc['id'])) {
|
||
mysql_query(
|
||
'UPDATE `clan_tituls` SET `delete` = "' . $u->info['id'] . '" WHERE `id` = "' . $tc['id'] . '" LIMIT 1'
|
||
);
|
||
echo '<font color="#FF0000"><b>Титул был удален</b></font><br>';
|
||
} else {
|
||
echo '<font color="#FF0000"><b>Титул не найден</b></font><br>';
|
||
}
|
||
}
|
||
|
||
$i = 0;
|
||
$sp = mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `delete` = "0" LIMIT 25'
|
||
);
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
?>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<b style="color:#<?= $pl['color'] ?>">*</b> <a style="display:inline-block;width:250px;" onclick="editTitul(<?= $pl['id'] ?>)"
|
||
href="javascript:void(0)"><?= $pl['name'] ?></a><font
|
||
color="#999999"><i><?= $pl['info'] ?></i></font>
|
||
<img src="//img.new-combats.tech/i/clear.gif" title="Удалить титул"
|
||
onclick="location='main.php?clan&titul&delete=<?= $pl['id'] ?>'"
|
||
style="float:right;cursor:pointer;">
|
||
<div id="edpnltitul<?= $pl['id'] ?>"
|
||
style="display:none;margin:10px;border:1px solid #9e9e9e;padding:10px;">
|
||
<form method="post" action="?clan&titul&save=<?= $pl['id'] ?>">
|
||
<span style="float:right"><a onclick="editTitul(<?= $pl['id'] ?>)"
|
||
href="javascript:void(0)">x</a></span>
|
||
<center>Редактирование титула <a onclick="editTitul(<?= $pl['id'] ?>)"
|
||
href="javascript:void(0)"><?= $pl['name'] ?></a></center>
|
||
<br>
|
||
Описание: <input style="width:360px;" value="<?= $pl['info'] ?>" type="text" name="t_info"><br>
|
||
<br>
|
||
Каналы чата:
|
||
<?php $j = 1;
|
||
while ($j <= 9) {
|
||
if ($pl['canals'][$j - 1] == 1) {
|
||
$pl['check'] = 'checked';
|
||
} else {
|
||
$pl['check'] = '';
|
||
}
|
||
?>
|
||
<label for="t_klan<?= $j ?>"><?= $j ?></label>
|
||
<input <?= $pl['check'] ?> type="checkbox" <?= $pl['check2'] ?> name="t_klan<?= $j ?>"
|
||
id="t_klan<?= $j ?>">
|
||
<?php $j++;
|
||
}
|
||
echo '<br><br>';
|
||
$j = 1;
|
||
while ($j < count($tt)) {
|
||
if ($tt[$j][1] != '0') {
|
||
if ($pl['prava'][$j] == 1) {
|
||
$pl['check'] = 'checked';
|
||
} else {
|
||
$pl['check'] = '';
|
||
}
|
||
?>
|
||
<input <?= $pl['check'] ?> type="checkbox" name="t_tr<?= $j ?>" id="t_tr<?= $j ?>">
|
||
<label for="t_tr<?= $j ?>"><?= $tt[$j][1] ?></label><br>
|
||
<?php
|
||
}
|
||
$j++;
|
||
}
|
||
?>
|
||
<br>
|
||
<label>Цвет: <input type="color" name="colorsp" value="#<?= $pl['color'] ?>"></label><br><br>
|
||
|
||
<input type="submit" value="Сохранить">
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<?php
|
||
$i++;
|
||
}
|
||
|
||
if ($i == 0) {
|
||
echo 'В клане нет ни одного титула';
|
||
}
|
||
?>
|
||
<input type="button" onclick="addNewTitul()" value="Добавить титул">
|
||
</div>
|
||
<?php } elseif (isset($_GET['rules'])) { ?>
|
||
<div class="box visible">
|
||
<fieldset style="border:1px dashed #eeeeee">
|
||
<legend><span class="legtitle">Права персонажа "<?= $u->info['login'] ?>"</span></legend>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Звание в клане: <b><?php
|
||
|
||
if ($u->info['clan_prava'] != 'glava') {
|
||
echo $u->info['moder_zvanie'];
|
||
} else {
|
||
echo '<b style="color:#008097">глава клана</b>';
|
||
}
|
||
|
||
?></b>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Титул: <b><?= $utitl['name'] ?></b> - <font color="#999999"><?= $utitl['info'] ?></font>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Каналы чата:
|
||
<?php $j = 1;
|
||
while ($j <= 9) {
|
||
if ($utitl['canals'][$j - 1] == 1) {
|
||
$r .= '<a href="javascript:void(0)">klan-' . $j . '</a>, ';
|
||
}
|
||
$j++;
|
||
}
|
||
echo rtrim($r, ', ');
|
||
?>
|
||
</div>
|
||
<?php
|
||
$j = 1;
|
||
while ($j < count($tt)) {
|
||
if ($tt[$j][1] != '0') {
|
||
if ($utitl['prava'][$j] == 1) {
|
||
$utitl['check'] = 'Да';
|
||
} else {
|
||
$utitl['check'] = 'Нет';
|
||
}
|
||
?>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<div style="display:inline-block;width:410px;">
|
||
• <?= $tt[$j][1] ?></div><?= $utitl['check'] ?>
|
||
</div>
|
||
<?php
|
||
}
|
||
$j++;
|
||
}
|
||
?>
|
||
|
||
</fieldset>
|
||
</div>
|
||
<?php } elseif (isset($_GET['info'])) {
|
||
|
||
//полученный опыт
|
||
$edd = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT SUM(`exp`) FROM `clan_exp` WHERE `clan` = "' . $res['id'] . '" AND `dd` = "' . ceil(
|
||
date('d')
|
||
) . '" AND `mm` = "' . ceil(date('m')) . '" AND `yyyy` = "' . ceil(date('Y')) . '"'
|
||
)
|
||
);
|
||
$eww = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT SUM(`exp`) FROM `clan_exp` WHERE `clan` = "' . $res['id'] . '" AND `ww` = "' . ceil(
|
||
date('W')
|
||
) . '" AND `yyyy` = "' . ceil(date('Y')) . '"'
|
||
)
|
||
);
|
||
$emm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT SUM(`exp`) FROM `clan_exp` WHERE `clan` = "' . $res['id'] . '" AND `mm` = "' . ceil(
|
||
date('m')
|
||
) . '" AND `yyyy` = "' . ceil(date('Y')) . '"'
|
||
)
|
||
);
|
||
|
||
$edd = 0 + $edd[0];
|
||
$eww = 0 + $eww[0];
|
||
$emm = 0 + $emm[0];
|
||
?>
|
||
<div class="box visible">
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Название клана: <img src="//img.new-combats.tech/i/clan/<?= $res['name_mini'] ?>.gif"
|
||
style="vertical-align:bottom" width="24" height="15"><a
|
||
href="javascript:void(0)"><?= $res['name'] ?></a> (<?= $res['name_mini'] ?>)
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Уровень клана: <?= $res['level'] ?>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Позиция клана: <?= $r1['pos'] ?>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
Опыт клана: <?= number_format($res['exp'], 0, ",", " ") ?> / <?= number_format(
|
||
$lvl_exp[$res['level'] + 1], 0, ",", " "
|
||
) ?>
|
||
<div style="width:200px;display:inline-block;border:1px solid #aeaeae">
|
||
<div style="width:<?= ceil(
|
||
($res['exp'] - $lvl_exp[$res['level']]) / $lvl_exp[$res['level'] + 1] * 200
|
||
) ?>px;display:inline-block;padding-left:4px;padding-right:4px;text-align:right;background-color:#E9F7E8;color:#1B3618">
|
||
<b><?= ceil(($res['exp'] - $lvl_exp[$res['level']]) / $lvl_exp[$res['level'] + 1] * 100) ?>%</b>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<table width="500" border="0" cellspacing="0" cellpadding="0">
|
||
<tr>
|
||
<td width="220">Статистика кланового опыта:</td>
|
||
<td width="100">• За сегодня:</td>
|
||
<td><b style="color:#0033a1"><?= $edd ?></b></td>
|
||
</tr>
|
||
<tr>
|
||
<td> </td>
|
||
<td>• За неделю:</td>
|
||
<td><b style="color:#0033a1"><?= $eww ?></b></td>
|
||
</tr>
|
||
<tr>
|
||
<td> </td>
|
||
<td>• За месяц:</td>
|
||
<td><b style="color:#0033a1"><?= $emm ?></b></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
|
||
<table width="100%" border="0" style="border:1px solid #232323;" cellspacing="0" cellpadding="5">
|
||
<tr>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Уровень</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Игроки</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Союз</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Создать союз</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Альянс</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Создать альянс</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Хранилище</strong></td>
|
||
<td align="center" valign="middle"
|
||
style="border-bottom:1px solid #232323;border-right:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Передач на игрока</strong></td>
|
||
<td align="center" valign="middle" style="border-bottom:1px solid #232323;" bgcolor="#cccccc">
|
||
<strong>Передач всего</strong></td>
|
||
</tr>
|
||
<?php
|
||
$i = 0;
|
||
$yn = ['Нет', 'Да'];
|
||
while ($i < count($lvl_prava)) {
|
||
$bgclr = '';
|
||
if ($res['level'] >= $i) {
|
||
$bgclr = ' bgcolor="#8fd155"';
|
||
}
|
||
if ($i < count($lvl_prava) - 1) {
|
||
?>
|
||
<tr<?= $bgclr ?>>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $i ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][0] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][1]] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][2]] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][3]] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][4]] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][5] ?></td>
|
||
<td style="border-bottom:1px solid #232323;border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][6] ?></td>
|
||
<td style="border-bottom:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][7] ?></td>
|
||
</tr>
|
||
<?php
|
||
} else {
|
||
|
||
?>
|
||
<tr<?= $bgclr ?>>
|
||
<td style="border-right:1px solid #232323;" align="center" valign="middle"><?= $i ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][0] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][1]] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][2]] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][3]] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $yn[$lvl_prava[$i][4]] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][5] ?></td>
|
||
<td style="border-right:1px solid #232323;" align="center"
|
||
valign="middle"><?= $lvl_prava[$i][6] ?></td>
|
||
<td align="center" valign="middle"><?= $lvl_prava[$i][7] ?></td>
|
||
</tr>
|
||
<?php
|
||
}
|
||
$i++;
|
||
}
|
||
?>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<?php } elseif (isset($_GET['members'])) { ?>
|
||
<div class="box visible">
|
||
<fieldset style="border:1px dashed #eeeeee">
|
||
<legend align="center"><span class="legtitle"><img title="Приватно"
|
||
onClick="top.chat.addto('klan','private')"
|
||
style="vertical-align:bottom;cursor:pointer;"
|
||
src="//img.new-combats.tech/i/lock.gif" width="20"
|
||
height="15"> Соклановцы</span></legend>
|
||
<?php if (!isset($_GET['online'])) { ?>
|
||
<input onClick="location='main.php?clan&members&online'" type="button" value="Только online"
|
||
style="float:right">
|
||
<?php } else { ?>
|
||
<input onClick="location='main.php?clan&members'" type="button" value="Показать всех"
|
||
style="float:right">
|
||
<?php } ?>
|
||
<br>
|
||
<?php
|
||
$sp = mysql_query(
|
||
'SELECT `id`,`battle`,`login`,`clan`,`level`,`room`,`cityreg`,`align`,`clan_prava`,`mod_zvanie`,`sex`,`city`,`online`,`banned` FROM `users` WHERE `clan` = "' . $res['id'] . '"'
|
||
);
|
||
$r = '<br>';
|
||
$j = 0;
|
||
$i = 0;
|
||
if ($res['join1'] > 0 || $res['join2'] > 0) {
|
||
$r .= '<fieldset style="border:1px dashed #eeeeee;margin-top:5px;">
|
||
<legend align="left"><span class="legtitle">Основной состав</span></legend>';
|
||
}
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
if (!isset($_GET['online']) || $pl['online'] > time() - 120) {
|
||
$pl['textcolor1'] = '';
|
||
if ($pl['online'] > time() - 120) {
|
||
$ico = '<img onClick="top.chat.addto(\'' . $pl['login'] . '\',\'private\')" src="//img.new-combats.tech/i/lock.gif" width="20" height="15" style="cursor:pointer;vertical-align:bottom">';
|
||
$j++;
|
||
} else {
|
||
$pl['textcolor1'] = '#837f82';
|
||
$ico = '<img src="//img.new-combats.tech/i/offline.gif" width="20" height="15" style="vertical-align:bottom">';
|
||
}
|
||
$zvn = $pl['mod_zvanie'];
|
||
$zvn = str_replace('[b]', '<b>', $zvn);
|
||
$zvn = str_replace('[/b]', '</b>', $zvn);
|
||
$zvn = str_replace('[i]', '<i>', $zvn);
|
||
$zvn = str_replace('[/i]', '</i>', $zvn);
|
||
$zvn = str_replace('[u]', '<u>', $zvn);
|
||
$zvn = str_replace('[/u]', '</u>', $zvn);
|
||
$zvn = str_replace('[c=', '<font color="', $zvn);
|
||
$zvn = str_replace('=]', '">', $zvn);
|
||
$zvn = str_replace('[/c]', '</font>', $zvn);
|
||
if ($pl['clan_prava'] == 'glava') {
|
||
if ($zvn == 'Стажер' || $zvn == '') {
|
||
$zvn = '<b style="color:#008097">глава клана</b>';
|
||
}
|
||
$zvn = '<img style="vertical-align:top" src="//img.new-combats.tech/i/clan/' . $res['name_mini'] . '.gif" width="24" title="Глава клана">' . $zvn;
|
||
}
|
||
$ttl = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $res['id'] . '" AND `id` = "' . $pl['clan_prava'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($ttl['id'])) {
|
||
$zvn = '<font color="#' . $ttl['color'] . '"><b>' . $ttl['name'] . '</b></font> - ' . $zvn;
|
||
}
|
||
if ($pl['online'] > time() - 120) {
|
||
$rm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`name`,`city` FROM `room` WHERE `id` = "' . $pl['room'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($rm['id'])) {
|
||
$zvn .= ' - <i>' . $rm['name'] . '</i>';
|
||
}
|
||
} else {
|
||
$zvn .= ' - <i><font color="grey">персонаж сейчас не в клубе</font></i>';
|
||
}
|
||
if ($pl['battle'] > 0) {
|
||
$zvn .= ' <a href="logs.php?id=' . $pl['battle'] . '" target="_blank"><img width="20" height="20" style="vertical-align:bottom"src="//img.new-combats.tech/i/fighttype0.gif" title="Открыть лог поединка"></a>';
|
||
}
|
||
$r .= '<div style="padding:5px;background-color:#efedee"><span style="display:inline-block;width:350px;">' . $ico . ' <img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif" width="12" height="15" style="vertical-align:bottom"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $res['name_mini'] . '.gif" width="24" height="15"><a onClick="top.chat.addto(\'' . $pl['login'] . '\',\'to\')" style="color:' . $pl['textcolor1'] . '" href="javascript:void(0)">' . $pl['login'] . '</a><font color="' . $pl['textcolor1'] . '">[' . $pl['level'] . ']<a href="/info/' . $pl['id'] . '" title="Инф. о ' . $pl['login'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_' . $pl['cityreg'] . '.gif" width="12" height="11"></a></font></span>' . $zvn . '</div>';
|
||
}
|
||
$i++;
|
||
}
|
||
|
||
if ($res['join1'] > 0 || $res['join2'] > 0) {
|
||
$r .= '</fieldset>';
|
||
}
|
||
$nacln = '';
|
||
if ($res['join1'] > 0) {
|
||
$clna = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $res['join1'] . '" AND `type` = "1" AND `time_close` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
$cn_sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . $clna['id'] . '" AND `clan` != "' . $res['id'] . '" AND `time_end` = "0" AND `time_start` > 0'
|
||
);
|
||
while ($cn_pl = mysql_fetch_array($cn_sp)) {
|
||
/* ----------------------------------------------------------------------------------------------------------------------------- */
|
||
$nacln .= ' AND `clan` != "' . $cn_pl['clan'] . '"';
|
||
$clnf = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $cn_pl['clan'] . '" LIMIT 1')
|
||
);
|
||
$sp = mysql_query(
|
||
'SELECT `id`,`battle`,`login`,`clan`,`level`,`room`,`cityreg`,`align`,`clan_prava`,`mod_zvanie`,`sex`,`city`,`online`,`banned` FROM `users` WHERE `clan` = "' . $cn_pl['clan'] . '"'
|
||
);
|
||
$r .= '<fieldset style="border:1px dashed #eeeeee;margin-top:5px;">
|
||
<legend align="left"><span class="legtitle">Состав "' . $clna['name'] . '"</span></legend>';
|
||
$j = 0;
|
||
$i = 0;
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
if (!isset($_GET['online']) || $pl['online'] > time() - 120) {
|
||
$pl['textcolor1'] = '';
|
||
if ($pl['online'] > time() - 120) {
|
||
$ico = '<img onClick="top.chat.addto(\'' . $pl['login'] . '\',\'private\')" src="//img.new-combats.tech/i/lock.gif" width="20" height="15" style="cursor:pointer;vertical-align:bottom">';
|
||
$j++;
|
||
} else {
|
||
$pl['textcolor1'] = '#837f82';
|
||
$ico = '<img src="//img.new-combats.tech/i/offline.gif" width="20" height="15" style="vertical-align:bottom">';
|
||
}
|
||
$zvn = $pl['mod_zvanie'];
|
||
$zvn = str_replace('[b]', '<b>', $zvn);
|
||
$zvn = str_replace('[/b]', '</b>', $zvn);
|
||
$zvn = str_replace('[i]', '<i>', $zvn);
|
||
$zvn = str_replace('[/i]', '</i>', $zvn);
|
||
$zvn = str_replace('[u]', '<u>', $zvn);
|
||
$zvn = str_replace('[/u]', '</u>', $zvn);
|
||
$zvn = str_replace('[c=', '<font color="', $zvn);
|
||
$zvn = str_replace('=]', '">', $zvn);
|
||
$zvn = str_replace('[/c]', '</font>', $zvn);
|
||
if ($pl['clan_prava'] == 'glava') {
|
||
if ($zvn == 'Стажер' || $zvn == '') {
|
||
$zvn = '<b style="color:#008097">глава клана</b>';
|
||
}
|
||
$zvn = '<img style="vertical-align:top" src="//img.new-combats.tech/i/clan/' . $clnf['name_mini'] . '.gif" width="24" title="Глава клана">' . $zvn;
|
||
}
|
||
$ttl = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $clnf['id'] . '" AND `id` = "' . $pl['clan_prava'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($ttl['id'])) {
|
||
$zvn = '<font color="#' . $ttl['color'] . '"><b>' . $ttl['name'] . '</b></font> - ' . $zvn;
|
||
}
|
||
if ($pl['online'] > time() - 120) {
|
||
$rm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`name`,`city` FROM `room` WHERE `id` = "' . $pl['room'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($rm['id'])) {
|
||
$zvn .= ' - <i>' . $rm['name'] . '</i>';
|
||
}
|
||
} else {
|
||
$zvn .= ' - <i><font color="grey">персонаж сейчас не в клубе</font></i>';
|
||
}
|
||
if ($pl['battle'] > 0) {
|
||
$zvn .= ' <a href="logs.php?id=' . $pl['battle'] . '" target="_blank"><img width="20" height="20" style="vertical-align:bottom"src="//img.new-combats.tech/i/fighttype0.gif" title="Открыть лог поединка"></a>';
|
||
}
|
||
$r .= '<div style="padding:5px;background-color:#efedee"><span style="display:inline-block;width:350px;">' . $ico . ' <img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif" width="12" height="15" style="vertical-align:bottom"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clnf['name_mini'] . '.gif" width="24" height="15"><a onClick="top.chat.addto(\'' . $pl['login'] . '\',\'to\')" style="color:' . $pl['textcolor1'] . '" href="javascript:void(0)">' . $pl['login'] . '</a><font color="' . $pl['textcolor1'] . '">[' . $pl['level'] . ']<a href="/info/' . $pl['id'] . '" title="Инф. о ' . $pl['login'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_' . $pl['cityreg'] . '.gif" width="12" height="11"></a></font></span>' . $zvn . '</div>';
|
||
}
|
||
$i++;
|
||
}
|
||
$r .= '</fieldset>';
|
||
/* ----------------------------------------------------------------------------------------------------------------------------- */
|
||
}
|
||
}
|
||
if ($res['join2'] > 0) {
|
||
$cn_sp0 = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_joint` WHERE `id` = "' . $res['join2'] . '" AND `type` = "2" AND `time_close` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
$cn_sp = mysql_query(
|
||
'SELECT * FROM `clan_join` WHERE `alians` = "' . $cn_sp0['id'] . '" AND `clan` != "' . $res['id'] . '"' . $nacln . ' AND `time_end` = "0" AND `time_start` > 0'
|
||
);
|
||
while ($cn_pl = mysql_fetch_array($cn_sp)) {
|
||
/* ----------------------------------------------------------------------------------------------------------------------------- */
|
||
$clnf = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $cn_pl['clan'] . '" LIMIT 1')
|
||
);
|
||
$clna = mysql_fetch_array(
|
||
mysql_query('SELECT * FROM `clan_joint` WHERE `id` = "' . $res['join2'] . '" LIMIT 1')
|
||
);
|
||
$sp = mysql_query(
|
||
'SELECT `id`,`battle`,`login`,`clan`,`level`,`room`,`cityreg`,`align`,`clan_prava`,`mod_zvanie`,`sex`,`city`,`online`,`banned` FROM `users` WHERE `clan` = "' . $cn_pl['clan'] . '"'
|
||
);
|
||
$r .= '<fieldset style="border:1px dashed #eeeeee;margin-top:5px;">
|
||
<legend align="left"><span class="legtitle">Состав "' . $clna['name'] . '"</span></legend>';
|
||
$j = 0;
|
||
$i = 0;
|
||
while ($pl = mysql_fetch_array($sp)) {
|
||
if (!isset($_GET['online']) || $pl['online'] > time() - 120) {
|
||
$pl['textcolor1'] = '';
|
||
if ($pl['online'] > time() - 120) {
|
||
$ico = '<img onClick="top.chat.addto(\'' . $pl['login'] . '\',\'private\')" src="//img.new-combats.tech/i/lock.gif" width="20" height="15" style="cursor:pointer;vertical-align:bottom">';
|
||
$j++;
|
||
} else {
|
||
$pl['textcolor1'] = '#837f82';
|
||
$ico = '<img src="//img.new-combats.tech/i/offline.gif" width="20" height="15" style="vertical-align:bottom">';
|
||
}
|
||
$zvn = $pl['mod_zvanie'];
|
||
$zvn = str_replace('[b]', '<b>', $zvn);
|
||
$zvn = str_replace('[/b]', '</b>', $zvn);
|
||
$zvn = str_replace('[i]', '<i>', $zvn);
|
||
$zvn = str_replace('[/i]', '</i>', $zvn);
|
||
$zvn = str_replace('[u]', '<u>', $zvn);
|
||
$zvn = str_replace('[/u]', '</u>', $zvn);
|
||
$zvn = str_replace('[c=', '<font color="', $zvn);
|
||
$zvn = str_replace('=]', '">', $zvn);
|
||
$zvn = str_replace('[/c]', '</font>', $zvn);
|
||
if ($pl['clan_prava'] == 'glava') {
|
||
if ($zvn == 'Стажер' || $zvn == '') {
|
||
$zvn = '<b style="color:#008097">глава клана</b>';
|
||
}
|
||
$zvn = '<img style="vertical-align:top" src="//img.new-combats.tech/i/clan/' . $clnf['name_mini'] . '.gif" width="24" title="Глава клана">' . $zvn;
|
||
}
|
||
$ttl = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `clan_tituls` WHERE `clan` = "' . $clnf['id'] . '" AND `id` = "' . $pl['clan_prava'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($ttl['id'])) {
|
||
$zvn = '<font color="#' . $ttl['color'] . '"><b>' . $ttl['name'] . '</b></font> - ' . $zvn;
|
||
}
|
||
if ($pl['online'] > time() - 120) {
|
||
$rm = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`name`,`city` FROM `room` WHERE `id` = "' . $pl['room'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if (isset($rm['id'])) {
|
||
$zvn .= ' - <i>' . $rm['name'] . '</i>';
|
||
}
|
||
} else {
|
||
$zvn .= ' - <i><font color="grey">персонаж сейчас не в клубе</font></i>';
|
||
}
|
||
if ($pl['battle'] > 0) {
|
||
$zvn .= ' <a href="logs.php?id=' . $pl['battle'] . '" target="_blank"><img width="20" height="20" style="vertical-align:bottom"src="//img.new-combats.tech/i/fighttype0.gif" title="Открыть лог поединка"></a>';
|
||
}
|
||
$r .= '<div style="padding:5px;background-color:#efedee"><span style="display:inline-block;width:350px;">' . $ico . ' <img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif" width="12" height="15" style="vertical-align:bottom"><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clnf['name_mini'] . '.gif" width="24" height="15"><a onClick="top.chat.addto(\'' . $pl['login'] . '\',\'to\')" style="color:' . $pl['textcolor1'] . '" href="javascript:void(0)">' . $pl['login'] . '</a><font color="' . $pl['textcolor1'] . '">[' . $pl['level'] . ']<a href="/info/' . $pl['id'] . '" title="Инф. о ' . $pl['login'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_' . $pl['cityreg'] . '.gif" width="12" height="11"></a></font></span>' . $zvn . '</div>';
|
||
}
|
||
$i++;
|
||
}
|
||
$r .= '</fieldset>';
|
||
/* ----------------------------------------------------------------------------------------------------------------------------- */
|
||
}
|
||
}
|
||
|
||
$r .= '<br>Online: <a href="main.php?clan&members&online">' . $j . '</a><br>Всего: <a href="main.php?clan&members">' . $i . '</a><br><small>(список обновляется <s>в полночь</s>)</small>';
|
||
echo $r;
|
||
?>
|
||
</fieldset>
|
||
</div>
|
||
<?php } ?>
|
||
|
||
|
||
</div><!-- .section -->
|