Sun, 23 May 2021 16:41:35 +0200
Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.
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 | } |
705
d77b723f7b35
Make sure enumerated values are not empty in database updates. On several data queries set the database connection to UTF-8.
Michiel Broek <mbroek@mbse.eu>
parents:
296
diff
changeset
|
10 | mysqli_set_charset($connect, "utf8"); |
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | $result = mysqli_query($connect, $query); |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | $waters[] = array( |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | 'record' => $row['record'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | 'name' => $row['name'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | 'unlimited_stock' => $row['unlimited_stock'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | 'calcium' => $row['calcium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | 'sulfate' => $row['sulfate'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | 'chloride' => $row['chloride'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | 'sodium' => $row['sodium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | 'magnesium' => $row['magnesium'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | 'ph' => $row['ph'], |
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | '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
|
24 | 'inventory' => $row['inventory'], |
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | 'cost' => $row['cost'] |
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 | } |
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
|
28 | header("Content-type: application/json"); |
54
294dda7f1779
Beginning of water totals and selecting
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | echo json_encode($waters); |