Mon, 25 Feb 2019 22:49:22 +0100
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
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 | } |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | echo json_encode($waters); |