feat: Füge Rundenansicht mit Spielanzeige hinzu
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
parent
4bf3bbb978
commit
4377106919
2 changed files with 68 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ require_once __DIR__ . '/../src/autoload.php';
|
|||
use App\Core\Database;
|
||||
use App\Models\Game;
|
||||
use App\Models\Tipp;
|
||||
use App\Models\Round;
|
||||
|
||||
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
|
||||
|
|
@ -54,6 +55,20 @@ if ($uri === '/' || $uri === '/index.php') {
|
|||
} elseif ($uri === '/api/status') {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['status' => 'ok', 'version' => '2027.1']);
|
||||
} elseif (preg_match('/^\/round\/(\d+)$/', $uri, $matches)) {
|
||||
$roundId = $matches[1];
|
||||
$round = Round::getById($roundId);
|
||||
|
||||
if (!$round) {
|
||||
http_response_code(404);
|
||||
echo "404 Not Found: Runde nicht gefunden.";
|
||||
exit;
|
||||
}
|
||||
|
||||
$games = Game::getGamesByRound($roundId);
|
||||
|
||||
// Lade das View-Template für die Rundenansicht
|
||||
require __DIR__ . '/../src/Views/round.php';
|
||||
} else {
|
||||
http_response_code(404);
|
||||
echo "404 Not Found";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue