www/getyeastsources.php

Sat, 18 Apr 2020 15:56:40 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 18 Apr 2020 15:56:40 +0200
changeset 657
a5ade45597d8
parent 554
c62ff53cfc3d
child 705
d77b723f7b35
permissions
-rw-r--r--

More code cleanup

61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once('config.php');
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
141
fe9e2a677611 The yeast droplist sorting order changed. Misc ingredients time editor uses minutes or days depending on the use of the ingredient. The yeast editor can now use grams, ml or packs.
Michiel Broek <mbroek@mbse.eu>
parents: 61
diff changeset
4 $query = "SELECT * FROM inventory_yeasts ORDER BY laboratory,product_id,name";
61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 $connect = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 if (! $connect) {
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 echo "[]";
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 return;
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 }
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 $result = mysqli_query($connect, $query);
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 $yeasts[] = array(
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 'record' => $row['record'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 'name' => $row['name'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 'type' => $row['type'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 'form' => $row['form'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 'laboratory' => $row['laboratory'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 'product_id' => $row['product_id'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 'min_temperature' => $row['min_temperature'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 'max_temperature' => $row['max_temperature'],
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 141
diff changeset
21 'flocculation' => $row['flocculation'],
61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 'attenuation' => $row['attenuation'],
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 141
diff changeset
23 'cells' => $row['cells'],
61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 'inventory' => $row['inventory'],
337
faedcfa0610f Added command to turn lights on in monitor fermenter when a camera is started. Added the missing tolerance field when selecting a new yeast in a product or recipe.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
25 'cost' => $row['cost'],
554
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
26 'tolerance' => $row['tolerance'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
27 'sta1' => $row['sta1'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
28 'bacteria' => $row['bacteria'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
29 'harvest_top' => $row['harvest_top'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
30 'harvest_time' => $row['harvest_time'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
31 'pitch_temperature' => $row['pitch_temperature'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
32 'pofpos' => $row['pofpos'],
c62ff53cfc3d Added the new Kveik yeast fields to the product editor. Added auto update when a product is loaded. Added extra lines to the checklist about harvest yeast and pitch temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
33 'zymocide' => $row['zymocide']
61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 );
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 }
296
69fadd1aded2 Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
36 header("Content-type: application/json");
61
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 echo json_encode($yeasts);

mercurial