This commit is contained in:
torsten 2026-10-18 23:16:07 +02:00
parent 50cd802d33
commit 317f0bce1a
224 changed files with 1105 additions and 27 deletions

View file

@ -1,6 +1,7 @@
<?php
use App\Models\Game;
use App\Models\Tipp;
use App\Models\Team;
// Stellt sicher, dass die benötigten Variablen vorhanden sind
if (!isset($selectedRound) || !isset($roundsToShow) || !isset($users) || !isset($tipps_map)) {
@ -10,6 +11,16 @@ if (!isset($selectedRound) || !isset($roundsToShow) || !isset($users) || !isset(
$pageTitle = 'Tippübersicht - ' . htmlspecialchars($selectedRound['name']);
require __DIR__ . '/partials/header.php';
$teamLogo = function ($name) {
static $cache = [];
if (array_key_exists($name, $cache)) {
return $cache[$name];
}
$team = Team::resolve($name);
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
return $cache[$name];
};
?>
<h1>Tippübersicht bis: <?php echo htmlspecialchars($selectedRound['name']); ?></h1>
@ -27,7 +38,9 @@ require __DIR__ . '/partials/header.php';
<th>Spieler</th>
<?php foreach ($round['games'] as $game): ?>
<th class="game-header">
<?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo"><?php endif; ?>
<?php echo htmlspecialchars($game['team1']); ?><br>
<?php $l2 = $teamLogo($game['team2']); if ($l2): ?><img src="<?php echo htmlspecialchars($l2); ?>" alt="" class="team-logo"><?php endif; ?>
<?php echo htmlspecialchars($game['team2']); ?><br>
<small>(<?php echo Game::getResultString($game['score1'], $game['score2'], $game['kickoff']); ?>)</small>
</th>