<?php
use Insallah\Db, Insallah\TournamentModel;

$db = new Db();
$members = [];
$user = $db::getRow('select id, room, level 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['uid']);
}
?>

<strong>Турнир для <?= $user['level'] ?> уровней.</strong><br>
Время подачи заявки: <?= date('G:i', $tournamentStartTime) ?>
<?php if (date('j', time()) !== date('j', $tournamentStartTime)): ?>
    (не сегодня!)
<?php endif; ?>
<br>
Участники: <?= implode(', ', $members) ?>


