From 94c012cd70ea1db42a0ea476b87a740bae9fbbc0 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Mon, 31 Mar 2025 09:41:50 +0200 Subject: [PATCH] Adjust production view to existing views and fix typo in month view. --- public/css/layout.css | 7 +++++-- public/index.php | 2 +- public/production.php | 42 +++++++++++++++++++++++++++--------------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/public/css/layout.css b/public/css/layout.css index b7dc158..6e9e6fe 100644 --- a/public/css/layout.css +++ b/public/css/layout.css @@ -1,10 +1,11 @@ body { font-family: sans-serif; + font-size: 1.3rem; display: flex; flex-direction: column; } -input[type="number"] { +input { font-size: 1.3rem; } @@ -38,12 +39,14 @@ form > div { flex-direction: row; } -.button { +button, .button { text-align: center; background-color: rgb(239, 239, 239); border: 2px outset rgb(0, 0 , 0); text-decoration: none; color: rgb(0, 0, 0); + font-size: 1.3rem; + padding: 8px 0; } #chart-container { diff --git a/public/index.php b/public/index.php index 2ea79e9..cb8f10b 100644 --- a/public/index.php +++ b/public/index.php @@ -92,7 +92,7 @@ $chosen_date_time = new DateTime($chosen_date); KWh - + KWh KWh KWh diff --git a/public/production.php b/public/production.php index 0161300..7395fb3 100644 --- a/public/production.php +++ b/public/production.php @@ -30,11 +30,13 @@ if (isset($_POST['action']) && $_POST['action'] == 'set_values') { $local_db->query($query); } -$dates = build_date_dropdown($local_db, $table_aggregation); +$dates = get_month($local_db, $table_aggregation); $chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $dates[0]; $production_values = get_production_values_for_month($local_db, $table_aggregation, $chosen_date); $month_production = get_month_production($local_db, $table_production, $chosen_date); +$chosen_date_time = new DateTime($chosen_date); + ?> @@ -43,23 +45,27 @@ $month_production = get_month_production($local_db, $table_production, $chosen_d -
- - - - - Übersicht + + modify('-1 month')->format('Y-m') . "\")'><"; + } else { + echo ''; + } + echo '' . $chosen_date_time->modify('+1 month')->format('Y-m') . ''; + if ($dates['last'] > $chosen_date_time->modify('+1 month')) { + echo ""; + } else { + echo ''; + } + ?> + Monat + Jahr +
+ style="display: grid; grid-template-columns: 15% 12% 10% 10% 12%; gap: 2px 10px; margin-top: 10px; font-size: 1.3rem;"> @@ -83,6 +89,12 @@ $month_production = get_month_production($local_db, $table_production, $chosen_d
+ \ No newline at end of file