Extend with yearly view.

This commit is contained in:
2025-03-29 13:35:46 +01:00
parent 01e654cd14
commit 0319687d97
3 changed files with 137 additions and 30 deletions

View File

@@ -37,7 +37,7 @@ $last_value = get_last_value($local_db, $table_aggregation, $chosen_date);
<link rel="stylesheet" href="/css/layout.css"/>
</head>
<body>
<form style="display: grid; grid-template-columns: 5% 5% 20% 5%; gap: 10px;" action="/index.php" method="post">
<form style="display: grid; grid-template-columns: 5% 5% 20% 5% 5%; gap: 10px;" action="/index.php" method="post">
<label for="date">Datum</label>
<select name="date" id="date" onchange="submit();">
<?php
@@ -49,11 +49,12 @@ $last_value = get_last_value($local_db, $table_aggregation, $chosen_date);
</select>
<span></span>
<a class="button" href="production.php">Werte setzen</a>
<a class="button" href="year.php">Jahresübersicht</a>
</form>
<div style="display: grid; grid-template-columns: 5% 15% 15% 15% 15% 15% 15%; gap: 2px 10px; margin-top: 5px; border-top: 2px solid gray; padding-top: 5px;">
<span class="color"></span>
<label><b>Messungen</b></label>
<label><b>Messung</b></label>
<span><b>Monat</b></span>
<span><b>Jahr</b></span>
<span><b>Min</b></span>
@@ -62,43 +63,35 @@ $last_value = get_last_value($local_db, $table_aggregation, $chosen_date);
<span class="color color-1"></span>
<label>Verbrauch</label>
<span><?php echo number_format($month_values['meter_consumption'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['meter_consumption'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_meter'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_meter'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_meter'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($month_values['meter_consumption'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['meter_consumption'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_meter'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_meter'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_meter'] / 1000, 1, ',', '.'); ?> KWh</span>
<span class="color color-2"></span>
<label>Berechnet</label>
<span><?php echo number_format($month_values['power_sensor'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['power_sensor'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_power'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_power'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_power'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($month_values['power_sensor'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['power_sensor'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_power'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_power'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_power'] / 1000, 1, ',', '.'); ?> KWh</span>
<span class="color color-3"></span>
<label>Einspeisung</label>
<span><?php echo number_format($month_values['grid_feed'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['grid_feed'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_feed'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_feed'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_feed'] / 1000, 3, ',', '.'); ?> KWh</span>
<span class="color color-4"></span>
<label>Produktion EG</label>
<span><?php echo number_format($month_production['eg'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_production['eg'], 3, ',', '.'); ?> KWh</span>
<span></span>
<span></span>
<span></span>
<span><?php echo number_format($month_values['grid_feed'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_values['grid_feed'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_feed'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_feed'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_feed'] / 1000, 1, ',', '.'); ?> KWh</span>
<span class="color color-4"></span>
<label>Produktion OG</label>
<span><?php echo number_format($month_production['og'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_production['og'], 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_production'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_production'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_production'] / 1000, 3, ',', '.'); ?> KWh</span>
<span><?php echo number_format($month_production['eg'] + $month_production['og'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($year_production['eg'] + $year_production['og'], 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['min_production'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['max_production'] / 1000, 1, ',', '.'); ?> KWh</span>
<span><?php echo number_format($data['avg_production'] / 1000, 1, ',', '.'); ?> KWh</span>
<span class="color"></span>
<label><b>Ersparnis</b></label>