2026-10-03 16:43:00 +02:00
|
|
|
<?php
|
2026-10-04 06:11:02 +02:00
|
|
|
use App\Models\Game;
|
|
|
|
|
use App\Models\Tipp;
|
|
|
|
|
|
2026-10-03 16:43:00 +02:00
|
|
|
// Stellt sicher, dass die benötigten Variablen vorhanden sind
|
2026-10-04 06:11:02 +02:00
|
|
|
if (!isset($selectedRound) || !isset($roundsToShow) || !isset($users) || !isset($tipps_map)) {
|
2026-10-03 16:43:00 +02:00
|
|
|
echo "Fehler: Daten für die Rundenansicht nicht gefunden.";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2026-10-03 17:09:57 +02:00
|
|
|
|
2026-10-04 06:11:02 +02:00
|
|
|
$pageTitle = 'Tippübersicht - ' . htmlspecialchars($selectedRound['name']);
|
2026-10-03 17:09:57 +02:00
|
|
|
require __DIR__ . '/partials/header.php';
|
2026-10-03 16:43:00 +02:00
|
|
|
?>
|
2026-10-03 17:09:57 +02:00
|
|
|
|
|
|
|
|
<h1>Tippübersicht bis: <?php echo htmlspecialchars($selectedRound['name']); ?></h1>
|
|
|
|
|
|
2026-10-04 06:11:02 +02:00
|
|
|
<?php if (empty($users)): ?>
|
|
|
|
|
<p>Keine teilnehmenden Spieler für diese Saison gefunden.</p>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<?php foreach ($roundsToShow as $round): ?>
|
|
|
|
|
<h2><?php echo htmlspecialchars($round['name']); ?></h2>
|
|
|
|
|
<?php if (!empty($round['games'])): ?>
|
|
|
|
|
<div class="table-container">
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
2026-10-03 16:43:00 +02:00
|
|
|
<tr>
|
2026-10-04 06:11:02 +02:00
|
|
|
<th>Spieler</th>
|
|
|
|
|
<?php foreach ($round['games'] as $game): ?>
|
|
|
|
|
<th class="game-header">
|
|
|
|
|
<?php echo htmlspecialchars($game['team1']); ?><br>
|
|
|
|
|
<?php echo htmlspecialchars($game['team2']); ?><br>
|
|
|
|
|
<small>(<?php echo Game::getResultString($game['score1'], $game['score2'], $game['kickoff']); ?>)</small>
|
|
|
|
|
</th>
|
|
|
|
|
<?php endforeach; ?>
|
2026-10-03 16:43:00 +02:00
|
|
|
</tr>
|
2026-10-04 06:11:02 +02:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php foreach ($users as $user): ?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><?php echo htmlspecialchars($user['name']); ?></td>
|
|
|
|
|
<?php foreach ($round['games'] as $game): ?>
|
|
|
|
|
<?php
|
|
|
|
|
$tipp = $tipps_map[$user['id']][$game['id']] ?? null;
|
|
|
|
|
$color = '';
|
|
|
|
|
$text = '-';
|
|
|
|
|
$is_joker = false;
|
|
|
|
|
|
|
|
|
|
if ($tipp && $game['score1'] > -1) {
|
|
|
|
|
$color = Tipp::getCol($game['score1'], $game['score2'], $tipp['tipp1'], $tipp['tipp2'], $tipp['joker']);
|
|
|
|
|
}
|
|
|
|
|
if ($tipp) {
|
|
|
|
|
// Zeige Tipps nur für gesperrte Spiele
|
|
|
|
|
if (Game::isLocked($game['kickoff'])) {
|
|
|
|
|
$text = $tipp['tipp1'] . ':' . $tipp['tipp2'];
|
|
|
|
|
} else {
|
|
|
|
|
$text = 'verdeckt';
|
|
|
|
|
}
|
|
|
|
|
$is_joker = (bool)$tipp['joker'];
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-10-04 06:14:07 +02:00
|
|
|
<?php
|
|
|
|
|
$td_class = $color;
|
|
|
|
|
// Spezielle Farbe für exakten Tipp mit Joker
|
|
|
|
|
if ($td_class === 'col_exact' && $is_joker) {
|
|
|
|
|
$td_class = 'col_joker_exact';
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-10-04 06:27:32 +02:00
|
|
|
<td class="tipp-cell <?php echo htmlspecialchars($td_class); ?>" title="Tipp: <?php echo htmlspecialchars($text); ?>">
|
2026-10-04 06:11:02 +02:00
|
|
|
<?php echo htmlspecialchars($text); ?>
|
|
|
|
|
<?php if ($is_joker && Game::isLocked($game['kickoff'])): ?>
|
2026-10-04 07:10:27 +02:00
|
|
|
<img src="/public/icons/joker.png" alt="Joker" class="joker-icon" title="Joker">
|
2026-10-04 06:11:02 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</td>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<p>Für diese Runde wurden keine Spiele gefunden.</p>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
2026-10-03 17:09:57 +02:00
|
|
|
|
|
|
|
|
<p><a href="/">Zurück zur Startseite</a></p>
|
2026-10-03 16:43:00 +02:00
|
|
|
|
2026-10-03 17:09:57 +02:00
|
|
|
<?php require __DIR__ . '/partials/footer.php'; ?>
|