From 656bd954fa9ef3ab3744e4225652ecb78c45f7f8 Mon Sep 17 00:00:00 2001 From: Eskimue Date: Wed, 22 Apr 2026 11:33:54 +0200 Subject: [PATCH] =?UTF-8?q?Mondjahres=C3=BCbersicht=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/auth_helpers.php | 1 + public/header.php | 1 + public/moonyear.php | 376 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 378 insertions(+) create mode 100644 public/moonyear.php diff --git a/public/auth_helpers.php b/public/auth_helpers.php index 0b40b97..95b109f 100644 --- a/public/auth_helpers.php +++ b/public/auth_helpers.php @@ -131,6 +131,7 @@ function manageablePublicPages(): array 'bedeckung.php' => 'Bedeckungsphänomene', 'sternbedeckungen.php' => 'Mond-Stern-Bedeckungen', 'monatsvorhersage.php' => 'Monatsvorhersage', + 'moonyear.php' => 'Mondphasen-Jahresübersicht', 'wochenvorhersage.php' => 'Wochenvorhersage', 'satellitenhimmel.php' => 'Satellitenhimmel', ]; diff --git a/public/header.php b/public/header.php index 7b25786..7ad7992 100644 --- a/public/header.php +++ b/public/header.php @@ -141,6 +141,7 @@ $menuGroups = [ 'title' => 'Himmel & Planeten', 'links' => [ ['href' => 'moonphase.php', 'label' => 'Mondphase'], + ['href' => 'moonyear.php', 'label' => 'Mondphasen-Jahresübersicht'], ['href' => 'planetensichtbarkeit.php', 'label' => 'Planetensichtbarkeit'], ['href' => 'comets.php', 'label' => 'Kometen'], ['href' => 'astronomical_conversions.php', 'label' => 'Astronomical Conversions'], diff --git a/public/moonyear.php b/public/moonyear.php new file mode 100644 index 0000000..55c8d2e --- /dev/null +++ b/public/moonyear.php @@ -0,0 +1,376 @@ +&1'; + exec($cmd, $output, $exitCode); + $raw = trim(implode("\n", $output)); + $decoded = json_decode($raw, true); + if (is_array($decoded) && ($decoded['ok'] ?? false) && is_array($decoded['phases'] ?? null)) { + foreach ($decoded['phases'] as $phase) { + // local_date format: "DD.MM.YYYY" + $parts = explode('.', (string) ($phase['local_date'] ?? '')); + if (count($parts) === 3) { + $day = (int) $parts[0]; + $month = (int) $parts[1]; + if ($month === $m && $day >= 1 && $day <= 31) { + $allPhaseEvents[] = [ + 'month' => $month, + 'day' => $day, + 'label' => (string) ($phase['label'] ?? ''), + 'time' => (string) ($phase['local_time'] ?? ''), + ]; + } + } + } + } +} +?> + + + +
+

Mondphasen

+ +
+ + + + + Aktuelles Jahr + +
+ +
+ Mondphasen <?= htmlspecialchars((string) $selectedYear, ENT_QUOTES, 'UTF-8') ?> +
+

Zeichne Mondphasen-Jahresübersicht…

+ +
+ Neumond  ·  Erstes Viertel  ·  Vollmond  ·  Letztes Viertel + — Zeitzone: +
+
+ + + + +