www/getnode.php

Tue, 22 Jan 2019 20:27:45 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 22 Jan 2019 20:27:45 +0100
changeset 195
2ac491548d8d
parent 180
a5aa3502310c
child 296
69fadd1aded2
permissions
-rw-r--r--

Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.

<?php

require_once('config.php');

if (isset($_GET["uuid"]))
    $uuid = $_GET["uuid"];
else
    $uuid = "'c0c17800-fabb-4f22-a02a-4f83a7b1b21b'";


$query = "SELECT * FROM mon_nodes WHERE uuid=".$uuid."";
$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$result = $mysqli->query($query);
//Copy result into a associative array
$resultArray = $result->fetch_array(MYSQLI_ASSOC);
if ($resultArray['online'] == 'Y') {
    $resultArray['online'] = 1;
} else {
    $resultArray['online'] = 0;
}
echo json_encode($resultArray);

mercurial