14 if (isset($_GET['insert'])) { |
14 if (isset($_GET['insert'])) { |
15 // INSERT COMMAND |
15 // INSERT COMMAND |
16 $sql = "INSERT INTO `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
16 $sql = "INSERT INTO `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
17 $sql .= "', type='" . $_GET['type']; |
17 $sql .= "', type='" . $_GET['type']; |
18 $sql .= "', form='" . $_GET['form']; |
18 $sql .= "', form='" . $_GET['form']; |
19 $sql .= "', amount='" . $_GET['amount']; |
|
20 ($_GET['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0"; |
|
21 $sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']); |
19 $sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']); |
22 $sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']); |
20 $sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']); |
23 $sql .= "', min_temperature='" . $_GET['min_temperature']; |
21 $sql .= "', min_temperature='" . $_GET['min_temperature']; |
24 $sql .= "', max_temperature='" . $_GET['max_temperature']; |
22 $sql .= "', max_temperature='" . $_GET['max_temperature']; |
25 $sql .= "', flocculation='" . $_GET['flocculation']; |
23 $sql .= "', flocculation='" . $_GET['flocculation']; |
26 $sql .= "', attenuation='" . $_GET['attenuation']; |
24 $sql .= "', attenuation='" . $_GET['attenuation']; |
27 $sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']); |
25 $sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']); |
28 $sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']); |
26 $sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']); |
29 $sql .= "', times_cultured='" . $_GET['times_cultured']; |
|
30 $sql .= "', max_reuse='" . $_GET['max_reuse']; |
27 $sql .= "', max_reuse='" . $_GET['max_reuse']; |
31 ($_GET['add_to_secondary'] == 'true') ? $sql .= "', add_to_secondary='1" : $sql .= "', add_to_secondary='0"; |
|
32 $sql .= "', inventory='" . $_GET['inventory']; |
28 $sql .= "', inventory='" . $_GET['inventory']; |
33 $sql .= "', cost='" . $_GET['cost']; |
29 $sql .= "', cost='" . $_GET['cost']; |
34 $sql .= "', production_date='" . $_GET['production_date']; |
30 $sql .= "', production_date='" . $_GET['production_date']; |
35 $sql .= "', tht_date='" . $_GET['tht_date']; |
31 $sql .= "', tht_date='" . $_GET['tht_date']; |
36 $sql .= "';"; |
32 $sql .= "';"; |
45 } else if (isset($_GET['update'])) { |
41 } else if (isset($_GET['update'])) { |
46 // UPDATE COMMAND |
42 // UPDATE COMMAND |
47 $sql = "UPDATE `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
43 $sql = "UPDATE `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
48 $sql .= "', type='" . $_GET['type']; |
44 $sql .= "', type='" . $_GET['type']; |
49 $sql .= "', form='" . $_GET['form']; |
45 $sql .= "', form='" . $_GET['form']; |
50 $sql .= "', amount='" . $_GET['amount']; |
|
51 ($_GET['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0"; |
|
52 $sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']); |
46 $sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']); |
53 $sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']); |
47 $sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']); |
54 $sql .= "', min_temperature='" . $_GET['min_temperature']; |
48 $sql .= "', min_temperature='" . $_GET['min_temperature']; |
55 $sql .= "', max_temperature='" . $_GET['max_temperature']; |
49 $sql .= "', max_temperature='" . $_GET['max_temperature']; |
56 $sql .= "', flocculation='" . $_GET['flocculation']; |
50 $sql .= "', flocculation='" . $_GET['flocculation']; |
57 $sql .= "', attenuation='" . $_GET['attenuation']; |
51 $sql .= "', attenuation='" . $_GET['attenuation']; |
58 $sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']); |
52 $sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']); |
59 $sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']); |
53 $sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']); |
60 $sql .= "', times_cultured='" . $_GET['times_cultured']; |
|
61 $sql .= "', max_reuse='" . $_GET['max_reuse']; |
54 $sql .= "', max_reuse='" . $_GET['max_reuse']; |
62 ($_GET['add_to_secondary'] == 'true') ? $sql .= "', add_to_secondary='1" : $sql .= "', add_to_secondary='0"; |
|
63 $sql .= "', inventory='" . $_GET['inventory']; |
55 $sql .= "', inventory='" . $_GET['inventory']; |
64 $sql .= "', cost='" . $_GET['cost']; |
56 $sql .= "', cost='" . $_GET['cost']; |
65 $sql .= "', production_date='" . $_GET['production_date']; |
57 $sql .= "', production_date='" . $_GET['production_date']; |
66 $sql .= "', tht_date='" . $_GET['tht_date']; |
58 $sql .= "', tht_date='" . $_GET['tht_date']; |
67 $sql .= "' WHERE record='" . $_GET['record'] . "';"; |
59 $sql .= "' WHERE record='" . $_GET['record'] . "';"; |
91 $yeasts[] = array( |
83 $yeasts[] = array( |
92 'record' => $row['record'], |
84 'record' => $row['record'], |
93 'name' => $row['name'], |
85 'name' => $row['name'], |
94 'type' => $row['type'], |
86 'type' => $row['type'], |
95 'form' => $row['form'], |
87 'form' => $row['form'], |
96 'amount' => $row['amount'], |
|
97 'amount_is_weight' => $row['amount_is_weight'], |
|
98 'laboratory' => $row['laboratory'], |
88 'laboratory' => $row['laboratory'], |
99 'product_id' => $row['product_id'], |
89 'product_id' => $row['product_id'], |
100 'min_temperature' => $row['min_temperature'], |
90 'min_temperature' => $row['min_temperature'], |
101 'max_temperature' => $row['max_temperature'], |
91 'max_temperature' => $row['max_temperature'], |
102 'flocculation' => $row['flocculation'], |
92 'flocculation' => $row['flocculation'], |
103 'attenuation' => $row['attenuation'], |
93 'attenuation' => $row['attenuation'], |
104 'notes' => $row['notes'], |
94 'notes' => $row['notes'], |
105 'best_for' => $row['best_for'], |
95 'best_for' => $row['best_for'], |
106 'times_cultured' => $row['times_cultured'], |
|
107 'max_reuse' => $row['max_reuse'], |
96 'max_reuse' => $row['max_reuse'], |
108 'add_to_secondary' => $row['add_to_secondary'], |
|
109 'inventory' => $row['inventory'], |
97 'inventory' => $row['inventory'], |
110 'cost' => $row['cost'], |
98 'cost' => $row['cost'], |
111 'production_date' => $row['production_date'], |
99 'production_date' => $row['production_date'], |
112 'tht_date' => $row['tht_date'] |
100 'tht_date' => $row['tht_date'] |
113 ); |
101 ); |