feat: Implementiere Saison-Logik zur Anzeige aktueller Runden
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
parent
6a2e8cbb57
commit
7c71a00095
2 changed files with 40 additions and 2 deletions
|
|
@ -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 "<p>Datenbank verbunden! Aktuell <strong>$userCount</strong> User im System.</p>";
|
||||
|
||||
echo "<h2>Rundenübersicht</h2>";
|
||||
// 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 "<p>Saison: <strong>" . htmlspecialchars($currentSeason['name']) . "</strong></p>";
|
||||
$rounds = Round::getBySeason($currentSeason['id']);
|
||||
} else {
|
||||
$rounds = [];
|
||||
}
|
||||
if ($rounds) {
|
||||
echo "<ul>";
|
||||
foreach ($rounds as $round) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue