www/getyeastsources.php

Fri, 25 Jan 2019 13:33:10 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 25 Jan 2019 13:33:10 +0100
changeset 201
f9b7e3f6be7c
parent 141
fe9e2a677611
child 232
daf2d9d6fa18
permissions
-rw-r--r--

Fixed yeast database import differences between grams, ml and packs. Added cells field filled with defaults. Some edit screen improvements. Dynamic prompts depending on the yeast type. Disable men and filter of most columns in the yeasts list. Friendlier display of inverntory.

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'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 'attenuation' => $row['attenuation'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 'inventory' => $row['inventory'],
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 'cost' => $row['cost']
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 );
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 }
3469979f83be Added inline yeast editor
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 echo json_encode($yeasts);

mercurial