44 |
44 |
45 |
45 |
46 |
46 |
47 $(document).ready(function () { |
47 $(document).ready(function () { |
48 |
48 |
|
49 var brewstage = 0; // Numeric value of stage |
|
50 |
49 console.log("record:" + my_record + " return:" + my_return + " theme:" + theme); |
51 console.log("record:" + my_record + " return:" + my_return + " theme:" + theme); |
|
52 |
|
53 // Equipemnt dropdown list |
|
54 var equipmentUrl = "includes/db_inventory_equipments.php"; |
|
55 var equipmentSource = { |
|
56 datatype: "json", |
|
57 datafields: [ |
|
58 { name: 'name', type: 'string' }, |
|
59 { name: 'boil_size', type: 'float' }, |
|
60 { name: 'batch_size', type: 'float' }, |
|
61 { name: 'tun_volume', type: 'float' }, |
|
62 { name: 'tun_weight', type: 'float' }, |
|
63 { name: 'trub_chiller_loss', type: 'float' }, |
|
64 { name: 'evap_rate', type: 'float' }, |
|
65 { name: 'boil_time', type: 'float' }, |
|
66 { name: 'lauter_deadspace', type: 'float' }, |
|
67 { name: 'top_up_kettle', type: 'float' }, |
|
68 { name: 'hop_utilization', type: 'float' }, |
|
69 { name: 'notes', type: 'string' }, |
|
70 { name: 'lauter_volume', type: 'float' }, |
|
71 { name: 'kettle_volume', type: 'float' }, |
|
72 { name: 'tun_material', type: 'string' }, |
|
73 { name: 'tun_height', type: 'float' }, |
|
74 { name: 'kettle_height', type: 'float' }, |
|
75 { name: 'lauter_height', type: 'float' }, |
|
76 { name: 'mash_volume', type: 'float' }, |
|
77 { name: 'efficiency', type: 'float' } |
|
78 ], |
|
79 url: equipmentUrl, |
|
80 async: true |
|
81 }; |
|
82 var equipmentlist = new $.jqx.dataAdapter(equipmentSource); |
|
83 $("#equipmentSelect").jqxDropDownList({ |
|
84 placeHolder: "Kies apparatuur:", |
|
85 theme: theme, |
|
86 source: equipmentlist, |
|
87 displayMember: "name", |
|
88 width: 150, |
|
89 height: 27, |
|
90 dropDownWidth: 300, |
|
91 renderer: function (index, label, value) { |
|
92 var datarecord = equipmentlist.records[index]; |
|
93 return datarecord.batch_size + " liter " + datarecord.name; |
|
94 } |
|
95 }); |
|
96 $("#equipmentSelect").on('select', function (event) { |
|
97 if (event.args) { |
|
98 var index = event.args.index; |
|
99 var datarecord = equipmentlist.records[index]; |
|
100 $("#eq_name").val(datarecord.name); |
|
101 $("#eq_boil_size").val(datarecord.boil_size); |
|
102 $("#eq_batch_size").val(datarecord.batch_size); |
|
103 $("#eq_tun_volume").val(datarecord.tun_volume); |
|
104 $("#eq_tun_weight").val(datarecord.tun_weight); |
|
105 $("#eq_trub_chiller_loss").val(datarecord.trub_chiller_loss); |
|
106 $("#eq_evap_rate").val(datarecord.evap_rate); |
|
107 $("#eq_boil_time").val(datarecord.boil_time); |
|
108 $("#eq_lauter_deadspace").val(datarecord.lauter_deadspace); |
|
109 $("#eq_top_up_kettle").val(datarecord.top_up_kettle); |
|
110 $("#eq_hop_utilization").val(datarecord.hop_utilization); |
|
111 $("#eq_notes").val(datarecord.notes); |
|
112 $("#eq_lauter_volume").val(datarecord.lauter_volume); |
|
113 $("#eq_kettle_volume").val(datarecord.kettle_volume); |
|
114 $("#eq_tun_material").val(datarecord.tun_material); |
|
115 $("#eq_tun_height").val(datarecord.tun_height); |
|
116 $("#eq_kettle_height").val(datarecord.kettle_height); |
|
117 $("#eq_lauter_height").val(datarecord.lauter_height); |
|
118 $("#eq_mash_volume").val(datarecord.mash_volume); |
|
119 $("#eq_efficiency").val(datarecord.efficiency); |
|
120 } |
|
121 }); |
50 |
122 |
51 var dataReecord = {}; |
123 var dataReecord = {}; |
52 var url = "includes/db_product.php"; |
124 var url = "includes/db_product.php"; |
53 // tooltips |
125 // tooltips |
54 $("#name").jqxTooltip({ content: 'De naam voor dit product.' }); |
126 $("#name").jqxTooltip({ content: 'De naam voor dit product.' }); |
55 $("#code").jqxTooltip({ content: 'Product code nummer.' }); |
127 $("#code").jqxTooltip({ content: 'Product code nummer.' }); |
56 $("#birth").jqxTooltip({ content: 'De ontwerp datum van dit product.' }); |
128 $("#birth").jqxTooltip({ content: 'De ontwerp datum van dit product.' }); |
57 $("#stage").jqxTooltip({ content: 'De productie fase van dit product.' }); |
129 $("#stage").jqxTooltip({ content: 'De productie fase van dit product.' }); |
58 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit product.' }); |
130 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit product.' }); |
59 $("#eq_name").jqxTooltip({ content: 'The unique name of this brew equipment.' }); |
131 $("#eq_name").jqxTooltip({ content: 'De naam van deze brouw apparatuur.' }); |
60 $("#eq_notes").jqxTooltip({ content: 'Some notes about the equipment.' }); |
132 $("#eq_notes").jqxTooltip({ content: 'Opmerkingen over deze apparatuur.' }); |
61 $("#eq_tun_volume").jqxTooltip({ content: 'Mash TUN volume.' }); |
133 $("#eq_tun_volume").jqxTooltip({ content: 'Maisch ketel volume.' }); |
62 $("#eq_tun_height").jqxTooltip({ content: 'Mash TUN height in cm.' }); |
134 $("#eq_tun_height").jqxTooltip({ content: 'Maisch ketel hoogte in cm.' }); |
63 $("#eq_tun_weight").jqxTooltip({ content: 'Mash TUN weight in Kg.' }); |
135 $("#eq_tun_weight").jqxTooltip({ content: 'Maisch ketel gewicht in Kg.' }); |
64 $("#eq_tun_material").jqxTooltip({ content: 'Mash TUN material. Needed to calculate the right strike temperature.' }); |
136 $("#eq_tun_material").jqxTooltip({ content: 'Maisch ketel materiaal. Nodig om de juiste inmaisch temperatuur te berekenen.' }); |
65 $("#eq_mash_volume").jqxTooltip({ content: 'Mash water for the first step.' }); |
137 $("#eq_mash_volume").jqxTooltip({ content: 'Maisch water voor de eerste stap.' }); |
66 $("#eq_lauter_volume").jqxTooltip({ content: 'Total lauter volume.' }); |
138 $("#eq_lauter_volume").jqxTooltip({ content: 'Filterkuip volume.' }); |
67 $("#eq_lauter_height").jqxTooltip({ content: 'Height of the lauter TUN in cm.' }); |
139 $("#eq_lauter_height").jqxTooltip({ content: 'Hoogte van de filterkuip in cm.' }); |
68 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Volume loss in the lauter TUN.' }); |
140 $("#eq_lauter_deadspace").jqxTooltip({ content: 'Filterkuip verlies in liters.' }); |
69 $("#eq_efficiency").jqxTooltip({ content: 'Average efficiency.' }); |
141 $("#eq_efficiency").jqxTooltip({ content: 'Gemiddeld brouwzaal rendement.' }); |
70 $("#eq_kettle_volume").jqxTooltip({ content: 'Boil kettle volume in liters.' }); |
142 $("#eq_kettle_volume").jqxTooltip({ content: 'Kook ketel volume in liters.' }); |
71 $("#eq_kettle_height").jqxTooltip({ content: 'Boil kettle height in cm.' }); |
143 $("#eq_kettle_height").jqxTooltip({ content: 'Kook ketel hoogte in cm.' }); |
72 $("#eq_boil_size").jqxTooltip({ content: 'Normal boil volume in liters' }); |
144 $("#eq_boil_size").jqxTooltip({ content: 'Normaal kook volume in liters' }); |
73 $("#eq_evap_rate").jqxTooltip({ content: 'Evaporation in liters per hour.' }); |
145 $("#eq_evap_rate").jqxTooltip({ content: 'Verdamping in liters per uur.' }); |
74 $("#eq_boil_time").jqxTooltip({ content: 'Normal boil time in minutes.' }); |
146 $("#eq_boil_time").jqxTooltip({ content: 'Normale kooktijd in minuten..' }); |
75 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water added to the boil.' }); |
147 $("#eq_top_up_kettle").jqxTooltip({ content: 'Extra water toevoegen tijdens de kook.' }); |
76 $("#eq_hop_utilization").jqxTooltip({ content: '100% for smaller installations, higher for large breweries.' }); |
148 $("#eq_hop_utilization").jqxTooltip({ content: '100% voor kleine installaties, hoger voor grote brouwerijen.' }); |
77 $("#eq_batch_size").jqxTooltip({ content: 'Calculated batch size, liters at end of the boil.' }); |
149 $("#eq_batch_size").jqxTooltip({ content: 'Berekende batch grootte in liters aan het eind van de kook.' }); |
78 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standard loss in liters during transfer to the fermenter.' }); |
150 $("#eq_trub_chiller_loss").jqxTooltip({ content: 'Standaard verlies bij het overbrengen naar het gistvat.' }); |
79 |
|
80 |
151 |
81 // Prepare the data |
152 // Prepare the data |
82 var source = { |
153 var source = { |
83 datatype: "json", |
154 datatype: "json", |
84 cache: false, |
155 cache: false, |
143 $("#eq_tun_height").val(dataRecord.eq_tun_height); |
227 $("#eq_tun_height").val(dataRecord.eq_tun_height); |
144 $("#eq_kettle_height").val(dataRecord.eq_kettle_height); |
228 $("#eq_kettle_height").val(dataRecord.eq_kettle_height); |
145 $("#eq_lauter_height").val(dataRecord.eq_lauter_height); |
229 $("#eq_lauter_height").val(dataRecord.eq_lauter_height); |
146 $("#eq_mash_volume").val(dataRecord.eq_mash_volume); |
230 $("#eq_mash_volume").val(dataRecord.eq_mash_volume); |
147 $("#eq_efficiency").val(dataRecord.eq_efficiency); |
231 $("#eq_efficiency").val(dataRecord.eq_efficiency); |
148 |
232 $("#brew_date_start").val(dataRecord.brew_date_start); |
149 if (dataRecord.stage != "Plan") { |
233 $("#brew_mash_ph").val(dataRecord.brew_mash_ph); |
150 // Only allow Delete when in Plan stage. |
234 $("#brew_mash_sg").val(dataRecord.brew_mash_sg); |
|
235 |
|
236 $("#brew_date_end").val(dataRecord.brew_date_end); |
|
237 |
|
238 switch (dataRecord.stage) { |
|
239 case 'Plan': brewstage = 0; break; |
|
240 case 'Wait': brewstage = 1; break; |
|
241 case 'Brew': brewstage = 2; break; |
|
242 case 'Primary': brewstage = 3; break; |
|
243 case 'Secondary': brewstage = 4; break; |
|
244 case 'Tertiary': brewstage = 5; break; |
|
245 case 'Package': brewstage = 6; break; |
|
246 case 'Carbonation': brewstage = 7; break; |
|
247 case 'Mature': brewstage = 8; break; |
|
248 case 'Taste': brewstage = 9; break; |
|
249 case 'Ready': brewstage = 10; |
|
250 $("#locked").jqxCheckBox({ disabled:false }); |
|
251 break; |
|
252 case 'Closed': brewstage = 11; |
|
253 $("#locked").jqxCheckBox({ disabled:false }); |
|
254 break; |
|
255 } |
|
256 // Enable or Disable settings depending on the stage. |
|
257 if (brewstage > 1) |
|
258 $("#equipmentSelect").jqxDropDownList({ disabled: true }); |
|
259 if (brewstage > 0) { |
151 $("#Delete").jqxButton({ disabled: true }); |
260 $("#Delete").jqxButton({ disabled: true }); |
|
261 $("#birth").jqxDateTimeInput({ disabled: true }); |
152 } |
262 } |
|
263 if (brewstage < 3) { |
|
264 $("#brew_log").jqxButton({ disabled: true }); |
|
265 $("#ferment_log").jqxButton({ disabled: true }); |
|
266 } else { |
|
267 if (! dataRecord.log_brew) |
|
268 $("#brew_log").jqxButton({ disabled: true }); |
|
269 if (! dataRecord.log_fermentation) |
|
270 $("#ferment_log").jqxButton({ disabled: true }); |
|
271 } |
|
272 if (brewstage < 6) |
|
273 $("#inventory_reduced").jqxCheckBox({ disabled : true }); |
|
274 else if ($('#inventory_reduced').jqxCheckBox('checked')) |
|
275 $("#inventory_reduced").jqxCheckBox({ disabled : true }); |
153 }, |
276 }, |
154 loadError: function (jqXHR, status, error) { |
277 loadError: function (jqXHR, status, error) { |
155 }, |
278 }, |
156 beforeLoadComplete: function (records) { |
279 beforeLoadComplete: function (records) { |
157 var filteredRecords = []; |
280 var filteredRecords = []; |
170 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
293 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
171 $("#code").jqxInput({ theme: theme, width: 100, height: 23 }); |
294 $("#code").jqxInput({ theme: theme, width: 100, height: 23 }); |
172 $("#birth").jqxDateTimeInput({ theme: theme, width: 150, height: 23, formatString: 'yyyy-MM-dd' }); |
295 $("#birth").jqxDateTimeInput({ theme: theme, width: 150, height: 23, formatString: 'yyyy-MM-dd' }); |
173 $("#stage").jqxInput({ theme: theme, width: 100, height: 23 }); |
296 $("#stage").jqxInput({ theme: theme, width: 100, height: 23 }); |
174 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
297 $("#notes").jqxInput({ theme: theme, width: 960, height: 200 }); |
|
298 $("#log_brew").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true }); |
|
299 $("#log_fermentation").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true }); |
|
300 $("#inventory_reduced").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
|
301 $('#inventory_reduced').on('checked', function (event) { |
|
302 // Call a script to do the work and block this. |
|
303 // Note that this script must set this flag too, so of the user doesn't Save it is still set. |
|
304 // Call the script with the uuid. |
|
305 $("#inventory_reduced").jqxCheckBox({ disabled : true }); |
|
306 }); |
|
307 $("#locked").jqxCheckBox({ theme: theme, width: 120, height: 23, disabled : true }); |
|
308 $('#locked').on('checked', function (event) { |
|
309 $("#stage").val('Closed'); |
|
310 brewstage = 11; |
|
311 }); |
|
312 $('#locked').on('unchecked', function (event) { |
|
313 $("#stage").val('Ready'); |
|
314 brewstage = 10; |
|
315 }); |
175 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
316 $("#eq_name").jqxInput({ theme: theme, width: 250, height: 23 }); |
176 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
317 $("#eq_boil_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
177 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: 'true', theme: theme, width: 50, height: 23, min: 0, decimalDigits: 1 }); |
318 $("#eq_batch_size").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
178 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
319 $("#eq_tun_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
179 $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true }); |
320 $("#eq_tun_weight").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2 }); |
180 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
321 $("#eq_trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
181 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 }); |
322 $("#eq_evap_rate").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 2, }); |
182 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 0, spinButtons: true }); |
323 $("#eq_boil_time").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 }); |
183 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
324 $("#eq_lauter_deadspace").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
184 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
325 $("#eq_top_up_kettle").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
185 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 0, spinButtons: true }); |
326 $("#eq_hop_utilization").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 0 }); |
186 $("#eq_notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
327 $("#eq_notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
187 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
328 $("#eq_lauter_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
188 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
329 $("#eq_kettle_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
189 $("#eq_tun_material").jqxDropDownList({ theme: theme, source: srcMaterial, selectedIndex: 0, width: 110, height: 23, dropDownHeight: 130 }); |
330 $("#eq_tun_material").jqxInput({ theme: theme, width: 100, height: 23 }); |
190 $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
331 $("#eq_tun_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
191 $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
332 $("#eq_kettle_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
192 $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
333 $("#eq_lauter_height").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
193 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
334 $("#eq_mash_volume").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
194 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
335 $("#eq_efficiency").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 1 }); |
|
336 |
|
337 $("#brew_date_start").jqxDateTimeInput({ theme: theme, width: 230, height: 23, formatString: 'yyyy-MM-dd HH:mm:ss', showTimeButton: true }); |
|
338 $("#brew_mash_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
|
339 $("#brew_mash_sg").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 3, spinButtons: true, spinButtonsStep: 0.001 }); |
|
340 |
|
341 $("#brew_date_end").jqxDateTimeInput({ theme: theme, width: 230, height: 23, formatString: 'yyyy-MM-dd HH:mm:ss', showTimeButton: true }); |
195 |
342 |
196 $('#jqxTabs').jqxTabs({ |
343 $('#jqxTabs').jqxTabs({ |
197 theme: theme, |
344 theme: theme, |
198 width: 1280, |
345 width: 1280, |
199 height: 630, |
346 height: 630, |
200 autoHeight: false, |
347 autoHeight: false, |
201 position: 'top' |
348 position: 'top' |
202 }); |
349 }); |
203 |
350 |
204 // Buttons sidebar |
351 // Buttons sidebar |
205 $("#rec_edit").jqxButton({ template: "primary", width: '110px', theme: theme }); |
352 $("#rec_edit").jqxButton({ template: "primary", width: '140px', theme: theme }); |
|
353 $("#brew_log").jqxButton({ template: "primary", width: '140px', theme: theme }); |
|
354 $("#ferment_log").jqxButton({ template: "primary", width: '140px', theme: theme }); |
206 |
355 |
207 // Buttons below |
356 // Buttons below |
208 $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); |
357 $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); |
209 $("#Delete").click(function () { |
358 $("#Delete").click(function () { |
210 // Open a popup to confirm this action. |
359 // Open a popup to confirm this action. |
230 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme }); |
379 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme }); |
231 $("#Cancel").click(function () { |
380 $("#Cancel").click(function () { |
232 window.location.href = my_return; |
381 window.location.href = my_return; |
233 }); |
382 }); |
234 |
383 |
|
384 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
|
385 $("#Save").click(function () { |
|
386 var row = { |
|
387 record: my_record, |
|
388 uuid: $("#uuid").val(), |
|
389 name: $("#name").val(), |
|
390 code: $("#code").val(), |
|
391 birth: $("#birth").val(), |
|
392 stage: $("#stage").val(), |
|
393 notes: $("#notes").val(), |
|
394 log_brew: $("#log_brew").val(), |
|
395 log_fermentation: $("#log_fermentation").val(), |
|
396 inventory_reduced: $("#inventory_reduced").val(), |
|
397 locked: $("#locked").val(), |
|
398 eq_name: $("#eq_name").val(), |
|
399 eq_boil_size: parseFloat($("#eq_boil_size").jqxNumberInput('decimal')), |
|
400 eq_batch_size: parseFloat($("#eq_batch_size").jqxNumberInput('decimal')), |
|
401 eq_tun_volume: parseFloat($("#eq_tun_volume").jqxNumberInput('decimal')), |
|
402 eq_tun_weight: parseFloat($("#eq_tun_weight").jqxNumberInput('decimal')), |
|
403 eq_trub_chiller_loss: parseFloat($("#eq_trub_chiller_loss").jqxNumberInput('decimal')), |
|
404 eq_evap_rate: parseFloat($("#eq_evap_rate").jqxNumberInput('decimal')), |
|
405 eq_boil_time: parseFloat($("#eq_boil_time").jqxNumberInput('decimal')), |
|
406 eq_lauter_deadspace: parseFloat($("#eq_lauter_deadspace").jqxNumberInput('decimal')), |
|
407 eq_top_up_kettle: parseFloat($("#eq_top_up_kettle").jqxNumberInput('decimal')), |
|
408 eq_hop_utilization: parseFloat($("#eq_hop_utilization").jqxNumberInput('decimal')), |
|
409 eq_notes: $("#eq_notes").val(), |
|
410 eq_lauter_volume: parseFloat($("#eq_lauter_volume").jqxNumberInput('decimal')), |
|
411 eq_kettle_volume: parseFloat($("#eq_kettle_volume").jqxNumberInput('decimal')), |
|
412 eq_tun_material: $("#eq_tun_material").val(), |
|
413 eq_tun_height: parseFloat($("#eq_tun_height").jqxNumberInput('decimal')), |
|
414 eq_kettle_height: parseFloat($("#eq_kettle_height").jqxNumberInput('decimal')), |
|
415 eq_lauter_height: parseFloat($("#eq_lauter_height").jqxNumberInput('decimal')), |
|
416 eq_mash_volume: parseFloat($("#eq_mash_volume").jqxNumberInput('decimal')), |
|
417 eq_efficiency: parseFloat($("#eq_efficiency").jqxNumberInput('decimal')) |
|
418 }; |
|
419 var data = "update=true&" + $.param(row); |
|
420 $.ajax({ |
|
421 dataType: 'json', |
|
422 url: url, |
|
423 cache: false, |
|
424 data: data, |
|
425 type: "POST", |
|
426 success: function (data, status, xhr) { |
|
427 // update command is executed. |
|
428 window.location.href = my_return; |
|
429 }, |
|
430 error: function(jqXHR, textStatus, errorThrown) { |
|
431 } |
|
432 }); |
|
433 }); |
235 createDelElements(); |
434 createDelElements(); |
236 }); |
435 }); |
237 |
436 |