tippspiel2027/src/Views/round.php

47 lines
1.8 KiB
PHP
Raw Normal View History

<?php
// Stellt sicher, dass die benötigten Variablen vorhanden sind
if (!isset($selectedRound) || !isset($roundsToShow)) {
echo "Fehler: Daten für die Rundenansicht nicht gefunden.";
exit;
}
$pageTitle = 'Rundenübersicht - ' . htmlspecialchars($selectedRound['name']);
require __DIR__ . '/partials/header.php';
?>
<h1>Tippübersicht bis: <?php echo htmlspecialchars($selectedRound['name']); ?></h1>
<?php foreach ($roundsToShow as $round): ?>
<h2><?php echo htmlspecialchars($round['name']); ?></h2>
<?php if (!empty($round['games'])): ?>
<table>
<thead>
<tr>
<th>Anpfiff</th>
<th>Heim</th>
<th>Gast</th>
<th>Ergebnis</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($round['games'] as $game): ?>
<tr>
<td><?php echo htmlspecialchars((new DateTime($game['kickoff']))->format('d.m.Y H:i')); ?></td>
<td><?php echo htmlspecialchars($game['team1']); ?></td>
<td><?php echo htmlspecialchars($game['team2']); ?></td>
<td><?php echo App\Models\Game::getResultString($game['score1'], $game['score2'], $game['kickoff']); ?></td>
<td><?php echo App\Models\Game::isLocked($game['kickoff']) ? 'Gesperrt' : 'Offen'; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>Für diese Runde wurden keine Spiele gefunden.</p>
<?php endif; ?>
<?php endforeach; ?>
<p><a href="/">Zurück zur Startseite</a></p>
<?php require __DIR__ . '/partials/footer.php'; ?>