Change some styling. Fix undefined array_key in functions and show overview values in yearly view.
Some checks failed
Build power-consumtion image / Build-and-release-image (push) Failing after 26s
Some checks failed
Build power-consumtion image / Build-and-release-image (push) Failing after 26s
This commit is contained in:
@@ -11,6 +11,10 @@ $chosen_year = (isset($_POST['year'])) ? $_POST['year'] : date('Y');
|
||||
$years = get_years($local_db, $table_aggregation);
|
||||
$values = get_year_values($local_db, $table_aggregation, $chosen_year);
|
||||
|
||||
$aggregation = get_year_aggregation($local_db, $table_aggregation, $chosen_year);
|
||||
$year_production = get_year_production($local_db, $table_production, $chosen_year);
|
||||
$grid_feed_by_month = get_grid_feed_by_month($local_db, $table_aggregation, $table_production, $chosen_year);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
@@ -41,6 +45,37 @@ $values = get_year_values($local_db, $table_aggregation, $chosen_year);
|
||||
<a class="button" href="production.php">Werte</a>
|
||||
<input type="hidden" name="year" id="year" value=""/>
|
||||
</form>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 5% 15% 15%; gap: 2px 10px; margin-top: 5px; border-top: 2px solid gray; padding-top: 5px;">
|
||||
<span class="color"></span>
|
||||
<label><b>Messung</b></label>
|
||||
<span><b>Jahr</b></span>
|
||||
|
||||
<span class="color color-1"></span>
|
||||
<label>Verbrauch</label>
|
||||
<span><?php echo number_format($aggregation['meter_consumption'], 1, ',', '.'); ?> KWh</span>
|
||||
|
||||
<span class="color color-2"></span>
|
||||
<label>Berechnet</label>
|
||||
<span><?php echo number_format($aggregation['power_sensor'], 1, ',', '.'); ?> KWh</span>
|
||||
|
||||
<span class="color color-3"></span>
|
||||
<label>Einspeisung</label>
|
||||
<span><?php echo number_format($aggregation['grid_feed'], 1, ',', '.'); ?> KWh</span>
|
||||
|
||||
<span class="color color-4"></span>
|
||||
<label>Produktion</label>
|
||||
<span><?php echo number_format($year_production['eg'] + $year_production['og'], 1, ',', '.'); ?> KWh</span>
|
||||
|
||||
<span class="color"></span>
|
||||
<label><b>Ersparnis</b></label>
|
||||
<span><b><?php echo number_format(($year_production['eg_price'] + $year_production['og_price'] - array_sum($grid_feed_by_month)), 2, ',', '.'); ?> €</b></span>
|
||||
|
||||
<span class="color"></span>
|
||||
<label><b>Eigenverbrauch</b></label>
|
||||
<span><b><?php echo number_format(100 - $aggregation['grid_feed'] * 100 / ($year_production['eg'] + $year_production['og']), 2, ',', '.'); ?> %</b></span>
|
||||
</div>
|
||||
|
||||
<div id="chart-container">
|
||||
<canvas id="chart"></canvas>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user