www/getfermenter.php

Sun, 27 Jan 2019 17:39:26 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 27 Jan 2019 17:39:26 +0100
changeset 215
83cee005d2d9
parent 180
a5aa3502310c
child 296
69fadd1aded2
permissions
-rw-r--r--

Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.

<?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'] = 1;
} else {
  $resultArray['online'] = 0;
}
echo json_encode($resultArray);

mercurial