55 $sql .= "', diastatic_power='" . $fermentable->DIASTATIC_POWER; |
55 $sql .= "', diastatic_power='" . $fermentable->DIASTATIC_POWER; |
56 if ($fermentable->PROTEIN) |
56 if ($fermentable->PROTEIN) |
57 $sql .= "', protein='" . $fermentable->PROTEIN; |
57 $sql .= "', protein='" . $fermentable->PROTEIN; |
58 if ($fermentable->MAX_IN_BATCH) |
58 if ($fermentable->MAX_IN_BATCH) |
59 $sql .= "', max_in_batch='" . $fermentable->MAX_IN_BATCH; |
59 $sql .= "', max_in_batch='" . $fermentable->MAX_IN_BATCH; |
60 ($fermentable->RECOMMEND_MASH == "TRUE") ? $sql .= "', recommend_mash='Y" : $sql .= "', recommend_mash='N"; |
60 ($fermentable->RECOMMEND_MASH == "TRUE") ? $sql .= "', recommend_mash='1" : $sql .= "', recommend_mash='0"; |
61 if ($fermentable->IBU_GAL_PER_LB) |
61 if ($fermentable->IBU_GAL_PER_LB) |
62 $sql .= "', ibu_gal_per_lb='" . $fermentable->IBU_GAL_PER_LB; |
62 $sql .= "', ibu_gal_per_lb='" . $fermentable->IBU_GAL_PER_LB; |
63 ($fermentable->ALWAYS_ON_STOCK == "TRUE") ? $sql .= "', always_on_stock='Y" : $sql .= "', always_on_stock='N"; |
63 ($fermentable->ALWAYS_ON_STOCK == "TRUE") ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; |
64 if ($fermentable->INVENTORY) |
64 if ($fermentable->INVENTORY) |
65 $sql .= "', inventory='" . $fermentable->INVENTORY; |
65 $sql .= "', inventory='" . $fermentable->INVENTORY; |
66 if ($fermentable->COST) |
66 if ($fermentable->COST) |
67 $sql .= "', cost='" . $fermentable->COST; |
67 $sql .= "', cost='" . $fermentable->COST; |
68 /* |
68 /* |
114 $sql .= "', type='" . $hop->TYPE; |
114 $sql .= "', type='" . $hop->TYPE; |
115 $sql .= "', form='" . $hop->FORM; |
115 $sql .= "', form='" . $hop->FORM; |
116 $sql .= "', notes='" . mysqli_real_escape_string($db, $hop->NOTES); |
116 $sql .= "', notes='" . mysqli_real_escape_string($db, $hop->NOTES); |
117 $sql .= "', origin='" . mysqli_real_escape_string($db, $hop->ORIGIN); |
117 $sql .= "', origin='" . mysqli_real_escape_string($db, $hop->ORIGIN); |
118 $sql .= "', substitutes='" . mysqli_real_escape_string($db, $hop->SUBSTITUTES); |
118 $sql .= "', substitutes='" . mysqli_real_escape_string($db, $hop->SUBSTITUTES); |
119 ($hop->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='Y" : $sql .= "', always_on_stock='N"; |
119 ($hop->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; |
120 if ($hop->INVENTORY) |
120 if ($hop->INVENTORY) |
121 $sql .= "', inventory='" . $hop->INVENTORY; |
121 $sql .= "', inventory='" . $hop->INVENTORY; |
122 if ($hop->COST) |
122 if ($hop->COST) |
123 $sql .= "', cost='" . $hop->COST; |
123 $sql .= "', cost='" . $hop->COST; |
124 if ($hop->TOTAL_OIL) |
124 if ($hop->TOTAL_OIL) |
199 foreach ($waters->WATER as $water) { |
199 foreach ($waters->WATER as $water) { |
200 |
200 |
201 if (($water->NAME == "Gedemineraliseerd water") || ($water->NAME == "Cristalline") || ($water->NAME == "Montille (Delhaize)") || |
201 if (($water->NAME == "Gedemineraliseerd water") || ($water->NAME == "Cristalline") || ($water->NAME == "Montille (Delhaize)") || |
202 ($water->NAME == "Spa Reine") || ($water->NAME == "Velsen") || ($water->NAME == "Zutphen") || |
202 ($water->NAME == "Spa Reine") || ($water->NAME == "Velsen") || ($water->NAME == "Zutphen") || |
203 ($water->NAME == "Aurele Bronwater (Colruyt)")) { |
203 ($water->NAME == "Aurele Bronwater (Colruyt)")) { |
204 $sql = "INSERT INTO inventory_water_sources SET name='" . mysqli_real_escape_string($db, $water->NAME); |
204 $sql = "INSERT INTO inventory_water_sources SET name='" . mysqli_real_escape_string($db, $water->NAME); |
|
205 ($water->DEFAULT_WATER == 'TRUE') ? $sql .= "', default_water='1" : $sql .= "', default_water='0"; |
205 } else { |
206 } else { |
206 $sql = "INSERT INTO inventory_water_profiles SET name='" . mysqli_real_escape_string($db, $water->NAME); |
207 $sql = "INSERT INTO inventory_water_profiles SET name='" . mysqli_real_escape_string($db, $water->NAME); |
207 } |
208 } |
208 |
209 |
209 ($water->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='Y" : $sql .= "', always_on_stock='N"; |
210 ($water->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; |
210 if ($water->NOTES) |
211 if ($water->NOTES) |
211 $sql .= "', notes='" . mysqli_real_escape_string($db, $water->NOTES); |
212 $sql .= "', notes='" . mysqli_real_escape_string($db, $water->NOTES); |
212 $sql .= "', calcium='" . $water->CALCIUM; |
213 $sql .= "', calcium='" . $water->CALCIUM; |
213 $sql .= "', bicarbonate='" . $water->BICARBONATE; |
214 $sql .= "', bicarbonate='" . $water->BICARBONATE; |
214 $sql .= "', sulfate='" . $water->SULFATE; |
215 $sql .= "', sulfate='" . $water->SULFATE; |
216 $sql .= "', sodium='" . $water->SODIUM; |
217 $sql .= "', sodium='" . $water->SODIUM; |
217 $sql .= "', magnesium='" . $water->MAGNESIUM; |
218 $sql .= "', magnesium='" . $water->MAGNESIUM; |
218 $sql .= "', ph='" . $water->PH; |
219 $sql .= "', ph='" . $water->PH; |
219 if ($water->TOTAL_ALKALINITY) |
220 if ($water->TOTAL_ALKALINITY) |
220 $sql .= "', total_alkalinity='" . $water->TOTAL_ALKALINITY; |
221 $sql .= "', total_alkalinity='" . $water->TOTAL_ALKALINITY; |
221 ($water->DEFAULT_WATER == 'TRUE') ? $sql .= "', default_water='Y" : $sql .= "', default_water='N"; |
|
222 $sql .= "';"; |
222 $sql .= "';"; |
223 if (! $result = mysqli_query($db, $sql)) { |
223 if (! $result = mysqli_query($db, $sql)) { |
224 printf("Error: %s\n", mysqli_error($db)); |
224 printf("Error: %s\n", mysqli_error($db)); |
225 } |
225 } |
226 } |
226 } |
246 if ($misc->NOTES) |
246 if ($misc->NOTES) |
247 $sql .= "', notes='" . mysqli_real_escape_string($db, $misc->NOTES); |
247 $sql .= "', notes='" . mysqli_real_escape_string($db, $misc->NOTES); |
248 $sql .= "', type='" . $misc->TYPE; |
248 $sql .= "', type='" . $misc->TYPE; |
249 $sql .= "', use_use='" . $misc->USE; |
249 $sql .= "', use_use='" . $misc->USE; |
250 $sql .= "', time='" . $misc->TIME; |
250 $sql .= "', time='" . $misc->TIME; |
251 $sql .= "', amount='" . $misc->AMOUNT; |
251 ($misc->AMOUNT_IS_WEIGHT == 'TRUE') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0"; |
252 ($misc->AMOUNT_IS_WEIGHT == 'TRUE') ? $sql .= "', amount_is_weight='Y" : $sql .= "', amount_is_weight='N"; |
|
253 if ($misc->USE_FOR) |
252 if ($misc->USE_FOR) |
254 $sql .= "', use_for='" . mysqli_real_escape_string($db, $misc->USE_FOR); |
253 $sql .= "', use_for='" . mysqli_real_escape_string($db, $misc->USE_FOR); |
255 if ($misc->ALWAYS_ON_STOCK) |
254 if ($misc->ALWAYS_ON_STOCK) |
256 ($misc->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='Y" : $sql .= "', always_on_stock='N"; |
255 ($misc->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; |
257 if ($misc->INVENTORY) |
256 if ($misc->INVENTORY) |
258 $sql .= "', inventory='" . $misc->INVENTORY; |
257 $sql .= "', inventory='" . $misc->INVENTORY; |
259 if ($misc->COST) |
258 if ($misc->COST) |
260 $sql .= "', cost='" . $misc->COST; |
259 $sql .= "', cost='" . $misc->COST; |
261 $sql .= "';"; |
260 $sql .= "';"; |
295 * do is calculate the actual evaporation and store that. |
294 * do is calculate the actual evaporation and store that. |
296 * This is what we use. Brouwhulp calculates this on the fly. |
295 * This is what we use. Brouwhulp calculates this on the fly. |
297 */ |
296 */ |
298 $sql .= "', evap_rate='" . ($equipment->EVAP_RATE * $equipment->BOIL_SIZE) / 100.0; |
297 $sql .= "', evap_rate='" . ($equipment->EVAP_RATE * $equipment->BOIL_SIZE) / 100.0; |
299 $sql .= "', boil_time='" . $equipment->BOIL_TIME; |
298 $sql .= "', boil_time='" . $equipment->BOIL_TIME; |
300 ($equipment->CALC_BOIL_VOLUME == 'TRUE') ? $sql .= "', calc_boil_volume='Y" : $sql .= "', calc_boil_volume='N"; |
299 ($equipment->CALC_BOIL_VOLUME == 'TRUE') ? $sql .= "', calc_boil_volume='1" : $sql .= "', calc_boil_volume='0"; |
301 $sql .= "', lauter_deadspace='" . $equipment->LAUTER_DEADSPACE; |
300 $sql .= "', lauter_deadspace='" . $equipment->LAUTER_DEADSPACE; |
302 $sql .= "', top_up_kettle='" . $equipment->TOP_UP_KETTLE; |
301 $sql .= "', top_up_kettle='" . $equipment->TOP_UP_KETTLE; |
303 $sql .= "', hop_utilization='" . $equipment->HOP_UTILIZATION; |
302 $sql .= "', hop_utilization='" . $equipment->HOP_UTILIZATION; |
304 if ($equipment->NOTES) |
303 if ($equipment->NOTES) |
305 $sql .= "', notes='" . mysqli_real_escape_string($db, $equipment->NOTES); |
304 $sql .= "', notes='" . mysqli_real_escape_string($db, $equipment->NOTES); |
406 $sql .= "', ph='" . $mash->PH; |
405 $sql .= "', ph='" . $mash->PH; |
407 if ($mash->TUN_WEIGHT) |
406 if ($mash->TUN_WEIGHT) |
408 $sql .= "', tun_weight='" . $mash->TUN_WEIGHT; |
407 $sql .= "', tun_weight='" . $mash->TUN_WEIGHT; |
409 if ($mash->TUN_SPECIFIX_HEAT) |
408 if ($mash->TUN_SPECIFIX_HEAT) |
410 $sql .= "', tun_specific_heat='" . $mash->TUN_SPECIFIC_HEAT; |
409 $sql .= "', tun_specific_heat='" . $mash->TUN_SPECIFIC_HEAT; |
411 ($mash->EQUIP_ADJUST == 'TRUE') ? $sql .= "', equip_adjust='Y" : $sql .= "', equip_adjust='N"; |
410 ($mash->EQUIP_ADJUST == 'TRUE') ? $sql .= "', equip_adjust='1" : $sql .= "', equip_adjust='0"; |
412 $sql .= "';"; |
411 $sql .= "';"; |
413 /* |
412 /* |
414 * Store the record and get the record number that is created. |
413 * Store the record and get the record number that is created. |
415 * Store that as a reference in the steps. |
414 * Store that as a reference in the steps. |
416 */ |
415 */ |