Thu, 24 Jan 2019 20:54:45 +0100
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
14 | 1 | /***************************************************************************** |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
14 | 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, |
14 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
14 | 38 | $('#delCancel').focus(); |
39 | } | |
40 | }); | |
41 | $('#eventWindow').jqxWindow('hide'); | |
42 | } | |
43 | ||
44 | ||
45 | $(document).ready(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
46 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
47 | var dataRecord = {}; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
48 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
49 | function calcTotal(cost, inventory) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
50 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
51 | $('#totval').val(cost * (inventory / 1000)); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
52 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
53 | |
14 | 54 | var url = "includes/db_inventory_yeasts.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' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
62 | { name: 'type', type: 'int' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
63 | { name: 'form', type: 'int' }, |
14 | 64 | { name: 'laboratory', type: 'string' }, |
65 | { name: 'product_id', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
66 | { name: 'min_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
67 | { name: 'max_temperature', type: 'float' }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
68 | { name: 'flocculation', type: 'int' }, |
14 | 69 | { name: 'attenuation', type: 'float' }, |
70 | { name: 'notes', type: 'string' }, | |
71 | { name: 'best_for', type: 'string' }, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
72 | { name: 'max_reuse', type: 'int' }, |
14 | 73 | { name: 'inventory', type: 'float' }, |
74 | { name: 'cost', type: 'float' }, | |
75 | { name: 'production_date', type: 'string' }, | |
200
7b2f11652d67
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
76 | { name: 'tht_date', type: 'string' }, |
7b2f11652d67
Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
77 | { name: 'cells', type: 'float' } |
14 | 78 | ], |
79 | id: 'record', | |
80 | url: url, | |
81 | deleterow: function (rowid, commit) { | |
82 | // synchronize with the server - send delete command | |
83 | var data = "delete=true&" + $.param({ record: rowid }); | |
84 | $.ajax({ | |
85 | dataType: 'json', | |
86 | url: url, | |
87 | cache: false, | |
88 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
89 | type: "POST", |
14 | 90 | success: function (data, status, xhr) { |
91 | // delete command is executed. | |
92 | commit(true); | |
93 | }, | |
94 | error: function (jqXHR, textStatus, errorThrown) { | |
95 | commit(false); | |
96 | } | |
97 | }); | |
98 | }, | |
99 | addrow: function (rowid, rowdata, position, commit) { | |
100 | var data = "insert=true&" + $.param(rowdata); | |
101 | $.ajax({ | |
102 | dataType: 'json', | |
103 | url: url, | |
104 | cache: false, | |
105 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
106 | type: "POST", |
14 | 107 | success: function (data, status, xhr) { |
108 | commit(true); | |
109 | }, | |
110 | error: function(jqXHR, textStatus, errorThrown) { | |
111 | commit(false); | |
112 | } | |
113 | }); | |
114 | }, | |
115 | updaterow: function (rowid, rowdata, commit) { | |
116 | var data = "update=true&" + $.param(rowdata); | |
117 | $.ajax({ | |
118 | dataType: 'json', | |
119 | url: url, | |
120 | cache: false, | |
121 | data: data, | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
122 | type: "POST", |
14 | 123 | success: function (data, status, xhr) { |
124 | // update command is executed. | |
125 | commit(true); | |
126 | }, | |
127 | error: function(jqXHR, textStatus, errorThrown) { | |
128 | commit(false); | |
129 | } | |
130 | }); | |
131 | } | |
132 | }; | |
133 | // initialize the input fields. | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
134 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
135 | $("#laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
136 | $("#product_id").jqxInput({ theme: theme, width: 320, height: 23 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
137 | $("#type").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
138 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
139 | source: YeastTypeAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
140 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
141 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
142 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
143 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
144 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
145 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
146 | $("#form").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
147 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
148 | source: YeastFormAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
149 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
150 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
151 | selectedIndex: 0, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
152 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
153 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
154 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
155 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
156 | $("#notes").jqxInput({ theme: theme, width: 800, height: 120 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
157 | $("#best_for").jqxInput({ theme: theme, width: 320, height: 50 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
158 | $("#inventory").jqxNumberInput( Spin1dec1 ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
159 | $("#production_date").jqxDateTimeInput( Dateopts ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
160 | $("#min_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
161 | $("#max_temperature").jqxNumberInput( YeastT ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
162 | $("#flocculation").jqxDropDownList({ |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
163 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
164 | source: FlocculationAdapter, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
165 | valueMember: 'id', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
166 | displayMember: 'nl', |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
167 | width: 180, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
168 | height: 23, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
169 | autoDropDownHeight: true |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
170 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
171 | $("#attenuation").jqxNumberInput( Perc1dec1 ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
172 | $("#max_reuse").jqxNumberInput( PosInt ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
173 | $("#max_reuse").jqxNumberInput({ max: 10 }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
174 | $("#cost").jqxNumberInput( Spin2dec1 ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
175 | $("#tht_date").jqxDateTimeInput( Dateopts ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
176 | $("#totval").jqxNumberInput( Spin2dec1 ); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
177 | $("#totval").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
14 | 178 | |
179 | var dataAdapter = new $.jqx.dataAdapter(source); | |
180 | var editrow = -1; | |
181 | // initialize jqxGrid | |
182 | $("#jqxgrid").jqxGrid({ | |
183 | width: 1280, | |
184 | height: 630, | |
185 | source: dataAdapter, | |
186 | theme: theme, | |
187 | showstatusbar: true, | |
188 | localization: getLocalization(), | |
189 | renderstatusbar: function (statusbar) { | |
190 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 191 | 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>"); |
14 | 192 | container.append(addButton); |
193 | statusbar.append(container); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
194 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
14 | 195 | // add new row. |
196 | addButton.click(function (event) { | |
197 | editrow = -1; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
198 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 199 | $("#name").val(''); |
200 | $("#laboratory").val(''); | |
201 | $("#product_id").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
202 | $("#type").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
203 | $("#form").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
204 | $("#min_temperature").val(18); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
205 | $("#max_temperature").val(22); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
206 | $("#flocculation").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
207 | $("#attenuation").val(77); |
14 | 208 | $("#notes").val(''); |
209 | $("#best_for").val(''); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
210 | $("#max_reuse").val(10); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
211 | $("#inventory").val(0); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
212 | $("#cost").val(0); |
14 | 213 | $("#production_date").val(''); |
214 | $("#tht_date").val(''); | |
215 | $("#popupWindow").jqxWindow('open'); | |
216 | }); | |
217 | }, | |
218 | filterable: true, | |
219 | filtermode: 'excel', | |
220 | columns: [ | |
221 | { text: 'Laboratorium', datafield: 'laboratory', width: 150 }, | |
222 | { text: 'Product ID', datafield: 'product_id', width: 120 }, | |
37
9362eb9e9e5b
Sorting the inventory and changes some grid tables.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
223 | { text: 'Gist naam', datafield: 'name' }, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
224 | { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 90, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
225 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
226 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastTypeData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
227 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
228 | }, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
229 | { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 90, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
230 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
231 | return "<div style='margin: 4px;' class='jqx-center-align'>" + YeastFormData[value].nl + "</div>"; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
232 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
233 | }, |
33
2ee6ad5d6f14
More weight/volmes standards in the database.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
234 | { text: 'Vergistingsgraad', datafield: 'attenuation', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'p0' }, |
2ee6ad5d6f14
More weight/volmes standards in the database.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
235 | { text: 'Voor. gr/ml', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
2ee6ad5d6f14
More weight/volmes standards in the database.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
236 | { text: 'Prijs kg/l', datafield: 'cost', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
237 | { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { |
34 | 238 | return "Wijzig"; |
14 | 239 | }, buttonclick: function (row) { |
240 | // open the popup window when the user clicks a button. | |
241 | editrow = row; | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
242 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
14 | 243 | // get the clicked row's data and initialize the input fields. |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
244 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
14 | 245 | $("#name").val(dataRecord.name); |
246 | $("#laboratory").val(dataRecord.laboratory); | |
247 | $("#product_id").val(dataRecord.product_id); | |
248 | $("#type").val(dataRecord.type); | |
249 | $("#form").val(dataRecord.form); | |
250 | $("#min_temperature").val(dataRecord.min_temperature); | |
251 | $("#max_temperature").val(dataRecord.max_temperature); | |
252 | $("#flocculation").val(dataRecord.flocculation); | |
253 | $("#attenuation").val(dataRecord.attenuation); | |
254 | $("#notes").val(dataRecord.notes); | |
255 | $("#best_for").val(dataRecord.best_for); | |
256 | $("#max_reuse").val(dataRecord.max_reuse); | |
257 | $("#inventory").val(dataRecord.inventory); | |
258 | $("#cost").val(dataRecord.cost); | |
259 | $("#production_date").val(dataRecord.production_date); | |
260 | $("#tht_date").val(dataRecord.tht_date); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
261 | calcTotal(dataRecord.cost, dataRecord.inventory); |
14 | 262 | // show the popup window. |
263 | $("#popupWindow").jqxWindow('open'); | |
264 | } | |
265 | } | |
266 | ] | |
267 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
268 | |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
269 | $("#cost").on('change', function (event) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
270 | dataRecord.cost = parseFloat(event.args.value); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
271 | calcTotal(dataRecord.cost, dataRecord.inventory); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
272 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
273 | $("#inventory").on('change', function (event) { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
274 | dataRecord.inventory = parseFloat(event.args.value); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
275 | calcTotal(dataRecord.cost, dataRecord.inventory); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
276 | }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
277 | |
14 | 278 | // initialize the popup window and buttons. |
279 | $("#popupWindow").jqxWindow({ | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
280 | width: 1050, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
281 | height: 550, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
282 | resizable: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
283 | theme: theme, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
284 | isModal: true, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
285 | autoOpen: false, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
286 | cancelButton: $("#Cancel"), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
287 | modalOpacity: 0.40 |
14 | 288 | }); |
289 | $("#popupWindow").on('open', function () { | |
290 | $("#name").jqxInput('selectAll'); | |
291 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
292 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
14 | 293 | $("#Delete").click(function () { |
294 | if (editrow >= 0) { | |
295 | // Open a popup to confirm this action. | |
296 | $('#eventWindow').jqxWindow('open'); | |
297 | $("#delOk").click(function () { | |
298 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
299 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
300 | }); | |
301 | } | |
302 | $("#popupWindow").jqxWindow('hide'); | |
303 | }); | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
304 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
305 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
14 | 306 | // update the edited row when the user clicks the 'Save' button. |
307 | $("#Save").click(function () { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
308 | var rowID = -1; |
14 | 309 | if (editrow >= 0) { |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
310 | rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
311 | } |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
312 | var row = { |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
313 | record: rowID, |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
314 | name: $("#name").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
315 | type: $("#type").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
316 | form: $("#form").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
317 | laboratory: $("#laboratory").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
318 | product_id: $("#product_id").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
319 | min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
320 | max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
321 | flocculation: $("#flocculation").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
322 | attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
323 | notes: $("#notes").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
324 | best_for: $("#best_for").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
325 | max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
326 | inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
327 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
328 | production_date: $("#production_date").val(), |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
329 | tht_date: $("#tht_date").val() |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
330 | }; |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
331 | if (editrow >= 0) { |
14 | 332 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
333 | } else { | |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
334 | $('#jqxgrid').jqxGrid('addrow', null, row); |
14 | 335 | } |
198
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
336 | $("#popupWindow").jqxWindow('hide'); |
f0ec83e1e01f
Switches yeasts inventory to indexed names and translations. Database save is using POST instead of GET. Redesigned the web page. Added total cost display which updates on inventory changes.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
337 | location.reload( true ); // reload ourself. |
14 | 338 | }); |
339 | createDelElements(); | |
340 | }); | |
341 |