1 /***************************************************************************** |
|
2 * Copyright (C) 2019 |
|
3 * |
|
4 * Michiel Broek <mbroek at mbse dot eu> |
|
5 * |
|
6 * This file is part of BMS |
|
7 * |
|
8 * This is free software; you can redistribute it and/or modify it |
|
9 * under the terms of the GNU General Public License as published by the |
|
10 * Free Software Foundation; either version 2, or (at your option) any |
|
11 * later version. |
|
12 * |
|
13 * BrewCloud is distributed in the hope that it will be useful, but |
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 * General Public License for more details. |
|
17 * |
|
18 * You should have received a copy of the GNU General Public License |
|
19 * along with ThermFerm; see the file COPYING. If not, write to the Free |
|
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
|
21 *****************************************************************************/ |
|
22 |
|
23 |
|
24 $(document).ready(function() { |
|
25 |
|
26 var choice = 0; |
|
27 |
|
28 $('#name').html(my_name); |
|
29 $('#code').html(my_code); |
|
30 $('#jqxRadioButton1').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
31 $('#jqxRadioButton2').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
32 $('#jqxRadioButton3').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
33 $('#jqxRadioButton4').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
34 $('#jqxRadioButton5').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
35 $('#jqxRadioButton6').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
36 $('#jqxRadioButton7').jqxRadioButton({ theme: theme, width: 250, height: 23 }); |
|
37 if ((my_split != 0) || (my_stage >= 6)) { |
|
38 $('#jqxRadioButton3').jqxRadioButton({ disabled: true }); |
|
39 document.getElementById('pmpt3').style.color = 'red'; |
|
40 } |
|
41 |
|
42 $('#jqxRadioButton1').on('checked', function(event) { |
|
43 $('#Start').jqxButton({ disabled: false }); |
|
44 choice = 1; |
|
45 }); |
|
46 $('#jqxRadioButton2').on('checked', function(event) { |
|
47 $('#Start').jqxButton({ disabled: false }); |
|
48 choice = 2; |
|
49 }); |
|
50 $('#jqxRadioButton3').on('checked', function(event) { |
|
51 $('#Start').jqxButton({ disabled: false }); |
|
52 choice = 3; |
|
53 }); |
|
54 $('#jqxRadioButton4').on('checked', function(event) { |
|
55 $('#Start').jqxButton({ disabled: false }); |
|
56 choice = 4; |
|
57 }); |
|
58 $('#jqxRadioButton5').on('checked', function(event) { |
|
59 $('#Start').jqxButton({ disabled: false }); |
|
60 choice = 5; |
|
61 }); |
|
62 $('#jqxRadioButton6').on('checked', function(event) { |
|
63 $('#Start').jqxButton({ disabled: false }); |
|
64 choice = 6; |
|
65 }); |
|
66 $('#jqxRadioButton7').on('checked', function(event) { |
|
67 $('#Start').jqxButton({ disabled: false }); |
|
68 choice = 7; |
|
69 }); |
|
70 |
|
71 $('#Start').jqxButton({ template: 'success', width: '100px', theme: theme, disabled: true }); |
|
72 $('#Start').click(function() { |
|
73 if (choice == 1) { |
|
74 window.open('prod_beerxml.php?record=' + my_record); |
|
75 } else if (choice == 2) { |
|
76 window.open('prod_duplicate.php?record=' + my_record); |
|
77 } else if (choice == 3) { |
|
78 window.location.href = 'prod_divide.php?record=' + my_record + '&return=' + my_return; |
|
79 } else if (choice == 4) { |
|
80 window.open('prod_torecipe.php?record=' + my_record); |
|
81 } else if (choice == 5) { |
|
82 window.open('prod_print.php?record=' + my_record); |
|
83 } else if (choice == 6) { |
|
84 window.open('prod_checklist.php?record=' + my_record); |
|
85 } else if (choice == 7) { |
|
86 window.open('prod_forum.php?record=' + my_record); |
|
87 } |
|
88 // Return to the original product |
|
89 if (choice != 3) |
|
90 window.location.href = 'prod_edit.php?record=' + my_record + '&return=' + my_return; |
|
91 }); |
|
92 |
|
93 }); |
|