www/getbrewlog.php

Wed, 06 May 2020 14:14:14 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 May 2020 14:14:14 +0200
changeset 667
1246550451ca
parent 297
5e2424bfbc4a
permissions
-rw-r--r--

Removed the last compressed css file. Reworked all mash steps, implemented deconction steps. Added calculations for infuse amounts and decoctions amounts. The mash steps are now manually sorted in the editor grids to have full control over the steps order. Display errors in red in the grid. Updated beerxml export, the product checklist and print output of the products and recipes for all these mash steps changes.

<?php

require_once('config.php');

if (isset($_GET["code"]))
	$code = $_GET["code"];
else
	$code = "CB0011";

$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_brews 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)) {
	$lines[] = array(
		'record' => $row['record'],
		'date' => substr($row['datetime'],0,16),
		'version' => $row['version'],
		'code' => $row['code'],
		'name' => $row['name'],
		'pv_mlt' => $row['pv_mlt'],
		'pv_hlt' => $row['pv_hlt'],
		'pv_room' => $row['pv_room'],
		'sp_mlt' => $row['sp_mlt'],
		'sp_hlt' => $row['sp_hlt'],
		'pwm_mlt' => $row['pwm_mlt'],
		'pwm_hlt' => $row['pwm_hlt'],
		'event' => $row['event']
	);
}
header("Content-type: application/json");
echo json_encode($lines);

mercurial