www/getfermenter.php

Thu, 15 Nov 2018 22:22:51 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 15 Nov 2018 22:22:51 +0100
changeset 96
107c12c3e49d
parent 43
dcb9ff8846fa
child 180
a5aa3502310c
permissions
-rw-r--r--

Renamed estimate_og() to estimate_sg() formula. Updated the formulas in javascript. The calcFermenter() function now only calculates the gravities. The colors still need to be added. When a recept is loaded in the editor, all tabs are selected once to load all subgrid data. Ugly and slow but it at least it works.

<?php

require_once('config.php');

if (isset($_GET["uuid"]))
	    $uuid = $_GET["uuid"];
else
	    $uuid = "'ef166f25-1bb4-4bef-b112-a867af77f766'";


$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$query = "SELECT * FROM mon_fermenters WHERE uuid=".$uuid."";
$result = $mysqli->query($query);
$resultArray = $result->fetch_array(MYSQLI_ASSOC);
if ($resultArray['online'] == 'Y') {
  $resultArray['online'] = true;
} else {
  $resultArray['online'] = false;
}
echo json_encode($resultArray);

mercurial