From 7c71a00095606bcb451ef5ca55dfe4e32ec6227f Mon Sep 17 00:00:00 2001 From: torsten Date: Sat, 3 Oct 2026 16:49:52 +0200 Subject: [PATCH] feat: Implementiere Saison-Logik zur Anzeige aktueller Runden Co-authored-by: aider (gemini/gemini-2.5-pro) --- public/index.php | 11 +++++++++-- src/Models/Season.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/Models/Season.php diff --git a/public/index.php b/public/index.php index 1c1b7b9..7fef304 100644 --- a/public/index.php +++ b/public/index.php @@ -7,6 +7,7 @@ use App\Core\Database; use App\Models\Game; use App\Models\Tipp; use App\Models\Round; +use App\Models\Season; $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); @@ -20,8 +21,14 @@ if ($uri === '/' || $uri === '/index.php') { echo "

Datenbank verbunden! Aktuell $userCount User im System.

"; echo "

Rundenübersicht

"; - // ToDo: Saison-Logik implementieren. Aktuell werden alle Runden angezeigt. - $rounds = $db->query("SELECT * FROM rounds ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC); + $currentSeason = Season::getCurrent(); + + if ($currentSeason) { + echo "

Saison: " . htmlspecialchars($currentSeason['name']) . "

"; + $rounds = Round::getBySeason($currentSeason['id']); + } else { + $rounds = []; + } if ($rounds) { echo "