www/includes/db_divides.php

Wed, 23 Oct 2019 14:20:50 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 23 Oct 2019 14:20:50 +0200
branch
divide
changeset 533
be8691b7d634
parent 500
8d53ad389204
child 602
10b61aacb1c1
permissions
-rw-r--r--

Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.

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
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
19 /*
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
20 * 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
21 * 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
22 * 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
23 * 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
24 * 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
25 *
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 * 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
27 * 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
28 * 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
29 */
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
32
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $rc = 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
34 $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
35 $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
36 $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
37 $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
38
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
40
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
42 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
43
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
45 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
46 }
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
47
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
48 $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
49 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
50 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
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 $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
53 $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
54
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
55 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
56 /*
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 * 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
58 */
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $sql = "UPDATE `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
60 $sql .= "brew_sparge_volume='" . sprintf("%.1f", $row['brew_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
61 $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
62 $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
63 $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
64 $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
65 $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
66 $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
67 $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
68 $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
69 $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
70 $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
71 $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
72 $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
73 $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
74 $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
75 $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
76 $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
77 $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
78 $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
79 $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
80 $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
81 $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
82 $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
83 $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
84 $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
85 $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
86 $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
87 $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
88 $sql .= "', divide_factor='". $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
89 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
90
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
91 } 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
92 /*
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
93 * 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
94 */
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $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
96 $sql .= "name='" . mysqli_real_escape_string($link, $split['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
97 $sql .= "', uuid='" . str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid'));
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
98 $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
99 $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
100 $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
101 $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
102 $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
103 $sql .= "', log_fermentation='" . $row['log_fermentation'];
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 .= "', 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
105 $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
106 // 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
107 $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
108 $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
109 $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
110 $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
111 $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
112 $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
113 $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
114 $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
115 $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
116 $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
117 $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
118 $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
119 $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
120 $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
121 $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
122 $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
123 $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
124 $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
125 $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
126 $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
127 $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
128 $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
129 $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
130 $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
131 // 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
132 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
133 $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
134 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
135 $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
136 $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
137 $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
138 $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
139 $sql .= "', brew_sparge_temperature='" . $row['brew_sparge_temperature'];
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $sql .= "', brew_sparge_volume='" . sprintf("%.1f", $row['brew_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
141 $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
142 $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
143 $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
144 $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
145 $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
146 $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
147 $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
148 $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
149 $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
150 $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
151 $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
152 $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
153 $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
154 $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
155 $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
156 $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
157 $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
158 $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
159 $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
160 $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
161 $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
162 $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
163 $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
164 $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
165 $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
166 $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
167 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
168 $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
169 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
170 $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
171 $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
172 $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
173 $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
174 $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
175 $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
176 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
177 $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
178 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
179 $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
180 $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
181 $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
182 $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
183 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
184 $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
185 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
186 $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
187 $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
188 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
189 $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
190 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
191 $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
192 $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
193 $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
194 $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
195 $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
196 $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
197 $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
198 $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
199 $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
200 $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
201 $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
202 $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
203 $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
204 $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
205 $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
206 $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
207 $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
208 $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
209 $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
210 $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
211 $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
212 $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
213 $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
214 $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
215 $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
216 $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
217 $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
218 $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
219 $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
220 $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
221 $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
222 // 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
223 $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
224 $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
225 $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
226 $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
227 $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
228 $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
229 $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
230 $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
231 $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
232 $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
233 $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
234 $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
235 $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
236 $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
237 $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
238 $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
239 $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
240 $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
241 $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
242 $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
243 $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
244 $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
245 $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
246 $sql .= "', est_og='" . $row['est_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
247 $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
248 $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
249 $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
250 $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
251 $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
252 $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
253 $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
254 $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
255 $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
256 $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
257 $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
258 $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
259 $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
260 $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
261 $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
262 $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
263 $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
264 $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
265 $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
266 $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
267 $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
268 $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
269 $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
270 $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
271 $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
272 $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
273 $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
274 $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
275 $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
276 $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
277 $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
278 $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
279 $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
280 $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
281 $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
282 $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
283 $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
284 $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
285 $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
286 $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
287 $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
288 $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
289 $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
290 $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
291 $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
292 $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
293 $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
294 $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
295 $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
296 $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
297 $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
298 $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
299 $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
300 $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
301 $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
302 $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
303 $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
304 $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
305 $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
306 $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
307 $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
308 $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
309 $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
310 $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
311 $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
312 $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
313 $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
314 $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
315 $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
316 $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
317 $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
318 $sql .= "', divide_factor='". $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 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
320 }
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
321
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $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
323 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
324 $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
325 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 // 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
327 $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
328
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $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
330 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
331 $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
332 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 // 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
334 $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
335
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $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
337 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
338 $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
339 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 // 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
341 $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
342
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 $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
344 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
345 $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
346 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 // 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
348 $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
349
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
350 $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
351 for ($i = 0; $i < count($mashs); $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
352 $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
353 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
354 syslog(LOG_NOTICE, "db_divide: " . 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
355 $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
356
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
357 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
358 $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
359 $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
360 if (! $result2) {
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
362 $rc = 1;
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
364 } 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
365 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
366 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
367 } 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
368 $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
369 $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
370 if (! $result2) {
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
372 $rc = 1;
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 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
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 $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
376 syslog(LOG_NOTICE, "db_divide: inserted record ".$lastid." 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
377 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
378 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
379
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 }
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 syslog(LOG_NOTICE, "db_divide: rc=".$rc);
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product 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 echo $rc;
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
383 } 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
384 syslog(LOG_NOTICE, "db_divide: missing arguments");
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
385 echo 1;
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
386 }
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
387
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
388
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
389
be8691b7d634 Added the product divide scripts. All parts have all the volumes and weights divided, including the master record. Splitted batches have their own records with the product code formatted as code-n. From this design, we can rebuild the print and checklist.
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
390
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
391 ?>

mercurial