www/rec_toproduct.php

Sat, 25 Sep 2021 10:42:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 25 Sep 2021 10:42:54 +0200
changeset 778
e64fd38c469c
parent 734
2a90ffaf04b7
permissions
-rw-r--r--

If during styles import the CATEGORY_NUMBER is empty, insert 0 in the database instead.

303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once('config.php');
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 if (! $link) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 }
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 if (! mysqli_set_charset($link, "utf8" )) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 echo "error";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 return 1;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 }
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13
305
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
14 $rescapers = array("'");
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
15 $rreplacements = array("\\'");
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
16
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 date_default_timezone_set('Europe/Amsterdam');
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 if (isset($_GET["record"]))
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 $record = $_GET["record"];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 else
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 $record = 78;
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 $result = mysqli_query($link, "SELECT * FROM recipes WHERE record='".$record."'");
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 $row = mysqli_fetch_array($result);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 /*
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 * Copy this to a fresh product.
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 */
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 $sql = "INSERT INTO `products` SET ";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 $sql .= "name='" . mysqli_real_escape_string($link, $row['name']);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 $sql .= "', uuid='" . str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid'));
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 $sql .= "', code='" . date("YmdHi");
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 $sql .= "', birth='" . date("Y-m-d");
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 $sql .= "', stage='1";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']);
615
9034e65b0d7a Added CO2 carbonation log to the products database. Added button in the packaging tab.
Michiel Broek <mbroek@mbse.eu>
parents: 602
diff changeset
36 $sql .= "', log_brew='0', log_fermentation='0', log_ispindel='0', log_co2pressure='0', inventory_reduced='0', locked='0";
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 // Equipment
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 $sql .= "', eq_name='Kies zelf een installatie!";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 $sql .= "', eq_boil_size='" . $row['boil_size'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 $sql .= "', eq_batch_size='" . $row['batch_size'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 $sql .= "', eq_tun_volume='20', eq_tun_weight='2', eq_tun_specific_heat='0.11', eq_tun_material='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 $sql .= "', eq_tun_height='20', eq_top_up_water='0', eq_trub_chiller_loss='0.5', eq_evap_rate='1.8";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 $sql .= "', eq_boil_time='" . $row['boil_time'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 $sql .= "', eq_calc_boil_volume='1', eq_top_up_kettle='0', eq_hop_utilization='100', eq_notes='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $sql .= "', eq_lauter_volume='20', eq_lauter_height='20', eq_lauter_deadspace='0.5', eq_kettle_volume='20";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 $sql .= "', eq_kettle_height='20', eq_mash_volume='18', eq_mash_max='6', eq_efficiency='75";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 // brewdate
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 $sql .= "', brew_date_start=NULL, brew_mash_ph='0.0', brew_mash_sg='1.000";
536
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
49 $sql .= "', brew_mash_efficiency='0.0', brew_sparge_ph='0.0', brew_sparge_temperature='85.0";
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
50 $sql .= "', brew_preboil_volume='0', brew_preboil_sg='0', brew_preboil_ph='0.0', brew_preboil_efficiency='0";
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 $sql .= "', brew_aboil_volume='0', brew_aboil_sg='0', brew_aboil_ph='0.0', brew_aboil_efficiency='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 $sql .= "', brew_cooling_method='0', brew_cooling_time='0', brew_cooling_to='20";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 $sql .= "', brew_whirlpool9='0', brew_whirlpool7='0', brew_whirlpool6='0', brew_whirlpool2='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 $sql .= "', brew_aeration_time='0', brew_aeration_speed='0', brew_aeration_type='0";
734
2a90ffaf04b7 Fixed copy recipe to product fail.
Michiel Broek <mbroek@mbse.eu>
parents: 616
diff changeset
55 $sql .= "', brew_fermenter_volume='" . floatval($row['batch_size']);
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 $sql .= "', brew_fermenter_extrawater='0', brew_fermenter_tcloss='0.5', brew_fermenter_sg='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 $sql .= "', brew_fermenter_ibu='0', brew_fermenter_color='0', brew_date_end=NULL, og='0', fg='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 $sql .= "', primary_start_temp='0', primary_max_temp='0', primary_end_temp='0', primary_end_date=NULL, primary_end_sg='0";
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 458
diff changeset
59 $sql .= "', secondary_temp='0', secondary_end_sg='0', secondary_end_date=NULL, tertiary_temp='0";
458
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
60 $sql .= "', package_date=NULL, package_volume='0', package_infuse_amount='0', package_infuse_abv='0', package_infuse_notes='";
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
61 $sql .= "', package_abv='0', package_ph='0";
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
62 $sql .= "', bottle_amount='0', bottle_carbonation='0', bottle_priming_water='0', bottle_priming_amount='0', bottle_carbonation_temp='23";
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
63 $sql .= "', keg_amount='0', keg_carbonation='0', keg_priming_water='0', keg_priming_amount='0', keg_carbonation_temp='23";
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 $sql .= "', keg_forced_carb='0', keg_pressure='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 $sql .= "', taste_notes='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 $sql .= "', taste_rate='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 $sql .= "', taste_date=NULL";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $sql .= ", taste_color='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 $sql .= "', taste_transparency='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 $sql .= "', taste_head='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 $sql .= "', taste_aroma='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 $sql .= "', taste_taste='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 $sql .= "', taste_mouthfeel='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 $sql .= "', taste_aftertaste='";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 // Style
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $sql .= "', st_name='" . mysqli_real_escape_string($link, $row['st_name']);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $sql .= "', st_letter='" . mysqli_real_escape_string($link, $row['st_letter']);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $sql .= "', st_guide='" . mysqli_real_escape_string($link, $row['st_guide']);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $sql .= "', st_type='" . $row['st_type'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $sql .= "', st_category='" . mysqli_real_escape_string($link, $row['st_category']);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $sql .= "', st_category_number='" . $row['st_category_number'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $sql .= "', st_og_min='" . $row['st_og_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $sql .= "', st_og_max='" . $row['st_og_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $sql .= "', st_fg_min='" . $row['st_fg_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 $sql .= "', st_fg_max='" . $row['st_fg_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 $sql .= "', st_ibu_min='" . $row['st_ibu_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 $sql .= "', st_ibu_max='" . $row['st_ibu_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $sql .= "', st_color_min='" . $row['st_color_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 $sql .= "', st_color_max='" . $row['st_color_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 $sql .= "', st_carb_min='" . $row['st_carb_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 $sql .= "', st_carb_max='" . $row['st_carb_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 $sql .= "', st_abv_min='" . $row['st_abv_min'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 $sql .= "', st_abv_max='" . $row['st_abv_max'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 $sql .= "', type='" . $row['type'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 $sql .= "', batch_size='" . $row['batch_size'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 $sql .= "', boil_size='" . $row['boil_size'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 $sql .= "', boil_time='" . $row['boil_time'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 $sql .= "', efficiency='" . $row['efficiency'];
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 $sql .= "', est_og='0.000";
616
2cbf21bb9bdc Added est_og3 field in the products database so that the checklist can use it.
Michiel Broek <mbroek@mbse.eu>
parents: 615
diff changeset
100 $sql .= "', est_og3='0.000";
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 $sql .= "', est_fg='0.000";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 $sql .= "', est_abv='0.0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 $sql .= "', est_carb='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 $sql .= "', est_color='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 $sql .= "', color_method='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 $sql .= "', est_ibu='0";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 $sql .= "', ibu_method='0";
304
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
108 $sql .= "', sparge_temp='" . $row['sparge_temp'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
109 $sql .= "', sparge_ph='" . $row['sparge_ph'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
110 $sql .= "', sparge_volume='" . $row['sparge_volume'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
111 $sql .= "', sparge_source='" . $row['sparge_source'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
112 $sql .= "', sparge_acid_type='" . $row['sparge_acid_type'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
113 $sql .= "', sparge_acid_perc='" . $row['sparge_acid_perc'];
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 $sql .= "', sparge_acid_amount='0";
304
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
115 $sql .= "', mash_ph='" . $row['mash_ph'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
116 $sql .= "', mash_name='" . $row['mash_name'];
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 $sql .= "', calc_acid='1";
304
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
118 $sql .= "', w1_name='" . mysqli_real_escape_string($link, $row['w1_name']);
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
119 $sql .= "', w1_amount='" . $row['w1_amount'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
120 $sql .= "', w1_calcium='" . $row['w1_calcium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
121 $sql .= "', w1_sulfate='" . $row['w1_sulfate'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
122 $sql .= "', w1_chloride='" . $row['w1_chloride'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
123 $sql .= "', w1_sodium='" . $row['w1_sodium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
124 $sql .= "', w1_magnesium='" . $row['w1_magnesium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
125 $sql .= "', w1_total_alkalinity='" . $row['w1_total_alkalinity'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
126 $sql .= "', w1_ph='" . $row['w1_ph'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
127 $sql .= "', w1_cost='" . $row['w1_cost'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
128 $sql .= "', w2_name='" . mysqli_real_escape_string($link, $row['w2_name']);
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
129 $sql .= "', w2_amount='" . $row['w2_amount'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
130 $sql .= "', w2_calcium='" . $row['w2_calcium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
131 $sql .= "', w2_sulfate='" . $row['w2_sulfate'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
132 $sql .= "', w2_chloride='" . $row['w2_chloride'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
133 $sql .= "', w2_sodium='" . $row['w2_sodium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
134 $sql .= "', w2_magnesium='" . $row['w2_magnesium'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
135 $sql .= "', w2_total_alkalinity='" . $row['w2_total_alkalinity'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
136 $sql .= "', w2_ph='" . $row['w2_ph'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
137 $sql .= "', w2_cost='" . $row['w2_cost'];
536
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
138 $sql .= "', wg_amount='" . $row['wg_amount'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
139 $sql .= "', wg_calcium='" . $row['wg_calcium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
140 $sql .= "', wg_sulfate='" . $row['wg_sulfate'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
141 $sql .= "', wg_chloride='" . $row['wg_chloride'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
142 $sql .= "', wg_sodium='" . $row['wg_sodium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
143 $sql .= "', wg_magnesium='" . $row['wg_magnesium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
144 $sql .= "', wg_total_alkalinity='" . $row['wg_total_alkalinity'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
145 $sql .= "', wg_ph='" . $row['wg_ph'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
146 $sql .= "', wb_calcium='" . $row['wb_calcium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
147 $sql .= "', wb_sulfate='" . $row['wb_sulfate'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
148 $sql .= "', wb_chloride='" . $row['wb_chloride'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
149 $sql .= "', wb_sodium='" . $row['wb_sodium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
150 $sql .= "', wb_magnesium='" . $row['wb_magnesium'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
151 $sql .= "', wb_total_alkalinity='" . $row['wb_total_alkalinity'];
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
152 $sql .= "', wb_ph='" . $row['wb_ph'];
304
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
153 $sql .= "', wa_acid_name='" . $row['wa_acid_name'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
154 $sql .= "', wa_acid_perc='" . $row['wa_acid_perc'];
c0ca21cdd291 Fix for recipe to product mash and water.
Michiel Broek <mbroek@mbse.eu>
parents: 303
diff changeset
155 $sql .= "', wa_base_name='" . $row['wa_base_name'];
518
00e110567fee The default starter SG changed to 1.037. Added several tooltips on the yeast tab.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
156 $sql .= "', starter_enable='0', starter_type='0', starter_sg='1.037', starter_viability='97";
458
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
157 $sql .= "', prop1_type='0', prop1_volume='0', prop2_type='0', prop2_volume='0";
47b592993dd5 Version 0.3.15. Implemented final pH during packaging. Updated prod_new, prod_duplicate, prod_edit, rec_toproduct for this new field and several other fields added in previous versions.
Michiel Broek <mbroek@mbse.eu>
parents: 432
diff changeset
158 $sql .= "', prop3_type='0', prop3_volume='0', prop4_type='0', prop4_volume='0";
536
ada10cabf217 Updated design notes. Added missing fields to rec_toproduct.
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
159 $sql .= "', divide_type='0', divide_parts='0', divide_part='0', divide_size='0', divide_factor='1.0";
305
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
160 $sql .= "', json_fermentables='" . str_replace($rescapers,$rreplacements,$row['json_fermentables']);
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
161 $sql .= "', json_hops='" . str_replace($rescapers,$rreplacements,$row['json_hops']);
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
162 $sql .= "', json_miscs='" . str_replace($rescapers,$rreplacements,$row['json_miscs']);
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
163 $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,$row['json_yeasts']);
bb55e065888a Fix escape single quotes
Michiel Broek <mbroek@mbse.eu>
parents: 304
diff changeset
164 $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,$row['json_mashs']);
303
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 $sql .= "';";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 syslog(LOG_NOTICE, $sql);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 $result = mysqli_query($link, $sql);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 if (! $result) {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 syslog(LOG_NOTICE, "rec_toproduct: result: ".mysqli_error($link));
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 } else {
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 $lastid = mysqli_insert_id($link);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 syslog(LOG_NOTICE, "rec_toproduct: inserted record ".$lastid);
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 }
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175 echo "<script>window.close();</script>";
98c2afc88780 Added recipe export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 exit;

mercurial