www/includes/db_inventory_equipments.php

changeset 116
ac993ef43b13
parent 115
ad31f4bd4036
child 149
ff45488d480e
equal deleted inserted replaced
115:ad31f4bd4036 116:ac993ef43b13
20 // UPDATE COMMAND 20 // UPDATE COMMAND
21 $sql = "UPDATE `inventory_equipments` SET "; 21 $sql = "UPDATE `inventory_equipments` SET ";
22 } 22 }
23 $sql .= "name='" . mysqli_real_escape_string($connect, $_GET['name']); 23 $sql .= "name='" . mysqli_real_escape_string($connect, $_GET['name']);
24 $sql .= "', boil_size='" . $_GET['boil_size']; 24 $sql .= "', boil_size='" . $_GET['boil_size'];
25 $batch = '$_GET[\'boil_size\'] - ($_GET[\'evap_rate\'] * ($_GET[\'boil_time\'] / 60))'; 25 $sql .= "', batch_size='" . $_GET['batch_size'];
26 $sql .= "', batch_size='" . eval('return ' . $batch . ';');
27 $sql .= "', tun_volume='" . $_GET['tun_volume']; 26 $sql .= "', tun_volume='" . $_GET['tun_volume'];
28 $sql .= "', tun_weight='" . $_GET['tun_weight']; 27 $sql .= "', tun_weight='" . $_GET['tun_weight'];
29 $material = mysqli_real_escape_string($connect, $_GET['tun_material']); 28 $sql .= "', tun_specific_heat='" . $_GET['tun_specific_heat'];
30 if ($material == "RVS") { 29 $sql .= "', tun_material='" . mysqli_real_escape_string($connect, $_GET['tun_material']);
31 $sql .= "', tun_specific_heat='0.11";
32 } else if ($material == "Aluminium") {
33 $sql .= "', tun_specific_heat='0.22";
34 } else if ($material == "Kunststof") {
35 $sql .= "', tun_specific_heat='0.46";
36 } else if ($material == "Koper") {
37 $sql .= "', tun_specific_heat='0.092";
38 }
39 $sql .= "', tun_material='" . $material;
40 $sql .= "', tun_height='" . $_GET['tun_height'] / 100.0; 30 $sql .= "', tun_height='" . $_GET['tun_height'] / 100.0;
41 $sql .= "', top_up_water='" . $_GET['top_up_water']; 31 $sql .= "', top_up_water='" . $_GET['top_up_water'];
42 $sql .= "', trub_chiller_loss='" . $_GET['trub_chiller_loss']; 32 $sql .= "', trub_chiller_loss='" . $_GET['trub_chiller_loss'];
43 $sql .= "', evap_rate='" . $_GET['evap_rate']; 33 $sql .= "', evap_rate='" . $_GET['evap_rate'];
44 $sql .= "', boil_time='" . $_GET['boil_time']; 34 $sql .= "', boil_time='" . $_GET['boil_time'];
55 $sql .= "', efficiency='" . $_GET['efficiency']; 45 $sql .= "', efficiency='" . $_GET['efficiency'];
56 if (isset($_GET['insert'])) { 46 if (isset($_GET['insert'])) {
57 $sql .= "';"; 47 $sql .= "';";
58 } 48 }
59 if (isset($_GET['update'])) { 49 if (isset($_GET['update'])) {
60 $sql .= "' WHERE record='" . $_GET['record'] . "';"; 50 $sql .= "' WHERE record='" . $_GET['record'] . "';";
61 } 51 }
62 $result = mysqli_query($connect, $sql); 52 $result = mysqli_query($connect, $sql);
63 if (! $result) { 53 if (! $result) {
64 syslog(LOG_NOTICE, "db_inventory_equipment: ".$sql." result: ".mysqli_error($connect)); 54 syslog(LOG_NOTICE, "db_inventory_equipment: ".$sql." result: ".mysqli_error($connect));
65 } else { 55 } else {

mercurial