www/cmd_co2meter.php

Wed, 23 Oct 2019 14:20:50 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 23 Oct 2019 14:20:50 +0200
branch
divide
changeset 533
be8691b7d634
parent 506
8ab0e87d579e
permissions
-rw-r--r--

Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.

<?php
require_once('config.php');

#Connect to the database
$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" );

$sql  = "UPDATE `mon_co2meters` SET ";
$sql .=    "beername='" . mysqli_real_escape_string($connect, $_POST['beername']);
$sql .= "', beercode='" . mysqli_real_escape_string($connect, $_POST['beercode']);
$sql .= "', beeruuid='" . mysqli_real_escape_string($connect, $_POST['beeruuid']);
$sql .= "' WHERE uuid='" . $_POST['uuid'] . "';";

$result = mysqli_query($connect, $sql);
if (! $result) {
	syslog(LOG_NOTICE, "cmd_co2meters: result: ".mysqli_error($connect));
} else {
	syslog(LOG_NOTICE, "cmd_co2meters: updated record ".$_POST['uuid']);
}
echo $result;
?>

mercurial