Mon, 25 Feb 2019 22:49:22 +0100
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
11 | 1 | /***************************************************************************** |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
11 | 3 | * |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BrewCloud | |
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 | function createDelElements() { | |
25 | $('#eventWindow').jqxWindow({ | |
26 | theme: theme, | |
27 | position: { x: 490, y: 210 }, | |
28 | width: 300, | |
34 | 29 | height: 175, |
11 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
51 | 36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); | |
11 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
46 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
47 | var dataRecord = {}; |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
48 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
49 | function calcTotal(cost, inventory) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
50 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
51 | $('#totval').val(cost * inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
52 | } |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
53 | |
11 | 54 | var url = "includes/db_inventory_fermentables.php"; |
55 | // prepare the data | |
56 | var source = { | |
57 | datatype: "json", | |
58 | cache: false, | |
59 | datafields: [ | |
60 | { name: 'record', type: 'number' }, | |
61 | { name: 'name', type: 'string' }, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
62 | { name: 'type', type: 'int' }, |
11 | 63 | { name: 'yield', type: 'float' }, |
64 | { name: 'color', type: 'float' }, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
65 | { name: 'add_after_boil', type: 'int' }, |
11 | 66 | { name: 'origin', type: 'string' }, |
67 | { name: 'supplier', type: 'string' }, | |
68 | { name: 'notes', type: 'string' }, | |
69 | { name: 'coarse_fine_diff', type: 'float' }, | |
70 | { name: 'moisture', type: 'float' }, | |
71 | { name: 'diastatic_power', type: 'float' }, | |
72 | { name: 'protein', type: 'float' }, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
73 | { name: 'dissolved_protein', type: 'float' }, |
11 | 74 | { name: 'max_in_batch', type: 'float' }, |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
75 | { name: 'recommend_mash', type: 'int' }, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
76 | { name: 'added', type: 'int' }, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
77 | { name: 'always_on_stock', type: 'int' }, |
11 | 78 | { name: 'di_ph', type: 'float' }, |
79 | { name: 'acid_to_ph_57', type: 'float' }, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
80 | { name: 'graintype', type: 'int' }, |
11 | 81 | { name: 'inventory', type: 'float' }, |
82 | { name: 'cost', type: 'float' }, | |
83 | { name: 'production_date', type: 'string' }, | |
18
395833e20f88
Better error messages in syslog
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
84 | { name: 'tht_date', type: 'string' } |
11 | 85 | ], |
86 | id: 'record', | |
87 | url: url, | |
88 | deleterow: function (rowid, commit) { | |
89 | // synchronize with the server - send delete command | |
90 | var data = "delete=true&" + $.param({ record: rowid }); | |
91 | $.ajax({ | |
92 | dataType: 'json', | |
93 | url: url, | |
94 | cache: false, | |
95 | data: data, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
96 | type: "POST", |
11 | 97 | success: function (data, status, xhr) { |
98 | // delete command is executed. | |
99 | commit(true); | |
100 | }, | |
101 | error: function (jqXHR, textStatus, errorThrown) { | |
102 | commit(false); | |
103 | } | |
104 | }); | |
105 | }, | |
106 | addrow: function (rowid, rowdata, position, commit) { | |
107 | var data = "insert=true&" + $.param(rowdata); | |
108 | $.ajax({ | |
109 | dataType: 'json', | |
110 | url: url, | |
111 | cache: false, | |
112 | data: data, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
113 | type: "POST", |
11 | 114 | success: function (data, status, xhr) { |
115 | commit(true); | |
116 | }, | |
117 | error: function(jqXHR, textStatus, errorThrown) { | |
118 | commit(false); | |
119 | } | |
120 | }); | |
121 | }, | |
122 | updaterow: function (rowid, rowdata, commit) { | |
123 | var data = "update=true&" + $.param(rowdata); | |
124 | $.ajax({ | |
125 | dataType: 'json', | |
126 | url: url, | |
127 | cache: false, | |
128 | data: data, | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
129 | type: "POST", |
11 | 130 | success: function (data, status, xhr) { |
131 | // update command is executed. | |
132 | commit(true); | |
133 | }, | |
134 | error: function(jqXHR, textStatus, errorThrown) { | |
135 | commit(false); | |
136 | } | |
137 | }); | |
138 | } | |
139 | }; | |
140 | // initialize the input fields. | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
141 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
142 | $("#type").jqxDropDownList({ |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
143 | theme: theme, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
144 | source: FermentableTypeAdapter, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
145 | valueMember: 'id', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
146 | displayMember: 'nl', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
147 | width: 180, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
148 | height: 23, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
149 | autoDropDownHeight: true |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
150 | }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
151 | $("#yield").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
152 | $("#color").jqxNumberInput( Spin1dec ); |
11 | 153 | $("#add_after_boil").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
154 | $("#origin").jqxInput({ theme: theme, width: 250, height: 23 }); | |
155 | $("#supplier").jqxInput({ theme: theme, width: 250, height: 23 }); | |
18
395833e20f88
Better error messages in syslog
Michiel Broek <mbroek@mbse.eu>
parents:
11
diff
changeset
|
156 | $("#notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
157 | $("#coarse_fine_diff").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
158 | $("#moisture").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
159 | $("#diastatic_power").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
160 | $("#protein").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
161 | $("#dissolved_protein").jqxNumberInput( Spin1dec ); |
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
162 | $("#max_in_batch").jqxNumberInput( Perc1dec ); |
11 | 163 | $("#recommend_mash").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
164 | $("#added").jqxDropDownList({ |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
165 | theme: theme, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
166 | source: AddedAdapter, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
167 | valueMember: 'id', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
168 | displayMember: 'nl', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
169 | width: 180, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
170 | height: 23, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
171 | autoDropDownHeight: true |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
172 | }); |
11 | 173 | $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
174 | $("#di_ph").jqxNumberInput( Spin2pH ); |
269 | 175 | $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 4, spinButtons: true }); |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
176 | $("#graintype").jqxDropDownList({ |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
177 | theme: theme, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
178 | source: GrainTypeAdapter, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
179 | valueMember: 'id', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
180 | displayMember: 'nl', |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
181 | width: 180, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
182 | height: 23, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
183 | autoDropDownHeight: true |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
184 | }); |
274
65ca75fc4af8
Added prod_reduce.php to the Makefile. Inventory fermentables uses 3 decimals in stead of 1.
Michiel Broek <mbroek@mbse.eu>
parents:
269
diff
changeset
|
185 | $("#inventory").jqxNumberInput( Spin3dec ); |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
186 | $("#production_date").jqxDateTimeInput( Dateopts ); |
245
3649c3d31d15
Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents:
202
diff
changeset
|
187 | $("#cost").jqxNumberInput( Spin2dec ); |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
188 | $("#tht_date").jqxDateTimeInput( Dateopts ); |
269 | 189 | $("#totval").jqxNumberInput( Show2dec ); |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
190 | |
11 | 191 | var dataAdapter = new $.jqx.dataAdapter(source); |
192 | var editrow = -1; | |
193 | // initialize jqxGrid | |
194 | $("#jqxgrid").jqxGrid({ | |
195 | width: 1280, | |
196 | height: 630, | |
197 | source: dataAdapter, | |
198 | theme: theme, | |
199 | showstatusbar: true, | |
200 | renderstatusbar: function (statusbar) { | |
201 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 202 | var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>"); |
11 | 203 | container.append(addButton); |
204 | statusbar.append(container); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
205 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
11 | 206 | // add new row. |
207 | addButton.click(function (event) { | |
208 | editrow = -1; | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
209 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
210 | $("#name").val('Nieuw product'); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
211 | $("#type").val(0); |
11 | 212 | $("#origin").val(''); |
213 | $("#supplier").val(''); | |
214 | $("#notes").val(''); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
215 | $("#yield").val(80); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
216 | $("#color").val(3); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
217 | $("#coarse_fine_diff").val(3); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
218 | $("#moisture").val(4); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
219 | $("#diastatic_power").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
220 | $("#protein").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
221 | $("#dissolved_protein").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
222 | $("#max_in_batch").val(100); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
223 | $("#recommend_mash").val(1); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
224 | $("#always_on_stock").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
225 | $("#di_ph").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
226 | $("#acid_to_ph_57").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
227 | $("#graintype").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
228 | $("#add_after_boil").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
229 | $("#added").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
230 | $("#inventory").val(0); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
231 | $("#cost").val(0); |
11 | 232 | $("#production_date").val(''); |
233 | $("#tht_date").val(''); | |
234 | $("#popupWindow").jqxWindow('open'); | |
235 | }); | |
236 | }, | |
237 | filterable: true, | |
238 | filtermode: 'excel', | |
239 | columns: [ | |
202
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
240 | { text: 'Herkomst', datafield: 'origin', width: 150 }, |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
241 | { text: 'Producent', datafield: 'supplier', width: 140 }, |
202
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
242 | { text: 'Vergistbaar product', datafield: 'name', menu: false }, |
269 | 243 | { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type', |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
244 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
245 | return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + FermentableTypeData[value].nl + "</span>"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
246 | } |
197
63174cff2cc1
Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
247 | }, |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
248 | { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
249 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
250 | return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + GrainTypeData[value].nl + "</span>"; |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
251 | } |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
252 | }, |
202
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
253 | { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' }, |
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
254 | { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' }, |
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
255 | { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, |
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
256 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
257 | var amount = ""; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
258 | if (value > 0) { |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
259 | if (value < 1) |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
260 | amount = value * 1000+" gr"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
261 | else |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
262 | amount = dataAdapter.formatNumber(value,"f1")+" kg"; |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
263 | } |
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
264 | return "<span style='margin: 3px; margin-top: 6px; float: right;'>" + amount + "</span>"; |
202
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
265 | } |
64a9c935a66b
Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
266 | }, |
286
124af734af68
Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents:
274
diff
changeset
|
267 | { text: '', datafield: 'Edit', width: 100, align: 'center', menu: false, columntype: 'button', cellsrenderer: function () { |
34 | 268 | return "Wijzig"; |
11 | 269 | }, buttonclick: function (row) { |
270 | // open the popup window when the user clicks a button. | |
271 | editrow = row; | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
272 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
11 | 273 | // get the clicked row's data and initialize the input fields. |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
274 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
11 | 275 | $("#name").val(dataRecord.name); |
276 | $("#type").val(dataRecord.type); | |
277 | $("#yield").val(dataRecord.yield); | |
278 | $("#color").val(dataRecord.color); | |
279 | $("#add_after_boil").val(dataRecord.add_after_boil); | |
280 | $("#origin").val(dataRecord.origin); | |
281 | $("#supplier").val(dataRecord.supplier); | |
282 | $("#notes").val(dataRecord.notes); | |
283 | $("#coarse_fine_diff").val(dataRecord.coarse_fine_diff); | |
284 | $("#moisture").val(dataRecord.moisture); | |
285 | $("#diastatic_power").val(dataRecord.diastatic_power); | |
286 | $("#protein").val(dataRecord.protein); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
287 | $("#dissolved_protein").val(dataRecord.dissolved_protein); |
11 | 288 | $("#max_in_batch").val(dataRecord.max_in_batch); |
289 | $("#recommend_mash").val(dataRecord.recommend_mash); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
290 | $("#added").val(dataRecord.added); |
11 | 291 | $("#always_on_stock").val(dataRecord.always_on_stock); |
292 | $("#di_ph").val(dataRecord.di_ph); | |
293 | $("#acid_to_ph_57").val(dataRecord.acid_to_ph_57); | |
294 | $("#graintype").val(dataRecord.graintype); | |
295 | $("#inventory").val(dataRecord.inventory); | |
296 | $("#cost").val(dataRecord.cost); | |
297 | $("#production_date").val(dataRecord.production_date); | |
298 | $("#tht_date").val(dataRecord.tht_date); | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
299 | calcTotal(dataRecord.cost, dataRecord.inventory); |
11 | 300 | // show the popup window. |
301 | $("#popupWindow").jqxWindow('open'); | |
302 | } | |
303 | } | |
304 | ] | |
305 | }); | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
306 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
307 | $("#cost").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
308 | dataRecord.cost = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
309 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
310 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
311 | $("#inventory").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
312 | dataRecord.inventory = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
313 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
314 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
197
diff
changeset
|
315 | |
11 | 316 | // initialize the popup window and buttons. |
317 | $("#popupWindow").jqxWindow({ | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
318 | width: 1050, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
319 | height: 550, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
320 | resizable: false, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
321 | theme: theme, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
322 | isModal: true, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
323 | autoOpen: false, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
324 | cancelButton: $("#Cancel"), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
325 | modalOpacity: 0.40 |
11 | 326 | }); |
327 | $("#popupWindow").on('open', function () { | |
328 | $("#name").jqxInput('selectAll'); | |
329 | }); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
330 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
11 | 331 | $("#Delete").click(function () { |
332 | if (editrow >= 0) { | |
333 | // Open a popup to confirm this action. | |
334 | $('#eventWindow').jqxWindow('open'); | |
335 | $("#delOk").click(function () { | |
336 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
337 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
338 | }); | |
339 | } | |
340 | $("#popupWindow").jqxWindow('hide'); | |
341 | }); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
342 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
343 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
11 | 344 | // update the edited row when the user clicks the 'Save' button. |
345 | $("#Save").click(function () { | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
346 | var rowID = -1; |
11 | 347 | if (editrow >= 0) { |
348 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
349 | } |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
350 | var row = { |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
351 | record: rowID, |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
352 | name: $("#name").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
353 | type: $("#type").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
354 | yield: parseFloat($("#yield").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
355 | color: parseFloat($("#color").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
356 | add_after_boil: $("#add_after_boil").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
357 | origin: $("#origin").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
358 | supplier: $("#supplier").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
359 | notes: $("#notes").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
360 | coarse_fine_diff: parseFloat($("#coarse_fine_diff").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
361 | moisture: parseFloat($("#moisture").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
362 | diastatic_power: parseFloat($("#diastatic_power").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
363 | protein: parseFloat($("#protein").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
364 | dissolved_protein: parseFloat($("#dissolved_protein").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
365 | max_in_batch: parseFloat($("#max_in_batch").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
366 | recommend_mash: $("#recommend_mash").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
367 | added: $("#added").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
368 | always_on_stock: $("#always_on_stock").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
369 | di_ph: parseFloat($("#di_ph").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
370 | acid_to_ph_57: parseFloat($("#acid_to_ph_57").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
371 | graintype: $("#graintype").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
372 | inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
373 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
374 | production_date: $("#production_date").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
375 | tht_date: $("#tht_date").val(), |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
376 | }; |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
377 | if (editrow >= 0) { |
11 | 378 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
379 | } else { | |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
380 | $('#jqxgrid').jqxGrid('addrow', null, row); |
11 | 381 | } |
195
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
382 | $("#popupWindow").jqxWindow('hide'); |
2ac491548d8d
Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
51
diff
changeset
|
383 | location.reload( true ); // reload ourself. |
11 | 384 | }); |
385 | createDelElements(); | |
386 | }); | |
387 |