game/modules_data/location/tournaments_lobby.php
2023-01-10 18:30:35 +02:00

41 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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) ?>