www/cmd_ispindel.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 628
a42166cbb19a
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.

570
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once('config.php');
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 #Connect to the database
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME);
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 if (! $connect) {
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 }
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 mysqli_set_charset($connect, "utf8" );
578
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
10 $sql = "";
570
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11
578
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
12 if (isset($_POST['beername']) && isset($_POST['beercode']) && isset($_POST['beeruuid'])) {
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
13 $sql = "UPDATE `mon_ispindels` SET ";
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
14 $sql .= "beername='" . mysqli_real_escape_string($connect, $_POST['beername']);
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
15 $sql .= "', beercode='" . mysqli_real_escape_string($connect, $_POST['beercode']);
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
16 $sql .= "', beeruuid='" . mysqli_real_escape_string($connect, $_POST['beeruuid']);
628
a42166cbb19a Record iSpindel original plato by updating to the highest measured value. Reset this value when a new beer is set. Added current status to the monitor screen.
Michiel Broek <mbroek@mbse.eu>
parents: 593
diff changeset
17 $sql .= "', og_gravity=0 WHERE uuid='" . $_POST['uuid'] . "';";
578
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
18 } else if (isset($_POST['mode'])) {
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
19 $sql = "UPDATE `mon_ispindels` SET mode='" .$_POST['mode'] . "' WHERE uuid='" . $_POST['uuid'] . "';";
593
e0230bf4ac3f Less logging noise.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
20 } else {
e0230bf4ac3f Less logging noise.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
21 syslog(LOG_NOTICE, "cmd_ispindel: unknown POST");
578
e75ce5bbda73 Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents: 570
diff changeset
22 }
570
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $result = mysqli_query($connect, $sql);
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 if (! $result) {
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 syslog(LOG_NOTICE, "cmd_ispindel: result: ".mysqli_error($connect));
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 }
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 echo $result;
c8a20234d7e7 Added iSpindel monitor screen design.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 ?>

mercurial