2026-10-03 17:35:26 +02:00
|
|
|
<?php
|
|
|
|
|
$pageTitle = 'Rangliste';
|
2026-10-04 06:04:25 +02:00
|
|
|
if ($selectedRound) {
|
|
|
|
|
$pageTitle .= ' - ' . htmlspecialchars($selectedRound['name']);
|
|
|
|
|
}
|
2026-10-03 17:35:26 +02:00
|
|
|
require __DIR__ . '/partials/header.php';
|
|
|
|
|
|
|
|
|
|
// Stellt sicher, dass die benötigten Variablen vorhanden sind
|
2026-10-04 06:04:25 +02:00
|
|
|
if (!isset($currentSeason) || !isset($ranking) || !isset($games) || !isset($allRounds) || !isset($selectedRound)) {
|
2026-10-03 17:35:26 +02:00
|
|
|
echo "Fehler: Daten für die Rangliste nicht gefunden.";
|
2026-10-04 06:04:25 +02:00
|
|
|
// exit; // Besser, eine freundliche Nachricht im Layout anzuzeigen
|
2026-10-03 17:35:26 +02:00
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
2026-10-04 07:43:52 +02:00
|
|
|
<style>
|
|
|
|
|
.game-header {
|
2026-10-04 11:11:00 +02:00
|
|
|
width: 100px; /* Feste Breite für die Spiele-Spalten */
|
2026-10-04 07:43:52 +02:00
|
|
|
}
|
|
|
|
|
.tipp-points {
|
2026-10-04 11:09:42 +02:00
|
|
|
width: 30px; /* Angepasste Breite für Punkte */
|
2026-10-04 07:46:23 +02:00
|
|
|
box-sizing: border-box;
|
2026-10-04 07:43:52 +02:00
|
|
|
text-align: right;
|
|
|
|
|
padding-right: 5px;
|
|
|
|
|
}
|
|
|
|
|
.tipp-joker {
|
2026-10-04 11:11:00 +02:00
|
|
|
width: 70px; /* Breite für vergrößerten Joker */
|
2026-10-04 07:46:23 +02:00
|
|
|
box-sizing: border-box;
|
2026-10-04 07:43:52 +02:00
|
|
|
padding-left: 5px;
|
2026-10-04 11:09:42 +02:00
|
|
|
text-align: center;
|
2026-10-04 07:43:52 +02:00
|
|
|
}
|
2026-10-04 11:09:42 +02:00
|
|
|
.joker-icon {
|
2026-10-04 11:12:00 +02:00
|
|
|
width: 3.6rem; /* Breite des Jokers weiter vergrößert */
|
2026-10-04 11:13:00 +02:00
|
|
|
height: 3.6rem; /* Höhe verdoppelt */
|
2026-10-04 07:43:52 +02:00
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
2026-10-04 11:13:54 +02:00
|
|
|
.daily-winner-icon {
|
|
|
|
|
font-size: 2rem; /* Größe verdoppeln */
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
2026-10-04 11:16:06 +02:00
|
|
|
#round_id {
|
|
|
|
|
font-size: inherit; /* Schriftgröße an die Umgebung anpassen */
|
|
|
|
|
}
|
2026-10-04 07:43:52 +02:00
|
|
|
</style>
|
|
|
|
|
|
2026-10-03 17:35:26 +02:00
|
|
|
<h1>Rangliste</h1>
|
|
|
|
|
<h2>Saison: <?php echo htmlspecialchars($currentSeason['name']); ?></h2>
|
|
|
|
|
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php if ($selectedRound): ?>
|
|
|
|
|
<div class="round-filter">
|
|
|
|
|
<form method="get">
|
|
|
|
|
<input type="hidden" name="page" value="ranking">
|
|
|
|
|
<label for="round_id">Runde auswählen:</label>
|
|
|
|
|
<select name="round_id" id="round_id" onchange="this.form.submit()">
|
|
|
|
|
<?php foreach ($allRounds as $round): ?>
|
|
|
|
|
<option value="<?php echo $round['id']; ?>" <?php echo ($round['id'] == $selectedRound['id']) ? 'selected' : ''; ?>>
|
|
|
|
|
<?php echo htmlspecialchars($round['name']); ?>
|
|
|
|
|
</option>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</select>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-04 06:31:32 +02:00
|
|
|
<div class="legend">
|
2026-10-04 11:13:54 +02:00
|
|
|
<div class="legend-item"><span class="daily-winner-icon">🏆</span> Tagessieger</div>
|
2026-10-04 07:24:32 +02:00
|
|
|
<div class="legend-item"><img src="/image.php?file=icons/joker.png" alt="Joker" class="joker-icon"> Joker gesetzt</div>
|
2026-10-04 06:31:32 +02:00
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: orange;"></div> Exaktes Ergebnis</div>
|
|
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: red;"></div> Exakt mit Joker</div>
|
|
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: gold;"></div> Richtige Differenz</div>
|
|
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: grey;"></div> Richtige Tendenz</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-04 06:04:25 +02:00
|
|
|
<div class="table-container">
|
|
|
|
|
<?php if (!empty($ranking)): ?>
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
2026-10-04 05:58:19 +02:00
|
|
|
<tr>
|
2026-10-04 06:19:01 +02:00
|
|
|
<th class="text-center">Platz</th>
|
2026-10-04 06:04:25 +02:00
|
|
|
<th>Name</th>
|
2026-10-04 11:13:54 +02:00
|
|
|
<th class="text-center"><span class="daily-winner-icon">🏆</span></th>
|
2026-10-04 06:19:01 +02:00
|
|
|
<th class="text-center">Punkte (Gesamt)</th>
|
|
|
|
|
<th class="text-center">Punkte (Runde)</th>
|
2026-10-04 05:58:19 +02:00
|
|
|
<?php foreach ($games as $game): ?>
|
2026-10-04 07:43:52 +02:00
|
|
|
<th class="game-header" colspan="2">
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php echo htmlspecialchars($game['team1']); ?><br>
|
|
|
|
|
<?php echo htmlspecialchars($game['team2']); ?><br>
|
|
|
|
|
<small>(<?php echo App\Models\Game::getResultString($game['score1'], $game['score2'], $game['kickoff']); ?>)</small>
|
|
|
|
|
</th>
|
2026-10-04 05:58:19 +02:00
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tr>
|
2026-10-04 06:04:25 +02:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php foreach ($ranking as $entry): ?>
|
|
|
|
|
<tr>
|
2026-10-04 06:19:01 +02:00
|
|
|
<td class="text-center"><?php echo $entry['rank']; ?>.</td>
|
2026-10-04 06:04:25 +02:00
|
|
|
<td><?php echo htmlspecialchars($entry['name']); ?></td>
|
2026-10-04 11:13:54 +02:00
|
|
|
<td class="text-center"><?php echo in_array($entry['id'], $dailyWinners) ? '<span class="daily-winner-icon">🏆</span>' : ''; ?></td>
|
2026-10-04 06:19:01 +02:00
|
|
|
<td class="text-center"><strong><?php echo $entry['score']; ?></strong></td>
|
|
|
|
|
<td class="text-center"><?php echo $entry['round_score']; ?></td>
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php foreach ($games as $game): ?>
|
2026-10-04 06:14:07 +02:00
|
|
|
<?php
|
|
|
|
|
$tipp = $entry['tipps'][$game['id']];
|
|
|
|
|
$td_class = $tipp['color'];
|
2026-10-04 07:43:52 +02:00
|
|
|
$title = "Tipp: " . htmlspecialchars($tipp['text']) . " | Punkte: " . $tipp['points'];
|
2026-10-04 06:14:07 +02:00
|
|
|
// Spezielle Farbe für exakten Tipp mit Joker
|
|
|
|
|
if ($td_class === 'col_exact' && $tipp['is_joker']) {
|
|
|
|
|
$td_class = 'col_joker_exact';
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-10-04 07:43:52 +02:00
|
|
|
<td class="tipp-cell tipp-points <?php echo htmlspecialchars($td_class); ?>" title="<?php echo $title; ?>">
|
2026-10-04 06:24:30 +02:00
|
|
|
<?php echo $tipp['points']; ?>
|
2026-10-04 07:43:52 +02:00
|
|
|
</td>
|
2026-10-04 07:46:23 +02:00
|
|
|
<td class="tipp-cell tipp-joker" title="<?php echo $title; ?>">
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php if ($tipp['is_joker']): ?>
|
2026-10-04 07:24:32 +02:00
|
|
|
<img src="/image.php?file=icons/joker.png" alt="Joker" class="joker-icon" title="Joker">
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</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>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<p>Keine Runde für die Anzeige ausgewählt oder gefunden.</p>
|
|
|
|
|
<?php endif; ?>
|
2026-10-03 17:35:26 +02:00
|
|
|
|
|
|
|
|
<?php require __DIR__ . '/partials/footer.php'; ?>
|