2026-10-03 17:35:26 +02:00
|
|
|
<?php
|
|
|
|
|
$pageTitle = 'Rangliste';
|
|
|
|
|
require __DIR__ . '/partials/header.php';
|
|
|
|
|
|
|
|
|
|
// Stellt sicher, dass die benötigten Variablen vorhanden sind
|
2026-10-04 05:58:19 +02:00
|
|
|
if (!isset($currentSeason) || !isset($ranking) || !isset($games)) {
|
2026-10-03 17:35:26 +02:00
|
|
|
echo "Fehler: Daten für die Rangliste nicht gefunden.";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-10-04 05:58:19 +02:00
|
|
|
<style>
|
|
|
|
|
/* Styling für die Punkt-Zellen in der Rangliste */
|
|
|
|
|
.tipp-cell { text-align: center; }
|
|
|
|
|
.col_exact { background-color: #28a745 !important; color: white; } /* Exaktes Ergebnis */
|
|
|
|
|
.col_diff { background-color: #ffc107 !important; } /* Richtige Tordifferenz */
|
|
|
|
|
.col_tendenz { background-color: #17a2b8 !important; color: white; } /* Richtige Tendenz */
|
|
|
|
|
.joker-tipp { border: 2px solid #007bff; } /* Blauer Rahmen für Joker */
|
|
|
|
|
|
|
|
|
|
/* Damit die Tabelle auf kleineren Bildschirmen scrollbar wird */
|
|
|
|
|
.table-container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
th.vertical-text {
|
|
|
|
|
writing-mode: vertical-rl;
|
|
|
|
|
transform: rotate(180deg);
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
text-align: left;
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
table { width: auto; } /* Erlaubt der Tabelle, breiter als der Container zu sein */
|
|
|
|
|
</style>
|
2026-10-03 17:35:26 +02:00
|
|
|
|
|
|
|
|
<h1>Rangliste</h1>
|
|
|
|
|
<h2>Saison: <?php echo htmlspecialchars($currentSeason['name']); ?></h2>
|
|
|
|
|
|
2026-10-04 05:58:19 +02:00
|
|
|
<div class="table-container">
|
|
|
|
|
<?php if (!empty($ranking)): ?>
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
2026-10-03 17:35:26 +02:00
|
|
|
<tr>
|
2026-10-04 05:58:19 +02:00
|
|
|
<th>Platz</th>
|
|
|
|
|
<th>Name</th>
|
|
|
|
|
<th>Punkte</th>
|
|
|
|
|
<?php foreach ($games as $game): ?>
|
|
|
|
|
<th class="vertical-text" title="<?php echo htmlspecialchars($game['team1'] . ' vs ' . $game['team2']); ?>">
|
|
|
|
|
<span><?php echo htmlspecialchars($game['team1'] . ' - ' . $game['team2']); ?></span>
|
|
|
|
|
</th>
|
|
|
|
|
<?php endforeach; ?>
|
2026-10-03 17:35:26 +02:00
|
|
|
</tr>
|
2026-10-04 05:58:19 +02:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php foreach ($ranking as $entry): ?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><?php echo $entry['rank']; ?>.</td>
|
|
|
|
|
<td><?php echo htmlspecialchars($entry['name']); ?></td>
|
|
|
|
|
<td><strong><?php echo $entry['score']; ?></strong></td>
|
|
|
|
|
<?php foreach ($games as $game): ?>
|
|
|
|
|
<?php $tipp = $entry['tipps'][$game['id']]; ?>
|
|
|
|
|
<td class="tipp-cell <?php echo htmlspecialchars($tipp['color']); ?> <?php echo $tipp['is_joker'] ? 'joker-tipp' : ''; ?>">
|
|
|
|
|
<span title="Dein Tipp: <?php echo htmlspecialchars($tipp['text']); ?><?php echo $tipp['is_joker'] ? ' (Joker)' : ''; ?>">
|
|
|
|
|
<?php echo $tipp['points']; ?>
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<p>Für diese Saison gibt es noch keine Rangliste (möglicherweise haben noch keine Spieler bezahlt).</p>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
2026-10-03 17:35:26 +02:00
|
|
|
|
|
|
|
|
<?php require __DIR__ . '/partials/footer.php'; ?>
|