From 7e389c330bf8a8d34e202c866583e46ba049b2bb Mon Sep 17 00:00:00 2001 From: Thies Mueller <> Date: Tue, 17 Jun 2025 12:54:36 +0200 Subject: [PATCH] first commit --- index.php | 143 +++++++++++++++++++++++++++++++++++ res/css/bootstrap.min.css | 6 ++ res/img/qrcode.png | Bin 0 -> 273309 bytes res/img/regattatech_logo.png | Bin 0 -> 91928 bytes res/img/sat_logo.png | Bin 0 -> 274829 bytes 5 files changed, 149 insertions(+) create mode 100644 index.php create mode 100644 res/css/bootstrap.min.css create mode 100644 res/img/qrcode.png create mode 100644 res/img/regattatech_logo.png create mode 100644 res/img/sat_logo.png diff --git a/index.php b/index.php new file mode 100644 index 0000000..706fc1a --- /dev/null +++ b/index.php @@ -0,0 +1,143 @@ + [ + "ignore_errors" => true + ] + ]); + $json = @file_get_contents($url, false, $context); + return $json ? json_decode($json, true) : []; +} + +$messages = fetch_api("http://127.0.0.1:8000/api/v1/messages"); +$resultsData = fetch_api("http://127.0.0.1:8000/api/v1/results/current/"); +$rennplanData = fetch_api("http://127.0.0.1:8000/api/v1/rennplan/current/"); + +$results = $resultsData['ergebnisse'] ?? []; +$rennplan = $rennplanData['rennplan'] ?? []; +$lastResultUUIDs = array_column($results, 'uuid'); + +$nextRaces = []; +foreach ($rennplan as $lauf) { + foreach ($lauf as $rennen) { + if (!in_array($rennen['uuid'], $lastResultUUIDs)) { + $nextRaces[] = $rennen; + } + } +} +$nextRaces = array_slice($nextRaces, 0, 3); + +function render_message_box($message) { + $typeMap = [ + 'info' => 'success', + 'warning' => 'warning', + 'danger' => 'danger' + ]; + $type = $typeMap[$message['type']] ?? 'secondary'; + return "
*TJ<
zfzO?}=T#I}DI#LJL;J3&Z2&fe8LxbJfHnbh4-tVl*g4plyvm+znFzg4o?;w;boCn8
zuMb8&0OBcyeLgGqpx=K2wBbp0-P&+_@IfkxH%StpqZ0!@FNP#OzqdEg?%^*{F16PG
zs^urjZC)O*khL_O$UcWp@?d^j%M(n&ML=`{#sKRT(>_5m>H(iXQ?m@AEO&uZ>gE-zk4rIU6Z|)!V0Apyrv2
zPdyv-VR|APaRGBym*=cDos46O5HN5YVNM2c>Zu@9lcXBok(E@J4TsMvTVong?!1Nh
zV93EmdHvEXWv