Sun, 30 Oct 2022 16:46:03 +0100
Removed use of obsolete product equipment fields and added the equipment chiller fields. Changed tab 2 of the product view to show the chiller method.
<?php require_once('config.php'); if (isset($_GET["code"])) $code = $_GET["code"]; else $code = "TB0015"; $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME); if (! $connect) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } mysqli_set_charset($connect, "utf8" ); $query = "SELECT * FROM log_fermenter WHERE code='".$code."' ORDER BY datetime;"; $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $logs[] = array( 'date' => substr($row['datetime'],0,16), 'air' => $row['temp_air'], 'beer' => $row['temp_beer'], 'chiller' => $row['temp_chiller'], 'room' => $row['temp_room'], 'tlo' => $row['sp_low'], 'thi' => $row['sp_high'], 'heater' => $row['heater_power'], 'cooler' => $row['cooler_power'], 'event' => $row['event'] ); } header("Content-type: application/json"); echo json_encode($logs);