game/modules_data/location/tournaments_lobby.php
2022-12-30 21:03:50 +02:00

41 lines
1.0 KiB
PHP

<?php
use Insallah\Db, Insallah\TournamentModel;
$db = new Db();
$members = [];
$user = $db::getRow('select id, room, level, login from users where login = ?', [$_COOKIE['login']]);
$tournamentStartTime = $db::getValue('select start_time from tournaments where tid = ?', [$user['level']]);
foreach (TournamentModel::getFreeFighters($user['level']) as $member) {
$members[] = TournamentModel::uidToLogin($member);
}
?>
<strong>Òóðíèð äëÿ <?= $user['level'] ?> óðîâíåé.</strong><br>
<?php
if (empty($members) || empty($tournamentStartTime)): ?>
Òóðíèðà - íåò. Ó÷àñòíèêîâ - íåò. Êàê âû ñþäà çàáðåëè? Íå-åò, ñâîèì õîäîì âû îòñþäà íå âûáåðåòåñü!
<?php
exit(); endif; ?>
<?php
if ((int)$tournamentStartTime === -1): ?>
Òóðíèð íà÷àëñÿ!
<?php
else: ?>
Âðåìÿ ïîäà÷è çàÿâêè: <?= date('G:i', $tournamentStartTime) ?>
<?php
if (date('j', time()) !== date('j', $tournamentStartTime)): ?>
(íå ñåãîäíÿ!)
<?php
endif; ?>
<?php
endif; ?>
<br>
<?= $user['login'] ?><br>
Ó÷àñòíèêè: <?= implode(', ', $members) ?>