www/js/prod_new.js

changeset 166
635033a29c48
parent 111
8c4ba91adf58
child 167
dabcd35f8f92
equal deleted inserted replaced
165:5970c8377b89 166:635033a29c48
41 $('#nextButtonCompleted').click(function () { 41 $('#nextButtonCompleted').click(function () {
42 console.log("insert start"); 42 console.log("insert start");
43 var newrow = { 43 var newrow = {
44 record: -1, 44 record: -1,
45 name: $("#name").val(), 45 name: $("#name").val(),
46 code: $("#code").val(),
47 birth: $("#birth").val(),
48 stage: 'Plan',
46 notes: $("#notes").val(), 49 notes: $("#notes").val(),
50 log_brew: false,
51 log_fermentation: false,
52 inventory_reduced: false,
53 locked: false,
54 eq_name: $("#eq_name").val(),
55 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')),
56 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')),
57 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')),
58 eq_tun_weight: dataRecord.eq_tun_weight,
59 eq_tun_specific_heat: dataRecord.eq_tun_specific_heat,
60 eq_tun_material: dataRecord.eq_tun_material,
61 eq_tun_height: dataRecord.eq_tun_height,
62 eq_top_up_water: parseFloat($("#eq_top_up_water").jqxNumberInput('decimal')),
63 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')),
64 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')),
65 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')),
66 eq_calc_boil_volume: dataRecord.eq_calc_boil_volume,
67 eq_top_up_kettle: parseFloat($("#eq_top_up_kettle").jqxNumberInput('decimal')),
68 eq_hop_utilization: parseFloat($("#eq_hop_utilization").jqxNumberInput('decimal')),
69 eq_notes: $("#eq_notes").val(),
70 eq_lauter_volume: parseFloat($("#eq_lauter_volume").jqxNumberInput('decimal')),
71 eq_lauter_height: dataRecord.eq_lauter_height,
72 eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')),
73 eq_kettle_volume: parseFloat($("#eq_kettle_volume").jqxNumberInput('decimal')),
74 eq_kettle_height: dataRecord.eq_kettle_height,
75 eq_mash_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')),
76 eq_mash_max: parseFloat($("#eq_mash_max").jqxNumberInput('decimal')),
77 eq_efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')),
78 brew_date_start: '',
79 brew_mash_ph: 0.0,
80 brew_mash_sg: 1.000,
81 brew_sparge_temperature: 85,
82 brew_sparge_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')),
83 brew_sparge_ph: 0.0,
84 brew_preboil_volume: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')),
85 brew_preboil_sg: 1.000,
86 brew_preboil_ph: 0.0,
87 brew_aboil_volume: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')) * 0.9,
88 brew_aboil_sg: 1.000,
89 brew_aboil_ph: 0.0,
90 brew_aboil_efficiency: 0,
91 brew_cooling_method: '-',
92 brew_cooling_time: 0,
93 brew_cooling_to: 0,
94 brew_whirlpool9: 0,
95 brew_whirlpool7: 0,
96 brew_whirlpool6: 0,
97 brew_whirlpool2: 0,
98 brew_fermenter_volume: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')),
99 brew_fermenter_extrawater: 0,
100 brew_aeration_time: 0,
101 brew_aeration_speed: 0,
102 brew_aeration_type: 'None',
103 brew_fermenter_sg: 0,
104 brew_fermenter_ibu: 0,
105 brew_date_end: '',
106 brew_log_available: false,
107 og: 0,
108 fg: 0,
109 primary_start_temp: 0,
110 primary_max_temp: 0,
111 primary_end_temp: 0,
112 primary_end_sg: 0,
113 primary_end_date: '',
114 secondary_temp: 0,
115 secondary_end_date: '',
116 tertiary_temp: 0,
117 package_date: '',
118 bottle_amount: 0,
119 bottle_carbonation: 0,
120 bottle_priming_sugar: 'Kristalsuiker',
121 bottle_priming_amount: 0,
122 bottle_carbonation_temp: 23,
123 keg_amount: 0,
124 keg_carbonation: 0,
125 keg_priming_sugar: 'Kristalsuiker',
126 keg_priming_amount: 0,
127 keg_carbonation_temp: 23,
128 keg_forced_carb: false,
129 keg_pressure: 0,
130 taste_notes: '',
131 taste_rate: 0,
132 taste_date: '',
133 taste_color: '',
134 taste_transparency: '',
135 taste_head: '',
136 taste_aroma: '',
137 taste_taste: '',
138 taste_mouthfeel: '',
139 taste_aftertaste: '',
140 st_name: $('#st_name').val(),
141 st_letter: $('#st_letter').val(),
142 st_guide: $('#st_guide').val(),
143 st_type: $('#st_type').val(),
144 st_category: $('#st_category').val(),
145 st_category_number: parseFloat($("#st_category_number").jqxNumberInput('decimal')),
146 st_og_min: parseFloat($("#st_og_min").jqxNumberInput('decimal')),
147 st_og_max: parseFloat($("#st_og_max").jqxNumberInput('decimal')),
148 st_fg_min: parseFloat($("#st_fg_min").jqxNumberInput('decimal')),
149 st_fg_max: parseFloat($("#st_fg_max").jqxNumberInput('decimal')),
150 st_ibu_min: parseFloat($("#st_ibu_min").jqxNumberInput('decimal')),
151 st_ibu_max: parseFloat($("#st_ibu_max").jqxNumberInput('decimal')),
152 st_color_min: parseFloat($("#st_color_min").jqxNumberInput('decimal')),
153 st_color_max: parseFloat($("#st_color_max").jqxNumberInput('decimal')),
154 st_carb_min: parseFloat($("#st_carb_min").jqxNumberInput('decimal')),
155 st_carb_max: parseFloat($("#st_carb_max").jqxNumberInput('decimal')),
156 st_abv_min: parseFloat($("#st_abv_min").jqxNumberInput('decimal')),
157 st_abv_max: parseFloat($("#st_abv_max").jqxNumberInput('decimal')),
158 type: $("#type").val(),
159 batch_size: 20.0,
160 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')),
161 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')),
162 est_og: parseFloat($("#est_og").jqxNumberInput('decimal')),
163 est_fg: 1.000,
164 est_color: 0,
165 est_abv: 0.0,
166 est_carb: 0.0,
167 color_method: "Morey",
168 est_ibu: 0,
169 ibu_method: "Tinseth",
170 mash_name: "",
171 mash_ph: 5.4,
172 mash_sparge_temp: 78.0
47 }; 173 };
48 var data = "insert=true&return=" + my_return + "&" + $.param(newrow); 174 var data = "insert=true&return=" + my_return + "&" + $.param(newrow);
49 $.ajax({ 175 $.ajax({
50 dataType: 'json', 176 dataType: 'json',
51 url: "includes/db_product.php", 177 url: "includes/db_product.php",

mercurial