game/clans_inf.php

334 lines
17 KiB
PHP
Raw Normal View History

<?php
2022-06-06 21:30:34 +00:00
include_once('_incl_data/__config.php');
const GAME = true;
2022-06-06 21:30:34 +00:00
include_once('_incl_data/class/__db_connect.php');
$uplogin = explode('&', $_SERVER['QUERY_STRING']);
$uplogin = $uplogin[0];
$uplogin = preg_replace('/%20/', " ", $uplogin);
if (!isset($_GET['id'])) {
$_GET['id'] = 0;
}
if (!isset($upLogin)) {
$upLogin = '';
}
$utf8Login = '';
$utf8Login2 = '';
$utf8Login = $uplogin;
if ($uplogin != 'delete' && $utf8Login != 'delete' && $utf8Login2 != 'delete') {
$clan = Db::getRow('select * from clan where id = ? or id = ? or name = ? limit 1', [$_GET['id'], $uplogin, $uplogin]);
}
if (!isset($clan['id'])) {
die(
'<html><head>
2022-06-06 21:30:34 +00:00
<meta http-equiv="Content-Language" content="ru">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
2023-01-10 16:29:32 +00:00
<TITLE>Произошла ошибка</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>
Произошла ошибка: <pre>Указанный клан не найден...</pre>
<b><p><a href = "javascript:window.history.go(-1);">Назад</b></a>
2022-06-06 21:30:34 +00:00
<HR>
<p align="right">(c) <a href="index.html">' . $c['title'] . '</a></p>
</body></html>'
);
}
$xu = mysql_fetch_array(
mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `real` = 1 AND `clan` = "' . $clan['id'] . '" LIMIT 1')
);
$xu = 0 + $xu[0];
$r1 = mysql_fetch_array(
mysql_query(
'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $clan['id'] . '" AND `date` = "' . date(
'dmY'
) . '" LIMIT 1'
)
);
$r2 = mysql_fetch_array(
mysql_query(
'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $clan['id'] . '" AND `date` != "' . date(
'dmY'
) . '" ORDER BY `id` DESC LIMIT 1'
)
);
$vid = '';
if (isset($r2['pos'])) {
if ($r2['pos'] < $r1['pos']) {
$vid = '<span style=\'color:red;\'>-' . ($r1['pos'] - $r2['pos']) . '</span>';
} elseif ($r2['pos'] > $r1['pos']) {
$vid = '<span style=\'color:green;\'>+' . ($r2['pos'] - $r1['pos']) . '</span>';
}
}
$clan_info = mysql_fetch_array(mysql_query('SELECT * FROM `clan_info` WHERE `id` = "' . $clan['id'] . '" LIMIT 1'));
if ($clan_info['info'] == '') {
2023-01-10 16:29:32 +00:00
$clan_info['info'] = '<i>Информация о клане отсутствует.</i>';
}
$vid1 = '';
if (isset($r2['pos'])) {
if (round($r2['global'] / (15678 + $r2['level']), 3) < round($r1['global'] / (15678 + $r1['level']), 3)) {
$vid1 = '&nbsp;<sup><span style=\'color:green;\'>+' . (round($r1['global'] / (15678 + $r1['level']), 3) - round(
$r2['global'] / (15678 + $r2['level']), 3
)) . '</span></sup>';
} elseif (round($r2['global'] / (15678 + $r2['level']), 3) > round($r1['global'] / (15678 + $r1['level']), 3)) {
$vid1 = '&nbsp;<sup><span style=\'color:red;\'>-' . (round($r2['global'] / (15678 + $r2['level']), 3) - round(
$r1['global'] / (15678 + $r1['level']), 3
)) . '</span></sup>';
}
}
$vid2 = '';
if (isset($r2['pos'])) {
if ($r2['exp_real'] < $r1['exp_real']) {
$vid2 = '&nbsp;<sup><span style=\'color:green;\'>+' . ($r1['exp_real'] - $r2['exp_real']) . '</span></sup>';
} elseif ($r2['exp_real'] > $r1['exp_real']) {
$vid2 = '&nbsp;<sup><span style=\'color:red;\'>-' . ($r2['exp_real'] - $r1['exp_real']) . '</span></sup>';
}
}
$vid3 = '';
if (isset($r2['pos'])) {
if ($r2['win'] < $r1['win']) {
$vid3 = '&nbsp;<sup><span style=\'color:green;\'>+' . ($r1['win'] - $r2['win']) . '</span></sup>';
} elseif ($r2['win'] > $r1['win']) {
$vid3 = '&nbsp;<sup><span style=\'color:red;\'>-' . ($r2['win'] - $r1['win']) . '</span></sup>';
}
}
$vid4 = '';
if (isset($r2['pos'])) {
if ($r2['lose'] < $r1['lose']) {
$vid4 = '&nbsp;<sup><span style=\'color:red;\'>+' . ($r1['lose'] - $r2['lose']) . '</span></sup>';
} elseif ($r2['lose'] > $r1['lose']) {
$vid4 = '&nbsp;<sup><span style=\'color:green;\'>-' . ($r2['lose'] - $r1['lose']) . '</span></sup>';
}
}
$vid5 = '';
if (isset($r2['pos'])) {
if ($r2['nich'] < $r1['nich']) {
$vid5 = '&nbsp;<sup><span style=\'color:red;\'>+' . ($r1['nich'] - $r2['nich']) . '</span></sup>';
} elseif ($r2['nich'] > $r1['nich']) {
$vid5 = '&nbsp;<sup><span style=\'color:green;\'>-' . ($r2['nich'] - $r1['nich']) . '</span></sup>';
}
}
[$clanw, $clanl] = \Model\BattleModel::countClanWars($clan['id']);
$clanwar = mysql_query(
'SELECT * FROM `clan_wars` WHERE (`clan1`="' . $clan['id'] . '" OR `clan2`="' . $clan['id'] . '") AND `time_finish` > "' . time() . '"'
);
$clwe = "";
while ($clanwa = mysql_fetch_array($clanwar)) {
if ($clanwa['clan1'] == $clan['id']) {
$clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $clanwa['clan2'] . '" LIMIT 1'));
$clwe .= '<img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clw['name'] . '.gif"><b>' . $clw['name'] . ' </b>';
} else {
$clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $clanwa['clan1'] . '" LIMIT 1'));
$clwe .= '<img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $clw['name'] . '.gif"><b>' . $clw['name'] . ' </b>';
}
}
2022-06-06 21:30:34 +00:00
?>
<HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
2023-01-10 16:29:32 +00:00
<title>Информация о клане <?= $clan['name'] ?></title>
<link href="//img.new-combats.tech/i/move/design3.css" rel="stylesheet" type="text/css">
<link href="//img.new-combats.tech/css/main.css" rel="stylesheet" type="text/css">
<link href="/res/css/style.css" rel="stylesheet" type="text/css" media="all"/>
<script type="text/javascript" src="js/jquery.js"></script>
<META Http-Equiv=Cache-Control Content="no-cache, max-age=0, must-revalidate, no-store">
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
2022-06-06 21:30:34 +00:00
</HEAD>
<body style="margin:10px; margin-top:5px; background-repeat:no-repeat; background-position: top right" bgcolor=e2e0e0>
<div id="main" style="margin: 5px 5px 0 5px;">
<table width=100%>
<tr>
<td style="background: #C7C7C7; border: 1px solid #A6A5A3; padding: 4px 20px 4px 20px;">
<h3 style="width: 250px; float: left;"><?= $clan['name'] ?></h3>
2023-01-10 16:29:32 +00:00
<h3 style="width: 250px; float: right;"><a href="/rating_clans#<?= $clan['id'] ?>" target="_blank">Позиция: <?= (0 + $r1['pos']) ?></a>
<sup><?= $vid ?></sup></h3>
2023-01-10 16:29:32 +00:00
<h3>Рейтинг: <?= round($r1['global'] / (15678 + $r1['level']), 3) . $vid1 ?></sup></h3>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top">
<div style="padding-right:60px;">
<fieldset id="aboutclan"
style="border: 1px solid white; display: block; float:left; clear: left; width:100%;min-height:20px; padding:10px; margin-top:15px;">
2023-01-10 16:29:32 +00:00
<legend style='font-weight:bold; color:#8F0000;'>Информация о
Клане <?= $clan['name'] ?></legend>
<?= $clan_info['info'] ?>
</fieldset>
<fieldset id="aboutclan"
style="border: 1px solid white; display: block; float:left; clear: left; width:100%;min-height:20px; padding:10px; margin-top:15px;">
2023-01-10 16:29:32 +00:00
<legend style='font-weight:bold; color:#8F0000;'>Клан сайт:</legend>
<a href="<?= $clan['site']; ?>" target="_blank"> <?= $clan['site']; ?> </a>
</fieldset>
<fieldset id="statclan"
style="border: 1px solid white; display: block; float:left; clear: left; width:100%;min-height:100px; padding: 10px; margin-top:15px;margin-bottom: 15px;">
2023-01-10 16:29:32 +00:00
<legend style='font-weight:bold; color:#8F0000;'>Статистика Клана</legend>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Рейтинг:</b></td>
<td><?= round($r1['global'] / (15678 + $r1['level']), 3) . $vid1 ?></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Опыт:</b></td>
<td><?= number_format($r1['exp_real'], 0, ",", " ") . $vid2 ?></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Позиция:</b></td>
<td><span title="Позиция клана в общем рейтинге"><a
href="/rating_clans#<?= $clan['id'] ?>"
target="_blank"><?= (0 + $r1['pos']) ?></a></span> <sup
2023-01-10 16:29:32 +00:00
title="Изменение позиции клана за день"><?= $vid ?></sup></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td colspan="2"><b><font color=green>Статистика персонажей:</font></b></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Побед:</b></td>
<td><?= number_format($r1['win'], 0, ",", " ") . $vid3 ?></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Поражений:</b></td>
<td><?= number_format($r1['lose'], 0, ",", " ") . $vid4 ?></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Ничьих:</b></td>
<td><?= number_format($r1['nich'], 0, ",", " ") . $vid5 ?></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td colspan="2"><b><font color=#A00>Статистика войн:</font></b></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Текущие войны:</b></td>
2023-03-31 16:54:33 +00:00
<td><span><?= $clwe; ?></span></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Побед:</b></td>
2023-03-31 16:54:33 +00:00
<td><span><?= $clanw; ?></span></td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Поражений:</b></td>
2023-03-31 16:54:33 +00:00
<td><span><?= $clanl; ?></span></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Ожидаемый рейтинг:</b></td>
2023-03-31 16:54:33 +00:00
<td><span><?= ($clanw - $clanl) * 10000; ?></span></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
2023-01-10 16:29:32 +00:00
<td width="150"><b>Дата регистрации:</b></td>
<td><span title="Дата регистрации клана"><?= date('d.m.Y', $clan['time_reg']) ?></span>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
<td width="400" align="left" valign="top">
<div style="width:390px;display: block;">
<fieldset id="clansostav"
style="width:390px; border: 1px solid white; display: block; clear:right; float: right; padding: 10px;margin-top:15px;">
2023-01-10 16:29:32 +00:00
<legend style='font-weight:bold; color:#8F0000;'>Состав</legend>
<?php
$sp = mysql_query(
'SELECT * FROM `users` WHERE `clan` = "' . $clan['id'] . '" AND `clan_prava` = "glava" ORDER BY `login` ASC'
);
$html = '';
while ($pl = mysql_fetch_array($sp)) {
if ($pl['online'] < time() - 520) {
$html .= '<div style="color:grey">';
} else {
$html .= '<div>';
}
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif"> ';
if ($pl['align2'] > 0) {
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align2'] . '.gif"> ';
}
$html .= '<img src="//img.new-combats.tech/i/clan/' . $clan['name'] . '.gif"> ';
$html .= '<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']';
$html .= ' <a href="/info/' . $pl['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a>';
2023-01-10 16:29:32 +00:00
$html .= ' <small>- <font color=#008080><b>Глава клана</b></font></small>';
if ($pl['online'] < time() - 520) {
2023-01-10 16:29:32 +00:00
$html .= '&nbsp; <sup><i>не в игре</i></sup></div>';
} else {
$html .= '</div>';
}
}
$html .= '<br>';
$sp = mysql_query(
'SELECT * FROM `users` WHERE `clan` = "' . $clan['id'] . '" AND `clan_prava` != "glava" AND `online` > "' . (time() - 520) . '" ORDER BY `login` ASC'
);
while ($pl = mysql_fetch_array($sp)) {
$html .= '<div>';
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif"> ';
if ($pl['align2'] > 0) {
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align2'] . '.gif"> ';
}
$html .= '<img src="//img.new-combats.tech/i/clan/' . $clan['name'] . '.gif"> ';
$html .= '<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']';
$html .= ' <a href="/info/' . $pl['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a>';
$html .= ' <small>- ' . $pl['mod_zvanie'] . '</small>';
$html .= '</div>';
}
$sp = mysql_query(
'SELECT * FROM `users` WHERE `clan` = "' . $clan['id'] . '" AND `clan_prava` != "glava" AND `online` <= "' . (time() - 520) . '" ORDER BY `login` ASC'
);
while ($pl = mysql_fetch_array($sp)) {
$html .= '<div style="color:grey">';
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align'] . '.gif"> ';
if ($pl['align2'] > 0) {
$html .= '<img src="//img.new-combats.tech/i/align/align' . $pl['align2'] . '.gif"> ';
}
$html .= '<img src="//img.new-combats.tech/i/clan/' . $clan['name'] . '.gif"> ';
$html .= '<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']';
$html .= ' <a href="/info/' . $pl['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif"></a>';
$html .= ' <small>- ' . $pl['mod_zvanie'] . '</small>';
2023-01-10 16:29:32 +00:00
$html .= '&nbsp; <sup><i>не в игре</i></sup></div>';
}
echo $html;
unset($html);
?>
2023-01-10 16:29:32 +00:00
<br/>Всего: <b><?= (0 + $xu) ?></b>
</fieldset>
</div>
</td>
</tr>
2022-06-06 21:30:34 +00:00
</table>
</div>
</body>
</HTML>