Sat, 11 May 2019 23:13:40 +0200
Added flags for each ingredient group for the supplies state. On the main screen show the state of the supplies if the product stage is not yet packaged. Calculate the state of the supplies for fermentables, hops, yeasts and miscs. In the grids don't show the inventory values after they are used and reduced. On the fermentables tab show the weight of the grains to mash.
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | require_once('config.php'); |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | $query = "SELECT * FROM inventory_waters ORDER BY name"; |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | $connect = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | if (! $connect) { |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | echo "[]"; |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | return; |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | } |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | $result = mysqli_query($connect, $query); |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | $waters[] = array( |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | 'record' => $row['record'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | 'name' => $row['name'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | 'unlimited_stock' => $row['unlimited_stock'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | 'calcium' => $row['calcium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | 'sulfate' => $row['sulfate'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | 'chloride' => $row['chloride'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | 'sodium' => $row['sodium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | 'magnesium' => $row['magnesium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | 'ph' => $row['ph'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | 'total_alkalinity' => $row['total_alkalinity'], |
146
2a6c00d325b2
In dropdown inventory lists you can now choose to display only ingredients that rae on stock or all. Fix the hops amount editor that loses the decimal digits.
Michiel Broek <mbroek@mbse.eu>
parents:
99
diff
changeset
|
23 | 'inventory' => $row['inventory'], |
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | 'cost' => $row['cost'] |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | ); |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | } |
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:
146
diff
changeset
|
27 | header("Content-type: application/json"); |
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | echo json_encode($waters); |