feat: Füge Rundenansicht mit Spielanzeige hinzu
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
parent
4bf3bbb978
commit
4377106919
2 changed files with 68 additions and 0 deletions
53
src/Views/round.php
Normal file
53
src/Views/round.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
// Stellt sicher, dass die benötigten Variablen vorhanden sind
|
||||
if (!isset($round) || !isset($games)) {
|
||||
echo "Fehler: Daten für die Rundenansicht nicht gefunden.";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tippspiel 2027 - <?php echo htmlspecialchars($round['name']); ?></title>
|
||||
<style>
|
||||
body { font-family: sans-serif; margin: 2em; }
|
||||
table { border-collapse: collapse; width: 100%; max-width: 800px; margin-top: 1em;}
|
||||
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
|
||||
th { background-color: #f4f4f4; }
|
||||
tr:nth-child(even) { background-color: #f9f9f9; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><?php echo htmlspecialchars($round['name']); ?></h1>
|
||||
|
||||
<?php if (!empty($games)): ?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Anpfiff</th>
|
||||
<th>Heim</th>
|
||||
<th>Gast</th>
|
||||
<th>Ergebnis</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($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; ?>
|
||||
|
||||
<p><a href="/">Zurück zur Startseite</a></p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue