Wed, 23 Jan 2019 22:53:24 +0100
Added total cost values to the fermenter and hop editor screens.
12 | 1 | /***************************************************************************** |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
2 | * Copyright (C) 2014-2019 |
12 | 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, |
12 | 30 | resizable: false, |
31 | isModal: true, | |
32 | modalOpacity: 0.4, | |
33 | okButton: $('#delOk'), | |
34 | cancelButton: $('#delCancel'), | |
35 | initContent: function () { | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
36 | $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
37 | $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme }); |
12 | 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:
196
diff
changeset
|
46 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
47 | var dataRecord = {}; |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
48 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
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:
196
diff
changeset
|
50 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
51 | $('#totval').val(cost * (inventory / 1000)); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
52 | } |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
53 | |
12 | 54 | var url = "includes/db_inventory_hops.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' }, | |
62 | { name: 'alpha', type: 'float' }, | |
63 | { name: 'beta', type: 'float' }, | |
64 | { name: 'humulene', type: 'float' }, | |
65 | { name: 'caryophyllene', type: 'float' }, | |
66 | { name: 'cohumulone', type: 'float' }, | |
67 | { name: 'myrcene', type: 'float' }, | |
13 | 68 | { name: 'hsi', type: 'float' }, |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
69 | { name: 'type', type: 'int' }, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
70 | { name: 'form', type: 'int' }, |
12 | 71 | { name: 'notes', type: 'string' }, |
72 | { name: 'origin', type: 'string' }, | |
73 | { name: 'substitutes', type: 'string' }, | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
74 | { name: 'always_on_stock', type: 'int' }, |
12 | 75 | { name: 'inventory', type: 'float' }, |
76 | { name: 'cost', type: 'float' }, | |
77 | { name: 'production_date', type: 'string' }, | |
78 | { name: 'tht_date', type: 'string' }, | |
13 | 79 | { name: 'total_oil', type: 'float' } |
12 | 80 | ], |
81 | id: 'record', | |
82 | url: url, | |
83 | deleterow: function (rowid, commit) { | |
84 | // synchronize with the server - send delete command | |
85 | var data = "delete=true&" + $.param({ record: rowid }); | |
86 | $.ajax({ | |
87 | dataType: 'json', | |
88 | url: url, | |
89 | cache: false, | |
90 | data: data, | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
91 | type: "POST", |
12 | 92 | success: function (data, status, xhr) { |
93 | // delete command is executed. | |
94 | commit(true); | |
95 | }, | |
96 | error: function (jqXHR, textStatus, errorThrown) { | |
97 | commit(false); | |
98 | } | |
99 | }); | |
100 | }, | |
101 | addrow: function (rowid, rowdata, position, commit) { | |
102 | var data = "insert=true&" + $.param(rowdata); | |
103 | $.ajax({ | |
104 | dataType: 'json', | |
105 | url: url, | |
106 | cache: false, | |
107 | data: data, | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
108 | type: "POST", |
12 | 109 | success: function (data, status, xhr) { |
110 | commit(true); | |
111 | }, | |
112 | error: function(jqXHR, textStatus, errorThrown) { | |
113 | commit(false); | |
114 | } | |
115 | }); | |
116 | }, | |
117 | updaterow: function (rowid, rowdata, commit) { | |
118 | var data = "update=true&" + $.param(rowdata); | |
119 | $.ajax({ | |
120 | dataType: 'json', | |
121 | url: url, | |
122 | cache: false, | |
123 | data: data, | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
124 | type: "POST", |
12 | 125 | success: function (data, status, xhr) { |
126 | // update command is executed. | |
127 | commit(true); | |
128 | }, | |
129 | error: function(jqXHR, textStatus, errorThrown) { | |
130 | commit(false); | |
131 | } | |
132 | }); | |
133 | } | |
134 | }; | |
135 | var srcType = [ "Bittering", "Aroma", "Both" ]; | |
136 | var srcForm = [ "Pellet", "Plug", "Leaf" ]; | |
137 | // initialize the input fields. | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
138 | $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
139 | $("#alpha").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
140 | $("#beta").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
141 | $("#humulene").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
142 | $("#caryophyllene").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
143 | $("#cohumulone").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
144 | $("#myrcene").jqxNumberInput( Perc1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
145 | $("#hsi").jqxNumberInput( Perc1dec5 ); |
12 | 146 | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
147 | $("#type").jqxDropDownList({ |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
148 | theme: theme, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
149 | source: HopTypeAdapter, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
150 | valueMember: 'id', |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
151 | displayMember: 'nl', |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
152 | width: 150, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
153 | height: 23, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
154 | autoDropDownHeight: true |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
155 | }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
156 | $("#form").jqxDropDownList({ |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
157 | theme: theme, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
158 | source: HopFormAdapter, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
159 | valueMember: 'id', |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
160 | displayMember: 'nl', |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
161 | width: 150, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
162 | height: 23, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
163 | autoDropDownHeight: true |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
164 | }); |
13 | 165 | $("#notes").jqxInput({ theme: theme, width: 640, height: 100 }); |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
166 | $("#origin").jqxInput({ theme: theme, width: 320, height: 23 }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
167 | $("#substitutes").jqxInput({ theme: theme, width: 320, height: 23 }); |
12 | 168 | $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
169 | $("#inventory").jqxNumberInput( Spin1dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
170 | $("#production_date").jqxDateTimeInput( Dateopts ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
171 | $("#cost").jqxNumberInput( Spin2dec1 ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
172 | $("#tht_date").jqxDateTimeInput( Dateopts ); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
173 | $("#total_oil").jqxNumberInput( Perc1dec1 ); |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
174 | $("#totval").jqxNumberInput( Spin2dec1 ); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
175 | $("#totval").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
176 | |
12 | 177 | var dataAdapter = new $.jqx.dataAdapter(source); |
178 | var editrow = -1; | |
179 | // initialize jqxGrid | |
180 | $("#jqxgrid").jqxGrid({ | |
181 | width: 1280, | |
182 | height: 630, | |
183 | source: dataAdapter, | |
184 | theme: theme, | |
185 | showstatusbar: true, | |
13 | 186 | localization: getLocalization(), |
12 | 187 | renderstatusbar: function (statusbar) { |
188 | var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); | |
34 | 189 | 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>"); |
12 | 190 | container.append(addButton); |
191 | statusbar.append(container); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
192 | addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
12 | 193 | // add new row. |
194 | addButton.click(function (event) { | |
195 | editrow = -1; | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
196 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
197 | $("#name").val('Nieuwe hop'); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
198 | $("#alpha").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
199 | $("#beta").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
200 | $("#humulene").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
201 | $("#caryophyllene").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
202 | $("#cohumulone").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
203 | $("#myrcene").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
204 | $("#hsi").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
205 | $("#type").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
206 | $("#form").val(0); |
12 | 207 | $("#notes").val(''); |
208 | $("#origin").val(''); | |
209 | $("#substitutes").val(''); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
210 | $("#always_on_stock").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
211 | $("#inventory").val(0); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
212 | $("#cost").val(0); |
12 | 213 | $("#production_date").val(''); |
214 | $("#tht_date").val(''); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
215 | $("#total_oil").val(0); |
12 | 216 | $("#popupWindow").jqxWindow('open'); |
217 | }); | |
218 | }, | |
219 | filterable: true, | |
220 | filtermode: 'excel', | |
221 | columns: [ | |
37
9362eb9e9e5b
Sorting the inventory and changes some grid tables.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
222 | { text: 'Herkomst', datafield: 'origin', align: 'center', cellsalign: 'center', width: 150 }, |
9362eb9e9e5b
Sorting the inventory and changes some grid tables.
Michiel Broek <mbroek@mbse.eu>
parents:
34
diff
changeset
|
223 | { text: 'Hop Naam', datafield: 'name' }, |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
224 | { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 90, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
225 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
226 | return "<div style='margin: 4px;' class='jqx-center-align'>" + HopTypeData[value].nl + "</div>"; |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
227 | } |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
228 | }, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
229 | { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 90, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
230 | cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
231 | return "<div style='margin: 4px;' class='jqx-center-align'>" + HopFormData[value].nl + "</div>"; |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
232 | } |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
233 | }, |
30
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
234 | { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
235 | { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
236 | { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
237 | { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
238 | { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', width: 100 }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
239 | { text: 'Voor, gr.', datafield: 'inventory', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
f5ab22446aa5
Inventory fermentables and hops to standard weight format.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
240 | { text: 'Prijs /kg', datafield: 'cost', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
241 | { text: 'Wijzig', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { |
34 | 242 | return "Wijzig"; |
12 | 243 | }, buttonclick: function (row) { |
244 | // open the popup window when the user clicks a button. | |
245 | editrow = row; | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
246 | $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); |
12 | 247 | // 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:
196
diff
changeset
|
248 | dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
12 | 249 | $("#name").val(dataRecord.name); |
250 | $("#alpha").val(dataRecord.alpha); | |
251 | $("#beta").val(dataRecord.beta); | |
252 | $("#humulene").val(dataRecord.humulene); | |
253 | $("#caryophyllene").val(dataRecord.caryophyllene); | |
254 | $("#cohumulone").val(dataRecord.cohumulone); | |
255 | $("#myrcene").val(dataRecord.myrcene); | |
13 | 256 | $("#hsi").val(dataRecord.hsi); |
12 | 257 | $("#type").val(dataRecord.type); |
258 | $("#form").val(dataRecord.form); | |
259 | $("#notes").val(dataRecord.notes); | |
260 | $("#origin").val(dataRecord.origin); | |
261 | $("#substitutes").val(dataRecord.substitutes); | |
262 | $("#always_on_stock").val(dataRecord.always_on_stock); | |
263 | $("#inventory").val(dataRecord.inventory); | |
264 | $("#cost").val(dataRecord.cost); | |
265 | $("#production_date").val(dataRecord.production_date); | |
266 | $("#tht_date").val(dataRecord.tht_date); | |
13 | 267 | $("#total_oil").val(dataRecord.total_oil); |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
268 | calcTotal(dataRecord.cost, dataRecord.inventory); |
12 | 269 | // show the popup window. |
270 | $("#popupWindow").jqxWindow('open'); | |
271 | } | |
272 | } | |
273 | ] | |
274 | }); | |
199
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
275 | |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
276 | $("#cost").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
277 | dataRecord.cost = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
278 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
279 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
280 | $("#inventory").on('change', function (event) { |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
281 | dataRecord.inventory = parseFloat(event.args.value); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
282 | calcTotal(dataRecord.cost, dataRecord.inventory); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
283 | }); |
dad62ec9af18
Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
284 | |
12 | 285 | // initialize the popup window and buttons. |
286 | $("#popupWindow").jqxWindow({ | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
287 | width: 1050, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
288 | height: 550, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
289 | resizable: false, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
290 | theme: theme, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
291 | isModal: true, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
292 | autoOpen: false, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
293 | cancelButton: $("#Cancel"), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
294 | modalOpacity: 0.40 |
12 | 295 | }); |
296 | $("#popupWindow").on('open', function () { | |
297 | $("#name").jqxInput('selectAll'); | |
298 | }); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
299 | $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme }); |
12 | 300 | $("#Delete").click(function () { |
301 | if (editrow >= 0) { | |
302 | // Open a popup to confirm this action. | |
303 | $('#eventWindow').jqxWindow('open'); | |
304 | $("#delOk").click(function () { | |
305 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
306 | $("#jqxgrid").jqxGrid('deleterow', rowID); | |
307 | }); | |
308 | } | |
309 | $("#popupWindow").jqxWindow('hide'); | |
310 | }); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
311 | $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme }); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
312 | $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
12 | 313 | // update the edited row when the user clicks the 'Save' button. |
314 | $("#Save").click(function () { | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
315 | var rowID = -1; |
12 | 316 | if (editrow >= 0) { |
317 | var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
318 | } |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
319 | var row = { |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
320 | record: rowID, |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
321 | name: $("#name").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
322 | alpha: parseFloat($("#alpha").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
323 | beta: parseFloat($("#beta").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
324 | humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
325 | caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
326 | cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
327 | myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
328 | hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
329 | type: $("#type").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
330 | form: $("#form").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
331 | notes: $("#notes").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
332 | origin: $("#origin").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
333 | substitutes: $("#substitutes").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
334 | always_on_stock: $("#always_on_stock").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
335 | inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
336 | cost: parseFloat($("#cost").jqxNumberInput('decimal')), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
337 | production_date: $("#production_date").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
338 | tht_date: $("#tht_date").val(), |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
339 | total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
340 | }; |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
341 | if (editrow >= 0) { |
12 | 342 | $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
343 | } else { | |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
344 | $('#jqxgrid').jqxGrid('addrow', null, row); |
12 | 345 | } |
196
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
346 | $("#popupWindow").jqxWindow('hide'); |
531d5458782f
Hops 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. Removed the useat field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents:
37
diff
changeset
|
347 | location.reload( true ); // reload ourself. |
12 | 348 | }); |
349 | createDelElements(); | |
350 | }); | |
351 |