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:25:02 +02:00
|
|
|
width: 2rem; /* Größe weiter auf 75% reduziert */
|
|
|
|
|
height: 2rem; /* Größe weiter auf 75% reduziert */
|
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 11:23:21 +02:00
|
|
|
table th, table td {
|
2026-10-04 11:25:02 +02:00
|
|
|
padding-top: 0.1rem;
|
|
|
|
|
padding-bottom: 0.1rem;
|
2026-10-04 11:23:21 +02:00
|
|
|
}
|
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 23:15:54 +02:00
|
|
|
<div class="legend-item"><img src="/img/joker.png" alt="Joker" class="joker-icon"> Joker gesetzt</div>
|
2026-10-04 23:38:41 +02:00
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: var(--col-tendenz);"></div> Richtige Tendenz</div>
|
|
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: var(--col-exact);"></div> Richtiges Ergebnis</div>
|
|
|
|
|
<div class="legend-item"><div class="legend-color" style="background-color: var(--col-joker-exact);"></div> Richtiges Ergebnis mit Joker</div>
|
2026-10-04 06:31:32 +02:00
|
|
|
</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>
|
2026-10-04 21:00:54 +02:00
|
|
|
<small>(<?php echo htmlspecialchars(App\Models\Game::getResultString($game['score1'], $game['score2'], $game['kickoff'])); ?>)</small>
|
2026-10-04 06:04:25 +02:00
|
|
|
</th>
|
2026-10-04 05:58:19 +02:00
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tr>
|
2026-10-04 06:04:25 +02:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2026-10-04 23:38:41 +02:00
|
|
|
<?php foreach ($ranking as $entry):
|
|
|
|
|
$rowClasses = [];
|
|
|
|
|
if ($entry['rank'] <= 3) $rowClasses[] = 'rank-' . $entry['rank'];
|
|
|
|
|
if ((int)$entry['user_id'] === (int)App\Core\Auth::id()) $rowClasses[] = 'me';
|
|
|
|
|
?>
|
|
|
|
|
<tr<?php if ($rowClasses) echo ' class="' . implode(' ', $rowClasses) . '"'; ?>>
|
|
|
|
|
<td class="text-center"><span class="rank-badge"><?php echo $entry['rank']; ?>.</span></td>
|
2026-10-04 06:04:25 +02:00
|
|
|
<td><?php echo htmlspecialchars($entry['name']); ?></td>
|
2026-10-04 23:15:54 +02:00
|
|
|
<td class="text-center"><?php echo $entry['is_day_winner'] ? '<span class="daily-winner-icon">🏆</span>' : ''; ?></td>
|
|
|
|
|
<td class="text-center"><strong><?php echo $entry['total']; ?></strong></td>
|
|
|
|
|
<td class="text-center"><?php echo $entry['points']; ?></td>
|
2026-10-04 06:04:25 +02:00
|
|
|
<?php foreach ($games as $game): ?>
|
2026-10-04 06:14:07 +02:00
|
|
|
<?php
|
2026-10-04 23:15:54 +02:00
|
|
|
$tipp = $entry['cells'][$game['id']];
|
2026-10-04 21:00:54 +02:00
|
|
|
// Farbklasse kommt fertig aus Tipp::getCol (col_tendenz / col_exact / col_joker_exact)
|
2026-10-04 06:14:07 +02:00
|
|
|
$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
|
|
|
?>
|
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 23:15:54 +02:00
|
|
|
<?php if ($tipp['joker']): ?>
|
|
|
|
|
<img src="/img/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'; ?>
|