feat: Implementiere Rangliste

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
torsten 2026-10-03 17:35:26 +02:00
parent 19e40998c2
commit fdf47f5aa2
4 changed files with 157 additions and 1 deletions

View file

@ -19,6 +19,6 @@
<a href="/">Start</a>
<a href="#">Administration</a>
<a href="#">Tipps</a>
<a href="#">Rangliste</a>
<a href="/index.php?page=ranking">Rangliste</a>
<a href="#">Info</a>
</nav>

38
src/Views/ranking.php Normal file
View file

@ -0,0 +1,38 @@
<?php
$pageTitle = 'Rangliste';
require __DIR__ . '/partials/header.php';
// Stellt sicher, dass die benötigten Variablen vorhanden sind
if (!isset($currentSeason) || !isset($ranking)) {
echo "Fehler: Daten für die Rangliste nicht gefunden.";
exit;
}
?>
<h1>Rangliste</h1>
<h2>Saison: <?php echo htmlspecialchars($currentSeason['name']); ?></h2>
<?php if (!empty($ranking)): ?>
<table>
<thead>
<tr>
<th>Platz</th>
<th>Name</th>
<th>Punkte</th>
</tr>
</thead>
<tbody>
<?php foreach ($ranking as $entry): ?>
<tr>
<td><?php echo $entry['rank']; ?>.</td>
<td><?php echo htmlspecialchars($entry['name']); ?></td>
<td><?php echo $entry['score']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>Für diese Saison gibt es noch keine Rangliste.</p>
<?php endif; ?>
<?php require __DIR__ . '/partials/footer.php'; ?>