www/includes/db_product.php

changeset 408
a93c9473a7c3
parent 394
ccd85f0ed96c
child 411
077ada2dda9b
equal deleted inserted replaced
407:9281bbbf26a6 408:a93c9473a7c3
27 $stage = $_POST['stage']; 27 $stage = $_POST['stage'];
28 28
29 // Basic settings 29 // Basic settings
30 if (isset($_POST['uuid'])) { 30 if (isset($_POST['uuid'])) {
31 $sql .= "uuid='" . $_POST['uuid']; 31 $sql .= "uuid='" . $_POST['uuid'];
32 syslog(LOG_NOTICE, 'Keep uuid ');
33 } else { 32 } else {
34 $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid')); 33 $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid'));
35 $sql .= "uuid='" . $uuid; 34 $sql .= "uuid='" . $uuid;
36 syslog(LOG_NOTICE, 'New uuid ');
37 } 35 }
38 $sql .= "', name='" . mysqli_real_escape_string($connect, $_POST['name']); 36 $sql .= "', name='" . mysqli_real_escape_string($connect, $_POST['name']);
39 $sql .= "', code='" . mysqli_real_escape_string($connect, $_POST['code']); 37 $sql .= "', code='" . mysqli_real_escape_string($connect, $_POST['code']);
40 $sql .= "', birth='" . $_POST['birth']; 38 $sql .= "', birth='" . $_POST['birth'];
41 $sql .= "', stage='" . $_POST['stage']; 39 $sql .= "', stage='" . $_POST['stage'];
129 $sql .= "', package_date=NULL"; 127 $sql .= "', package_date=NULL";
130 else 128 else
131 $sql .= "', package_date='" . $_POST['package_date'] ."'"; 129 $sql .= "', package_date='" . $_POST['package_date'] ."'";
132 $sql .= ", bottle_amount='" . $_POST['bottle_amount']; 130 $sql .= ", bottle_amount='" . $_POST['bottle_amount'];
133 $sql .= "', bottle_carbonation='" . $_POST['bottle_carbonation']; 131 $sql .= "', bottle_carbonation='" . $_POST['bottle_carbonation'];
134 $sql .= "', bottle_priming_sugar='" . $_POST['bottle_priming_sugar']; 132 //$sql .= "', bottle_priming_sugar='" . $_POST['bottle_priming_sugar'];
135 $sql .= "', bottle_priming_amount='" . $_POST['bottle_priming_amount']; 133 $sql .= "', bottle_priming_amount='" . $_POST['bottle_priming_amount'];
136 $sql .= "', bottle_carbonation_temp='" . $_POST['bottle_carbonation_temp']; 134 $sql .= "', bottle_carbonation_temp='" . $_POST['bottle_carbonation_temp'];
137 $sql .= "', keg_amount='" . $_POST['keg_amount']; 135 $sql .= "', keg_amount='" . $_POST['keg_amount'];
138 $sql .= "', keg_carbonation='" . $_POST['keg_carbonation']; 136 $sql .= "', keg_carbonation='" . $_POST['keg_carbonation'];
139 $sql .= "', keg_priming_sugar='" . $_POST['keg_priming_sugar']; 137 //$sql .= "', keg_priming_sugar='" . $_POST['keg_priming_sugar'];
140 $sql .= "', keg_priming_amount='" . $_POST['keg_priming_amount']; 138 $sql .= "', keg_priming_amount='" . $_POST['keg_priming_amount'];
141 $sql .= "', keg_carbonation_temp='" . $_POST['keg_carbonation_temp']; 139 $sql .= "', keg_carbonation_temp='" . $_POST['keg_carbonation_temp'];
142 $sql .= "', keg_forced_carb='" . $_POST['keg_forced_carb']; 140 $sql .= "', keg_forced_carb='" . $_POST['keg_forced_carb'];
143 $sql .= "', keg_pressure='" . $_POST['keg_pressure']; 141 $sql .= "', keg_pressure='" . $_POST['keg_pressure'];
144 $sql .= "', taste_notes='" . mysqli_real_escape_string($connect, $_POST['taste_notes']); 142 $sql .= "', taste_notes='" . mysqli_real_escape_string($connect, $_POST['taste_notes']);
713 $brew .= ',"secondary_end_date":"' . $row['secondary_end_date']; 711 $brew .= ',"secondary_end_date":"' . $row['secondary_end_date'];
714 $brew .= '","tertiary_temp":' . floatval($row['tertiary_temp']); 712 $brew .= '","tertiary_temp":' . floatval($row['tertiary_temp']);
715 $brew .= ',"package_date":"' . $row['package_date']; 713 $brew .= ',"package_date":"' . $row['package_date'];
716 $brew .= '","bottle_amount":' . floatval($row['bottle_amount']); 714 $brew .= '","bottle_amount":' . floatval($row['bottle_amount']);
717 $brew .= ',"bottle_carbonation":' . floatval($row['bottle_carbonation']); 715 $brew .= ',"bottle_carbonation":' . floatval($row['bottle_carbonation']);
718 $brew .= ',"bottle_priming_sugar":' . $row['bottle_priming_sugar']; 716 //$brew .= ',"bottle_priming_sugar":' . $row['bottle_priming_sugar'];
719 $brew .= ',"bottle_priming_amount":' . floatval($row['bottle_priming_amount']); 717 $brew .= ',"bottle_priming_amount":' . floatval($row['bottle_priming_amount']);
720 $brew .= ',"bottle_carbonation_temp":' . floatval($row['bottle_carbonation_temp']); 718 $brew .= ',"bottle_carbonation_temp":' . floatval($row['bottle_carbonation_temp']);
721 $brew .= ',"keg_amount":' . floatval($row['keg_amount']); 719 $brew .= ',"keg_amount":' . floatval($row['keg_amount']);
722 $brew .= ',"keg_carbonation":' . floatval($row['keg_carbonation']); 720 $brew .= ',"keg_carbonation":' . floatval($row['keg_carbonation']);
723 $brew .= ',"keg_priming_sugar":' . $row['keg_priming_sugar']; 721 //$brew .= ',"keg_priming_sugar":' . $row['keg_priming_sugar'];
724 $brew .= ',"keg_priming_amount":' . floatval($row['keg_priming_amount']); 722 $brew .= ',"keg_priming_amount":' . floatval($row['keg_priming_amount']);
725 $brew .= ',"keg_carbonation_temp":' . floatval($row['keg_carbonation_temp']); 723 $brew .= ',"keg_carbonation_temp":' . floatval($row['keg_carbonation_temp']);
726 $brew .= ',"keg_forced_carb":' . floatval($row['keg_forced_carb']); 724 $brew .= ',"keg_forced_carb":' . floatval($row['keg_forced_carb']);
727 $brew .= ',"keg_pressure":' . floatval($row['keg_pressure']); 725 $brew .= ',"keg_pressure":' . floatval($row['keg_pressure']);
728 $brew .= ',"taste_notes":"' . str_replace($escapers, $replacements, $row['taste_notes']); 726 $brew .= ',"taste_notes":"' . str_replace($escapers, $replacements, $row['taste_notes']);
1063 global $connect; 1061 global $connect;
1064 1062
1065 $savethis = 0; 1063 $savethis = 0;
1066 $stage = $_POST['stage']; 1064 $stage = $_POST['stage'];
1067 $inventory_reduced = $_POST['inventory_reduced']; 1065 $inventory_reduced = $_POST['inventory_reduced'];
1066 if ($stage == $inventory_reduced) {
1067 return;
1068 }
1068 syslog(LOG_NOTICE, "inventory_reduce() stage: ".$stage." inventory_reduced: ".$inventory_reduced); 1069 syslog(LOG_NOTICE, "inventory_reduce() stage: ".$stage." inventory_reduced: ".$inventory_reduced);
1069 1070
1070 /* 1071 /*
1071 * If the brew is done, reduce the used ingredients. 1072 * If the brew is done, reduce the used ingredients.
1072 */ 1073 */

mercurial