Sat, 06 Aug 2022 20:23:33 +0200
Code cleanup
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | require($_SERVER['DOCUMENT_ROOT']."/config.php"); |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | require($_SERVER['DOCUMENT_ROOT']."/version.php"); |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | #Connect to the database |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
7 | $link = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
8 | if (! $link) { |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | } |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
11 | mysqli_set_charset($link, "utf8" ); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
13 | $escapers = array("\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c"); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
14 | $replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b"); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
15 | $rescapers = array("'"); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
16 | $rreplacements = array("\\'"); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
17 | $disallowed = array('visibleindex','uniqueid','boundindex','uid','h_weight','m_weight'); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
19 | $response = array( |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
20 | 'error' => false, |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
21 | 'msg' => 'Ok', |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
22 | ); |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
23 | |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
24 | /* |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
25 | * Server side split batch. Parameters: |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
26 | * record = original record. |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
27 | * divide_type = divide moment. |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
28 | * divide parts = number of divisions |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
29 | * divide_data = array with { size, factor, part, name, code } where index 0 is original |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
30 | * |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
31 | * generate the new records and modify the original record. |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
32 | * rollback if something goes wrong. |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
33 | * return ok or error |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
34 | */ |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
35 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
36 | if (isset($_POST['record']) && isset($_POST['divide_type']) && isset($_POST['divide_parts']) && isset($_POST['divide_data'])) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
37 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
38 | $record = $_POST['record']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
39 | $divide_parts = $_POST['divide_parts']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
40 | $divide_type = $_POST['divide_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
41 | $divide_data = array_reverse($_POST['divide_data'], true); // reverse the array so the master record is last. |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
42 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
43 | syslog(LOG_NOTICE, "db_divide: record " . $record . " divide_type " . $divide_type . " parts " . $divide_parts); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
44 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
45 | foreach ($divide_data as $index => &$split) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
46 | syslog(LOG_NOTICE, "db_divide: index " . $index); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
47 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
48 | foreach ($split as $key => &$value) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
49 | syslog(LOG_NOTICE, "db_divide: index " . $index . " key " . $key . " value " . $value); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | } |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
52 | $result = mysqli_query($link, "SELECT * FROM products WHERE record='" . $record . "'"); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
53 | if (! $result) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
54 | syslog(LOG_NOTICE, "db_divide: result: ".mysqli_error($link)); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | } |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
56 | $row = mysqli_fetch_array($result); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
57 | $factor = floatval($split['factor']); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
59 | if ($index == 0) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
60 | /* |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
61 | * Update the main record |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
62 | */ |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
63 | $sql = "UPDATE `products` SET "; |
722
c4457e10d968
Fix db error when splitting a batch. Removed the minimum 10% divide volume in the room calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
650
diff
changeset
|
64 | $sql .= " brew_sparge_est='" . sprintf("%.1f", $row['brew_sparge_est'] * $factor); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
65 | $sql .= "', brew_preboil_volume='" . sprintf("%.1f", $row['brew_preboil_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
66 | $sql .= "', brew_aboil_volume='" . sprintf("%.1f", $row['brew_aboil_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
67 | $sql .= "', brew_fermenter_volume='" . sprintf("%.1f", $row['brew_fermenter_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
68 | $sql .= "', brew_fermenter_extrawater='" . sprintf("%.1f", $row['brew_fermenter_extrawater'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
69 | $sql .= "', brew_fermenter_tcloss='" . sprintf("%.1f", $row['brew_fermenter_tcloss'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
70 | $sql .= "', package_volume='" . sprintf("%.1f", $row['package_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
71 | $sql .= "', package_infuse_amount='" . sprintf("%.1f", $row['package_infuse_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
72 | $sql .= "', bottle_amount='" . sprintf("%.1f", $row['bottle_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
73 | $sql .= "', bottle_priming_water='" . sprintf("%.3f", $row['bottle_priming_water'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
74 | $sql .= "', keg_amount='" . sprintf("%.1f", $row['keg_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
75 | $sql .= "', keg_priming_water='" . sprintf("%.3f", $row['keg_priming_water'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
76 | $sql .= "', batch_size='" . sprintf("%.2f", $row['batch_size'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
77 | $sql .= "', boil_size='" . sprintf("%.2f", $row['boil_size'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
78 | $sql .= "', sparge_volume='" . sprintf("%.1f", $row['sparge_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
79 | $sql .= "', sparge_acid_amount='" . sprintf("%.5f", $row['sparge_acid_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
80 | $sql .= "', w1_amount='" . sprintf("%.2f", $row['w1_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
81 | $sql .= "', w2_amount='" . sprintf("%.2f", $row['w2_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
82 | $sql .= "', wg_amount='" . sprintf("%.2f", $row['wg_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
83 | $sql .= "', prop1_volume='" . sprintf("%.3f", $row['prop1_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
84 | $sql .= "', prop2_volume='" . sprintf("%.3f", $row['prop2_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
85 | $sql .= "', prop3_volume='" . sprintf("%.3f", $row['prop3_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
86 | $sql .= "', prop4_volume='" . sprintf("%.3f", $row['prop4_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
87 | $sql .= "', divide_type='" . $divide_type; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
88 | $sql .= "', divide_parts='" . $divide_parts; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
89 | $sql .= "', divide_part='" . $index; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
90 | $sql .= "', divide_size='" . floatval($split['size']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
91 | $sql .= "', divide_factor='". $factor; |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
92 | // syslog(LOG_NOTICE, "db_divide: index " . $index . " " . $sql); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | |
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | } else { |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
95 | /* |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
96 | * Insert splitted batches |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
97 | */ |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
98 | $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid')); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
99 | $sql = "INSERT INTO `products` SET "; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
100 | $sql .= "name='" . mysqli_real_escape_string($link, $split['name']); |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
101 | $sql .= "', uuid='" . $uuid; |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
102 | $sql .= "', code='" . mysqli_real_escape_string($link, $split['code']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
103 | $sql .= "', birth='" . $row['birth']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
104 | $sql .= "', stage='" . $row['stage']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
105 | $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
106 | $sql .= "', log_brew='" . $row['log_brew']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
107 | $sql .= "', log_fermentation='" . $row['log_fermentation']; |
602
10b61aacb1c1
New products field log_ispindel. Add check for ispindel log to crontasks.php Added log_ispindel to prod_edit, pprod_divide, prod_new and prod_duplicate. Renamed some log_fermentation vergisting names into klimaatkast.
Michiel Broek <mbroek@mbse.eu>
parents:
533
diff
changeset
|
108 | $sql .= "', log_ispindel='" . $row['log_ispindel']; |
615
9034e65b0d7a
Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents:
602
diff
changeset
|
109 | $sql .= "', log_co2pressure='" . $row['log_co2pressure']; |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
110 | $sql .= "', inventory_reduced='" . $row['inventory_reduced'];; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
111 | $sql .= "', locked='" . $row['locked'];; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
112 | // Equipment |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
113 | $sql .= "', eq_name='" . mysqli_real_escape_string($link, $row['eq_name']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
114 | $sql .= "', eq_boil_size='" . $row['eq_boil_size']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
115 | $sql .= "', eq_batch_size='" . $row['eq_batch_size']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
116 | $sql .= "', eq_tun_volume='" . $row['eq_tun_volume']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
117 | $sql .= "', eq_tun_weight='" . $row['eq_tun_weight']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
118 | $sql .= "', eq_tun_specific_heat='" . $row['eq_tun_specific_heat']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
119 | $sql .= "', eq_tun_material='" . $row['eq_tun_material']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
120 | $sql .= "', eq_tun_height='" . $row['eq_tun_height']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
121 | $sql .= "', eq_top_up_water='" . $row['eq_top_up_water']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
122 | $sql .= "', eq_trub_chiller_loss='" . $row['eq_trub_chiller_loss']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
123 | $sql .= "', eq_evap_rate='" . $row['eq_evap_rate']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
124 | $sql .= "', eq_boil_time='" . $row['eq_boil_time']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
125 | $sql .= "', eq_calc_boil_volume='" . $row['eq_calc_boil_volume']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
126 | $sql .= "', eq_top_up_kettle='" . $row['eq_top_up_kettle']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
127 | $sql .= "', eq_hop_utilization='" . $row['eq_hop_utilization']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
128 | $sql .= "', eq_notes='" . mysqli_real_escape_string($link, $row['eq_notes']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
129 | $sql .= "', eq_lauter_volume='" . $row['eq_lauter_volume']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
130 | $sql .= "', eq_lauter_height='" . $row['eq_lauter_height']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
131 | $sql .= "', eq_lauter_deadspace='" . $row['eq_lauter_deadspace']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
132 | $sql .= "', eq_kettle_volume='" . $row['eq_kettle_volume']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
133 | $sql .= "', eq_kettle_height='" . $row['eq_kettle_height']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
134 | $sql .= "', eq_mash_volume='" . $row['eq_mash_volume']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
135 | $sql .= "', eq_mash_max='" . $row['eq_mash_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
136 | $sql .= "', eq_efficiency='" . $row['eq_efficiency']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
137 | // brewdate |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
138 | if (strlen($row['brew_date_start'])) |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
139 | $sql .= "', brew_date_start='" . $row['brew_date_start'] . "'"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
140 | else |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
141 | $sql .= "', brew_date_start=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
142 | $sql .= ", brew_mash_ph='" . $row['brew_mash_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
143 | $sql .= "', brew_mash_sg='" . $row['brew_mash_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
144 | $sql .= "', brew_mash_efficiency='" . $row['brew_mash_efficiency']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
145 | $sql .= "', brew_sparge_est='" . sprintf("%.1f", $row['brew_sparge_est'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
146 | $sql .= "', brew_sparge_ph='" . $row['brew_sparge_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
147 | $sql .= "', brew_preboil_volume='" . sprintf("%.1f", $row['brew_preboil_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
148 | $sql .= "', brew_preboil_sg='" . $row['brew_preboil_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
149 | $sql .= "', brew_preboil_ph='" . $row['brew_preboil_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
150 | $sql .= "', brew_preboil_efficiency='" . $row['brew_preboil_efficiency']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
151 | $sql .= "', brew_aboil_volume='" . sprintf("%.1f", $row['brew_aboil_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
152 | $sql .= "', brew_aboil_sg='" . $row['brew_aboil_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
153 | $sql .= "', brew_aboil_ph='" . $row['brew_aboil_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
154 | $sql .= "', brew_aboil_efficiency='" . $row['brew_aboil_efficiency']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
155 | $sql .= "', brew_cooling_method='" . $row['brew_cooling_method']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
156 | $sql .= "', brew_cooling_time='" . $row['brew_cooling_time']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
157 | $sql .= "', brew_cooling_to='" . $row['brew_cooling_to']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
158 | $sql .= "', brew_whirlpool9='" . $row['brew_whirlpool9']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
159 | $sql .= "', brew_whirlpool7='" . $row['brew_whirlpool7']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
160 | $sql .= "', brew_whirlpool6='" . $row['brew_whirlpool6']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
161 | $sql .= "', brew_whirlpool2='" . $row['brew_whirlpool2']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
162 | $sql .= "', brew_aeration_time='" . $row['brew_aeration_time']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
163 | $sql .= "', brew_aeration_speed='" . $row['brew_aeration_speed']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
164 | $sql .= "', brew_aeration_type='" . $row['brew_aeration_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
165 | $sql .= "', brew_fermenter_volume='" . sprintf("%.1f", $row['brew_fermenter_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
166 | $sql .= "', brew_fermenter_extrawater='" . sprintf("%.1f", $row['brew_fermenter_extrawater'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
167 | $sql .= "', brew_fermenter_tcloss='" . sprintf("%.1f", $row['brew_fermenter_tcloss'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
168 | $sql .= "', brew_fermenter_sg='" . $row['brew_fermenter_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
169 | $sql .= "', brew_fermenter_ibu='" . $row['brew_fermenter_ibu']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
170 | $sql .= "', brew_fermenter_color='" . $row['brew_fermenter_color']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
171 | if (strlen($row['brew_date_end'])) |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
172 | $sql .= "', brew_date_end='" . $row['brew_date_end'] . "'"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
173 | else |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
174 | $sql .= "', brew_date_end=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
175 | $sql .= ", og='" . $row['og']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
176 | $sql .= "', fg='" . $row['fg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
177 | $sql .= "', primary_start_temp='" . $row['primary_start_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
178 | $sql .= "', primary_max_temp='" . $row['primary_max_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
179 | $sql .= "', primary_end_temp='" . $row['primary_end_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
180 | if (strlen($row['primary_end_date'])) |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
181 | $sql .= "', primary_end_date='" . $row['primary_end_date'] . "'"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
182 | else |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
183 | $sql .= "', primary_end_date=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
184 | $sql .= ", primary_end_sg='" . $row['primary_end_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
185 | $sql .= "', secondary_temp='" . $row['secondary_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
186 | $sql .= "', secondary_end_sg='" . $row['secondary_end_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
187 | if (strlen($row['secondary_end_date'])) |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
188 | $sql .= "', secondary_end_date='" . $row['secondary_end_date'] . "'"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
189 | else |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
190 | $sql .= "', secondary_end_date=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
191 | $sql .= ", tertiary_temp='" . $row['tertiary_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
192 | if (strlen($row['package_date'])) |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
193 | $sql .= "', package_date='" . $row['package_date'] . "'"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
194 | else |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
195 | $sql .= "', package_date=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
196 | $sql .= ", package_volume='" . sprintf("%.1f", $row['package_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
197 | $sql .= "', package_infuse_amount='" . sprintf("%.1f", $row['package_infuse_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
198 | $sql .= "', package_infuse_abv='" . $row['package_infuse_abv']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
199 | $sql .= "', package_infuse_notes='" . mysqli_real_escape_string($link, $row['package_infuse_notes']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
200 | $sql .= "', package_abv='" . $row['package_abv']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
201 | $sql .= "', package_ph='" . $row['package_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
202 | $sql .= "', bottle_amount='" . sprintf("%.1f", $row['bottle_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
203 | $sql .= "', bottle_carbonation='" . $row['bottle_carbonation']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
204 | $sql .= "', bottle_priming_sugar='" . $row['bottle_priming_sugar']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
205 | $sql .= "', bottle_priming_water='" . sprintf("%.3f", $row['bottle_priming_water'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
206 | $sql .= "', bottle_priming_amount='" . $row['bottle_priming_amount']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
207 | $sql .= "', bottle_carbonation_temp='" . $row['bottle_carbonation_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
208 | $sql .= "', keg_amount='" . sprintf("%.1f", $row['keg_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
209 | $sql .= "', keg_carbonation='" . $row['keg_carbonation']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
210 | $sql .= "', keg_priming_sugar='" . $row['keg_priming_sugar']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
211 | $sql .= "', keg_priming_water='" . sprintf("%.3f", $row['keg_priming_water'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
212 | $sql .= "', keg_priming_amount='" . $row['keg_priming_amount']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
213 | $sql .= "', keg_carbonation_temp='" . $row['keg_carbonation_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
214 | $sql .= "', keg_forced_carb='" . $row['keg_forced_carb']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
215 | $sql .= "', keg_pressure='" . $row['keg_pressure']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
216 | $sql .= "', taste_notes='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
217 | $sql .= "', taste_rate='0"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
218 | $sql .= "', taste_date=NULL"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
219 | $sql .= ", taste_color='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
220 | $sql .= "', taste_transparency='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
221 | $sql .= "', taste_head='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
222 | $sql .= "', taste_aroma='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
223 | $sql .= "', taste_taste='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
224 | $sql .= "', taste_mouthfeel='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
225 | $sql .= "', taste_aftertaste='"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
226 | // Style |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
227 | $sql .= "', st_name='" . mysqli_real_escape_string($link, $row['st_name']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
228 | $sql .= "', st_letter='" . mysqli_real_escape_string($link, $row['st_letter']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
229 | $sql .= "', st_guide='" . mysqli_real_escape_string($link, $row['st_guide']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
230 | $sql .= "', st_type='" . $row['st_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
231 | $sql .= "', st_category='" . mysqli_real_escape_string($link, $row['st_category']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
232 | $sql .= "', st_category_number='" . $row['st_category_number']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
233 | $sql .= "', st_og_min='" . $row['st_og_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
234 | $sql .= "', st_og_max='" . $row['st_og_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
235 | $sql .= "', st_fg_min='" . $row['st_fg_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
236 | $sql .= "', st_fg_max='" . $row['st_fg_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
237 | $sql .= "', st_ibu_min='" . $row['st_ibu_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
238 | $sql .= "', st_ibu_max='" . $row['st_ibu_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
239 | $sql .= "', st_color_min='" . $row['st_color_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
240 | $sql .= "', st_color_max='" . $row['st_color_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
241 | $sql .= "', st_carb_min='" . $row['st_carb_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
242 | $sql .= "', st_carb_max='" . $row['st_carb_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
243 | $sql .= "', st_abv_min='" . $row['st_abv_min']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
244 | $sql .= "', st_abv_max='" . $row['st_abv_max']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
245 | $sql .= "', type='" . $row['type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
246 | $sql .= "', batch_size='" . sprintf("%.2f", $row['batch_size'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
247 | $sql .= "', boil_size='" . sprintf("%.2f", $row['boil_size'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
248 | $sql .= "', boil_time='" . $row['boil_time']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
249 | $sql .= "', efficiency='" . $row['efficiency']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
250 | $sql .= "', est_og='" . $row['est_og']; |
616
2cbf21bb9bdc
Added est_og3 field in the products database so that the checklist can use it.
Michiel Broek <mbroek@mbse.eu>
parents:
615
diff
changeset
|
251 | $sql .= "', est_og3='" . $row['est_og3']; |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
252 | $sql .= "', est_fg='" . $row['est_fg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
253 | $sql .= "', est_abv='" . $row['est_abv']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
254 | $sql .= "', est_carb='" . $row['est_carb']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
255 | $sql .= "', est_color='" . $row['est_color']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
256 | $sql .= "', color_method='" . $row['color_method']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
257 | $sql .= "', est_ibu='" . $row['est_ibu']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
258 | $sql .= "', ibu_method='" . $row['ibu_method']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
259 | $sql .= "', sparge_volume='" . sprintf("%.1f", $row['sparge_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
260 | $sql .= "', sparge_acid_amount='" . sprintf("%.5f", $row['sparge_acid_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
261 | $sql .= "', sparge_temp='" . $row['sparge_temp']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
262 | $sql .= "', sparge_ph='" . $row['sparge_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
263 | $sql .= "', sparge_source='" . $row['sparge_source']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
264 | $sql .= "', sparge_acid_type='" . $row['sparge_acid_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
265 | $sql .= "', sparge_acid_perc='" . $row['sparge_acid_perc']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
266 | $sql .= "', mash_ph='" . $row['mash_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
267 | $sql .= "', mash_name='" . $row['mash_name']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
268 | $sql .= "', calc_acid='" . $row['calc_acid']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
269 | $sql .= "', w1_name='" . mysqli_real_escape_string($link, $row['w1_name']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
270 | $sql .= "', w1_amount='" . sprintf("%.2f", $row['w1_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
271 | $sql .= "', w1_calcium='" . $row['w1_calcium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
272 | $sql .= "', w1_sulfate='" . $row['w1_sulfate']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
273 | $sql .= "', w1_chloride='" . $row['w1_chloride']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
274 | $sql .= "', w1_sodium='" . $row['w1_sodium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
275 | $sql .= "', w1_magnesium='" . $row['w1_magnesium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
276 | $sql .= "', w1_total_alkalinity='" . $row['w1_total_alkalinity']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
277 | $sql .= "', w1_ph='" . $row['w1_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
278 | $sql .= "', w1_cost='" . $row['w1_cost']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
279 | $sql .= "', w2_name='" . mysqli_real_escape_string($link, $row['w2_name']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
280 | $sql .= "', w2_amount='" . sprintf("%.2f", $row['w2_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
281 | $sql .= "', w2_calcium='" . $row['w2_calcium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
282 | $sql .= "', w2_sulfate='" . $row['w2_sulfate']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
283 | $sql .= "', w2_chloride='" . $row['w2_chloride']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
284 | $sql .= "', w2_sodium='" . $row['w2_sodium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
285 | $sql .= "', w2_magnesium='" . $row['w2_magnesium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
286 | $sql .= "', w2_total_alkalinity='" . $row['w2_total_alkalinity']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
287 | $sql .= "', w2_ph='" . $row['w2_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
288 | $sql .= "', w2_cost='" . $row['w2_cost']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
289 | $sql .= "', wg_amount='" . sprintf("%.2f", $row['wg_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
290 | $sql .= "', wg_calcium='" . $row['wg_calcium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
291 | $sql .= "', wg_sulfate='" . $row['wg_sulfate']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
292 | $sql .= "', wg_chloride='" . $row['wg_chloride']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
293 | $sql .= "', wg_sodium='" . $row['wg_sodium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
294 | $sql .= "', wg_magnesium='" . $row['wg_magnesium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
295 | $sql .= "', wg_total_alkalinity='" . $row['wg_total_alkalinity']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
296 | $sql .= "', wg_ph='" . $row['wg_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
297 | $sql .= "', wb_calcium='" . $row['wb_calcium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
298 | $sql .= "', wb_sulfate='" . $row['wb_sulfate']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
299 | $sql .= "', wb_chloride='" . $row['wb_chloride']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
300 | $sql .= "', wb_sodium='" . $row['wb_sodium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
301 | $sql .= "', wb_magnesium='" . $row['wb_magnesium']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
302 | $sql .= "', wb_total_alkalinity='" . $row['wb_total_alkalinity']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
303 | $sql .= "', wb_ph='" . $row['wb_ph']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
304 | $sql .= "', wa_acid_name='" . $row['wa_acid_name']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
305 | $sql .= "', wa_acid_perc='" . $row['wa_acid_perc']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
306 | $sql .= "', wa_base_name='" . $row['wa_base_name']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
307 | $sql .= "', starter_enable='" . $row['starter_enable']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
308 | $sql .= "', starter_type='" . $row['starter_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
309 | $sql .= "', starter_sg='" . $row['starter_sg']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
310 | $sql .= "', starter_viability='" . $row['starter_viability']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
311 | $sql .= "', prop1_type='" . $row['prop1_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
312 | $sql .= "', prop2_type='" . $row['prop2_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
313 | $sql .= "', prop3_type='" . $row['prop3_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
314 | $sql .= "', prop4_type='" . $row['prop4_type']; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
315 | $sql .= "', prop1_volume='" . sprintf("%.3f", $row['prop1_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
316 | $sql .= "', prop2_volume='" . sprintf("%.3f", $row['prop2_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
317 | $sql .= "', prop3_volume='" . sprintf("%.3f", $row['prop3_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
318 | $sql .= "', prop4_volume='" . sprintf("%.3f", $row['prop4_volume'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
319 | $sql .= "', divide_type='" . $divide_type; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
320 | $sql .= "', divide_parts='" . $divide_parts; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
321 | $sql .= "', divide_part='" . $index; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
322 | $sql .= "', divide_size='" . floatval($split['size']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
323 | $sql .= "', divide_factor='". $factor; |
722
c4457e10d968
Fix db error when splitting a batch. Removed the minimum 10% divide volume in the room calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
650
diff
changeset
|
324 | // syslog(LOG_NOTICE, "db_divide: index " . $index . " " . $sql); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
325 | } |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
326 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
327 | $fermentables = json_decode($row['json_fermentables'], true); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
328 | for ($i = 0; $i < count($fermentables); $i++) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
329 | $fermentables[$i]['f_amount'] = sprintf("%.5f", $fermentables[$i]['f_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
330 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
331 | // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($fermentables, JSON_UNESCAPED_UNICODE))); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
332 | $sql .= "', json_fermentables='" . str_replace($rescapers,$rreplacements,json_encode($fermentables, JSON_UNESCAPED_UNICODE)); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
333 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
334 | $hops = json_decode($row['json_hops'], true); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
335 | for ($i = 0; $i < count($hops); $i++) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
336 | $hops[$i]['h_amount'] = sprintf("%.5f", $hops[$i]['h_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
337 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
338 | // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($hops, JSON_UNESCAPED_UNICODE))); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
339 | $sql .= "', json_hops='" . str_replace($rescapers,$rreplacements,json_encode($hops, JSON_UNESCAPED_UNICODE)); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
340 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
341 | $miscs = json_decode($row['json_miscs'], true); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
342 | for ($i = 0; $i < count($miscs); $i++) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
343 | $miscs[$i]['m_amount'] = sprintf("%.5f", $miscs[$i]['m_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
344 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
345 | // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($miscs, JSON_UNESCAPED_UNICODE))); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
346 | $sql .= "', json_miscs='" . str_replace($rescapers,$rreplacements,json_encode($miscs, JSON_UNESCAPED_UNICODE)); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
347 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
348 | $yeasts = json_decode($row['json_yeasts'], true); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
349 | for ($i = 0; $i < count($yeasts); $i++) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
350 | $yeasts[$i]['y_amount'] = sprintf("%.5f", $yeasts[$i]['y_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
351 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
352 | // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE))); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
353 | $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE)); |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
354 | |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
355 | $mashs = json_decode($row['json_mashs'], true); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
356 | for ($i = 0; $i < count($mashs); $i++) { |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
357 | $mashs[$i]['step_volume'] = sprintf("%.5f", $mashs[$i]['step_volume'] * $factor); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
358 | $mashs[$i]['step_infuse_amount'] = sprintf("%.5f", $mashs[$i]['step_infuse_amount'] * $factor); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
359 | } |
722
c4457e10d968
Fix db error when splitting a batch. Removed the minimum 10% divide volume in the room calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
650
diff
changeset
|
360 | // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE))); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
361 | $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE)); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
362 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
363 | if ($index == 0) { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
364 | $sql .= "' WHERE record='" . $record . "';"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
365 | $result2 = mysqli_query($link, $sql); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
366 | if (! $result2) { |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
367 | syslog(LOG_NOTICE, "db_divide: result: ".mysqli_error($link)); |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
368 | $response['error'] = true; |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
369 | $response['msg'] = "Update master result: ".mysqli_error($link); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
370 | break; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
371 | } else { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
372 | syslog(LOG_NOTICE, "db_divide: updated record ".$record." code ".$split['code']); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
373 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
374 | } else { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
375 | $sql .= "';"; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
376 | $result2 = mysqli_query($link, $sql); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
377 | if (! $result2) { |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
378 | $response['error'] = true; |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
379 | $response['msg'] = "Insert split record result: ".mysqli_error($link); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
380 | syslog(LOG_NOTICE, "db_divide: result: ".mysqli_error($link)); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
381 | break; |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
382 | } else { |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
383 | $lastid = mysqli_insert_id($link); |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
384 | syslog(LOG_NOTICE, "db_divide: inserted record ".$lastid." code ".$split['code']); |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
385 | /* Copy brew log records */ |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
386 | if ($row['log_brew'] == '1') { |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
387 | $result3 = mysqli_query($link, "SELECT * FROM log_brews WHERE code='" . $row['code'] . "'"); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
388 | if (! $result3) { |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
389 | syslog(LOG_NOTICE, "db_divide: result3: ".mysqli_error($link)); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
390 | } |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
391 | while ($row3 = mysqli_fetch_array($result3)) { |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
392 | $sql3 = "INSERT INTO log_brews SET datetime='" . $row3['datetime']; |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
393 | $sql3 .= "', version='" . $row3['version']; |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
394 | $sql3 .= "', uuid='" . $uuid; |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
395 | $sql3 .= "', code='" . mysqli_real_escape_string($link, $split['code']); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
396 | $sql3 .= "', name='" . mysqli_real_escape_string($link, $split['name']); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
397 | $sql3 .= "', pv_mlt='" . $row3['pv_mlt']; |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
398 | if (strlen($row3['pv_hlt'])) |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
399 | $sql3 .= "', pv_hlt='" . $row3['pv_hlt']; |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
400 | if (strlen($row3['pv_room'])) |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
401 | $sql3 .= "', pv_room='" . $row3['pv_room']; |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
402 | $sql3 .= "', sp_mlt='" . $row3['sp_mlt']; |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
403 | if (strlen($row3['sp_hlt'])) |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
404 | $sql3 .= "', sp_hlt='" . $row3['sp_hlt']; |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
405 | $sql3 .= "', pwm_mlt='" . $row3['pwm_mlt']; |
774
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
406 | if (strlen($row3['pwm_hlt'])) |
92e1e8f175a2
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
Michiel Broek <mbroek@mbse.eu>
parents:
754
diff
changeset
|
407 | $sql3 .= "', pwm_hlt='" . $row3['pwm_hlt']; |
650
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
408 | $sql3 .= "', event='" . $row3['event'] . "';"; |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
409 | $result4 = mysqli_query($link, $sql3); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
410 | if (! $result4) { |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
411 | syslog(LOG_NOTICE, "db_divide: result4: ".mysqli_error($link)." ".$sql3); |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
412 | } |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
413 | } |
fd7da9570810
Copy brew logs in splitted batches.
Michiel Broek <mbroek@mbse.eu>
parents:
616
diff
changeset
|
414 | } |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
415 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
416 | } |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
417 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
418 | } |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
419 | } else { |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
420 | syslog(LOG_NOTICE, "db_divide: missing arguments"); |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
421 | $response['error'] = true; |
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
422 | $response['msg'] = "missing arguments"; |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
423 | } |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
424 | |
754
30abc8024afe
The php/ajax combo for split btaches is the first that will do a better job handling errors. Split batch leftover calculations rounded to 1 decimal. Refuse to split and leave nothing in the main batch
Michiel Broek <mbroek@mbse.eu>
parents:
722
diff
changeset
|
425 | echo json_encode($response); |
533
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
426 | |
be8691b7d634
Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents:
500
diff
changeset
|
427 | |
500
8d53ad389204
Reworked the splitted batches, the data is now in a separate table and there is only one product record.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
428 | ?> |