query($check_query); if ($check_result->num_rows === 0) { $query = 'INSERT INTO ' . $table_production . ' (date, eg, og, price) VALUES ("' . $_POST['date'] . '-01", ' . $_POST['eg'] . ', ' . $_POST['og'] . ', ' . $_POST['price'] . ');'; } else { $query = 'UPDATE ' . $table_production . ' SET eg = "' . $_POST['eg'] . '", og = "' . $_POST['og'] . '", price = "' . $_POST['price'] . '" WHERE date = "' . $_POST['date'] . '-01";'; } $local_db->query($query); } $dates = build_date_dropdown($local_db, $table_aggregation); $chosen_date = (isset($_POST['date'])) ? $_POST['date'] : $dates[0]; $data = get_aggregation($local_db, $table_aggregation, $chosen_date); $month_values = get_month_aggregation($local_db, $table_aggregation, $chosen_date); $year_values = get_year_aggregation($local_db, $table_aggregation, $chosen_date); $grid_feed_by_month = get_grid_feed_by_month($local_db, $table_aggregation, $table_production, $chosen_date); $month_production = get_month_production($local_db, $table_production, $chosen_date); $year_production = get_year_production($local_db, $table_production, $chosen_date); $last_value = get_last_value($local_db, $table_aggregation, $chosen_date); ?> Consumption values
Werte setzen
Monat Jahr Min Max Durchschnitt KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh KWh 0) ? number_format(100 - $month_values['grid_feed'] * 100 / ($month_production['eg'] + $month_production['og']), 2, ',', '.') : 0; ?> % % kWh