diff --git a/Heizung/WEBROOT/index.php b/Heizung/WEBROOT/index.php index 702254a..e79dc6c 100644 --- a/Heizung/WEBROOT/index.php +++ b/Heizung/WEBROOT/index.php @@ -9,6 +9,7 @@ try { $router->add('abgas', \MVC\Controller\AbgasController::class, 'abgas'); $router->add('vorlauf', \MVC\Controller\VorlaufController::class, 'vorlauf'); $router->add('puffer', \MVC\Controller\PufferController::class, 'puffer'); + $router->add('aussentemp', \MVC\Controller\AussentempController::class, 'aussentemp'); $layout = new \MVC\Layout\Layout('main'); $layout->setBlock('title', 'MVC Starter'); @@ -17,12 +18,18 @@ try { // Sidebar Block ob_start(); + $navItems = [ + 'home' => '🏠 Home', + 'abgas' => '🔥 Abgas', + 'vorlauf' => '🏃‍♂️‍➡️ Vorlauf', + 'puffer' => '♨️ Puffer', + 'aussentemp' => '🌡️ Außentemperatur' + ]; ?> setBlock('sidebar', ob_get_clean()); diff --git a/Heizung/WEBROOT/src/MVC/Controller/AussentempController.php b/Heizung/WEBROOT/src/MVC/Controller/AussentempController.php new file mode 100644 index 0000000..46750d4 --- /dev/null +++ b/Heizung/WEBROOT/src/MVC/Controller/AussentempController.php @@ -0,0 +1,46 @@ +render('aussentemp', [ + 'title' => 'Aussentemperatur Modul', + 'xtitle' => 'Zeit', + 'ytitle' => 'Temperatur', + + 'array' => $array, + + 'labels' => $labels, + 'aussentemp' => $aussentemp, + + 'day' => $day, + 'prevDay' => $prevDay, + 'nextDay' => $nextDay, + ]); + } +} \ No newline at end of file diff --git a/Heizung/WEBROOT/src/MVC/Layout/Templates/main.php b/Heizung/WEBROOT/src/MVC/Layout/Templates/main.php index 2268918..90b6640 100644 --- a/Heizung/WEBROOT/src/MVC/Layout/Templates/main.php +++ b/Heizung/WEBROOT/src/MVC/Layout/Templates/main.php @@ -4,7 +4,11 @@ <?= $this->getBlock('title') ?> diff --git a/Heizung/WEBROOT/src/MVC/Model/Messungen.php b/Heizung/WEBROOT/src/MVC/Model/Messungen.php index 808e620..7ebe067 100644 --- a/Heizung/WEBROOT/src/MVC/Model/Messungen.php +++ b/Heizung/WEBROOT/src/MVC/Model/Messungen.php @@ -34,4 +34,9 @@ class Messungen extends Model { $sql = "SELECT ts, kessel_oben, kessel_unten FROM " . self::$table . " WHERE ts LIKE '$day%' ORDER BY ts ASC"; return self::query($sql)->fetch_all(MYSQLI_ASSOC); } + + public static function getAussentempByDay($day) { + $sql = "SELECT ts, aussentemp FROM " . self::$table . " WHERE ts LIKE '$day%' ORDER BY ts ASC"; + return self::query($sql)->fetch_all(MYSQLI_ASSOC); + } } \ No newline at end of file diff --git a/Heizung/WEBROOT/src/MVC/View/aussentemp.php b/Heizung/WEBROOT/src/MVC/View/aussentemp.php new file mode 100644 index 0000000..181206a --- /dev/null +++ b/Heizung/WEBROOT/src/MVC/View/aussentemp.php @@ -0,0 +1,126 @@ + + + + + +
+ +
+ + +
+ + + ← Vorheriger Tag + + + + + + + + Nächster Tag → + + +
\ No newline at end of file