feat: Implementiere Rangliste
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
parent
19e40998c2
commit
fdf47f5aa2
4 changed files with 157 additions and 1 deletions
38
src/Views/ranking.php
Normal file
38
src/Views/ranking.php
Normal 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'; ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue