518 deleterow: function (rowid, commit) { |
518 deleterow: function (rowid, commit) { |
519 commit(true); |
519 commit(true); |
520 } |
520 } |
521 }; |
521 }; |
522 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
522 var fermentableAdapter = new $.jqx.dataAdapter(fermentableSource); |
523 // dropdownlist datasource from inventory_fermentables |
|
524 var fermentableUrl = "getfermentablesources.php"; |
|
525 var fermentableInvSource = { |
|
526 datatype: "json", |
|
527 datafields: [ |
|
528 { name: 'record', type: 'number' }, |
|
529 { name: 'name', type: 'string' }, |
|
530 { name: 'type', type: 'string' }, |
|
531 { name: 'yield', type: 'float' }, |
|
532 { name: 'color', type: 'float' }, |
|
533 { name: 'add_after_boil', type: 'bool' }, |
|
534 { name: 'origin', type: 'string' }, |
|
535 { name: 'supplier', type: 'string' }, |
|
536 { name: 'coarse_fine_diff', type: 'float' }, |
|
537 { name: 'moisture', type: 'float' }, |
|
538 { name: 'diastatic_power', type: 'float' }, |
|
539 { name: 'protein', type: 'float' }, |
|
540 { name: 'max_in_batch', type: 'float' }, |
|
541 { name: 'recommend_mash', type: 'bool' }, |
|
542 { name: 'graintype', type: 'string' }, |
|
543 { name: 'di_ph', type: 'float' }, |
|
544 { name: 'inventory', type: 'float' }, |
|
545 { name: 'cost', type: 'float' } |
|
546 ], |
|
547 url: fermentableUrl, |
|
548 async: true |
|
549 }; |
|
550 var fermentablelist = new $.jqx.dataAdapter(fermentableInvSource); |
|
551 |
|
552 $("#fermentableGrid").jqxGrid({ |
523 $("#fermentableGrid").jqxGrid({ |
553 width: 1150, |
524 width: 1150, |
554 height: 400, |
525 height: 400, |
555 source: fermentableAdapter, |
526 source: fermentableAdapter, |
556 theme: theme, |
527 theme: theme, |
700 }, |
671 }, |
701 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { |
672 cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { |
702 if (to_100) { |
673 if (to_100) { |
703 return oldvalue; // When using percentages, don't allow edited results. |
674 return oldvalue; // When using percentages, don't allow edited results. |
704 } |
675 } |
705 // console.log("row:"+row+" col:"+column+" type:"+columntype+" old:"+oldvalue+" new:"+newvalue); |
|
706 } |
676 } |
707 }, |
677 }, |
708 { text: 'Percentage', datafield: 'f_percentage', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'p1', |
678 { text: 'Percentage', datafield: 'f_percentage', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'p1', |
709 columntype: 'numberinput', |
679 columntype: 'numberinput', |
710 validation: function (cell, value) { |
680 validation: function (cell, value) { |
848 }, |
818 }, |
849 loadError: function(jqXHR, status, error) { |
819 loadError: function(jqXHR, status, error) { |
850 $('#err').text(status + ' ' + error); |
820 $('#err').text(status + ' ' + error); |
851 }, |
821 }, |
852 }); |
822 }); |
853 // dropdownlist datasource from inventory_hops |
|
854 var hopUrl = "gethopsources.php"; |
|
855 var hopInvSource = { |
|
856 datatype: "json", |
|
857 datafields: [ |
|
858 { name: 'record', type: 'number' }, |
|
859 { name: 'name', type: 'string' }, |
|
860 { name: 'origin', type: 'string' }, |
|
861 { name: 'type', type: 'string' }, |
|
862 { name: 'alpha', type: 'float' }, |
|
863 { name: 'beta', type: 'float' }, |
|
864 { name: 'humulene', type: 'float' }, |
|
865 { name: 'caryophyllene', type: 'float' }, |
|
866 { name: 'cohumulone', type: 'float' }, |
|
867 { name: 'myrcene', type: 'float' }, |
|
868 { name: 'hsi', type: 'float' }, |
|
869 { name: 'useat', type: 'string' }, |
|
870 { name: 'form', type: 'string' }, |
|
871 { name: 'total_oil', type: 'float' }, |
|
872 { name: 'cost', type: 'float' } |
|
873 ], |
|
874 url: hopUrl, |
|
875 async: true |
|
876 }; |
|
877 var hoplist = new $.jqx.dataAdapter(hopInvSource); |
|
878 |
|
879 $("#hopGrid").jqxGrid({ |
823 $("#hopGrid").jqxGrid({ |
880 width: 1050, |
824 width: 1050, |
881 height: 400, |
825 height: 400, |
882 source: hopAdapter, |
826 source: hopAdapter, |
883 theme: theme, |
827 theme: theme, |
1080 }, |
1024 }, |
1081 loadError: function(jqXHR, status, error) { |
1025 loadError: function(jqXHR, status, error) { |
1082 $('#err').text(status + ' ' + error); |
1026 $('#err').text(status + ' ' + error); |
1083 }, |
1027 }, |
1084 }); |
1028 }); |
1085 // dropdownlist datasource from inventory_miscs |
|
1086 var miscUrl = "getmiscsources.php"; |
|
1087 var miscInvSource = { |
|
1088 datatype: "json", |
|
1089 datafields: [ |
|
1090 { name: 'record', type: 'number' }, |
|
1091 { name: 'name', type: 'string' }, |
|
1092 { name: 'type', type: 'string' }, |
|
1093 { name: 'use_use', type: 'string' }, |
|
1094 { name: 'amount_is_weight', type: 'bool' }, |
|
1095 { name: 'time', type: 'float' }, |
|
1096 { name: 'cost', type: 'float' } |
|
1097 ], |
|
1098 url: miscUrl, |
|
1099 async: true |
|
1100 }; |
|
1101 var misclist = new $.jqx.dataAdapter(miscInvSource); |
|
1102 |
|
1103 $("#miscGrid").jqxGrid({ |
1029 $("#miscGrid").jqxGrid({ |
1104 width: 960, |
1030 width: 960, |
1105 height: 400, |
1031 height: 400, |
1106 source: miscAdapter, |
1032 source: miscAdapter, |
1107 theme: theme, |
1033 theme: theme, |
1254 deleterow: function (rowid, commit) { |
1180 deleterow: function (rowid, commit) { |
1255 commit(true); |
1181 commit(true); |
1256 } |
1182 } |
1257 }; |
1183 }; |
1258 var yeastAdapter = new $.jqx.dataAdapter(yeastSource); |
1184 var yeastAdapter = new $.jqx.dataAdapter(yeastSource); |
1259 // dropdownlist datasource from inventory_yeasts |
|
1260 var yeastUrl = "getyeastsources.php"; |
|
1261 var yeastInvSource = { |
|
1262 datatype: "json", |
|
1263 datafields: [ |
|
1264 { name: 'record', type: 'number' }, |
|
1265 { name: 'name', type: 'string' }, |
|
1266 { name: 'type', type: 'string' }, |
|
1267 { name: 'form', type: 'string' }, |
|
1268 { name: 'laboratory', type: 'string' }, |
|
1269 { name: 'product_id', type: 'string' }, |
|
1270 { name: 'min_temperature', type: 'float' }, |
|
1271 { name: 'max_temperature', type: 'float' }, |
|
1272 { name: 'attenuation', type: 'float' }, |
|
1273 { name: 'cost', type: 'float' } |
|
1274 ], |
|
1275 url: yeastUrl, |
|
1276 async: true |
|
1277 }; |
|
1278 var yeastlist = new $.jqx.dataAdapter(yeastInvSource); |
|
1279 |
|
1280 $("#yeastGrid").jqxGrid({ |
1185 $("#yeastGrid").jqxGrid({ |
1281 width: 1050, |
1186 width: 1050, |
1282 height: 300, |
1187 height: 300, |
1283 source: yeastAdapter, |
1188 source: yeastAdapter, |
1284 theme: theme, |
1189 theme: theme, |
1431 deleterow: function (rowid, commit) { |
1336 deleterow: function (rowid, commit) { |
1432 commit(true); |
1337 commit(true); |
1433 } |
1338 } |
1434 }; |
1339 }; |
1435 var waterAdapter = new $.jqx.dataAdapter(waterSource); |
1340 var waterAdapter = new $.jqx.dataAdapter(waterSource); |
1436 // dropdownlist datasource from inventory_waters |
|
1437 var waterUrl = "getwatersources.php"; |
|
1438 var waterInvSource = { |
|
1439 datatype: "json", |
|
1440 datafields: [ |
|
1441 { name: 'record', type: 'number' }, |
|
1442 { name: 'name', type: 'string' }, |
|
1443 { name: 'unlimited_stock', type: 'bool' }, |
|
1444 { name: 'calcium', type: 'float' }, |
|
1445 { name: 'sulfate', type: 'float' }, |
|
1446 { name: 'chloride', type: 'float' }, |
|
1447 { name: 'sodium', type: 'float' }, |
|
1448 { name: 'magnesium', type: 'float' }, |
|
1449 { name: 'ph', type: 'float' }, |
|
1450 { name: 'total_alkalinity', type: 'float' }, |
|
1451 { name: 'cost', type: 'float' }, |
|
1452 ], |
|
1453 url: waterUrl, |
|
1454 async: true |
|
1455 }; |
|
1456 var waterlist = new $.jqx.dataAdapter(waterInvSource); |
|
1457 |
|
1458 $("#waterGrid").jqxGrid({ |
1341 $("#waterGrid").jqxGrid({ |
1459 width: 960, |
1342 width: 960, |
1460 height: 200, |
1343 height: 200, |
1461 source: waterAdapter, |
1344 source: waterAdapter, |
1462 theme: theme, |
1345 theme: theme, |
1570 deleterow: function (rowid, commit) { |
1453 deleterow: function (rowid, commit) { |
1571 commit(true); |
1454 commit(true); |
1572 } |
1455 } |
1573 }; |
1456 }; |
1574 var mashAdapter = new $.jqx.dataAdapter(mashSource); |
1457 var mashAdapter = new $.jqx.dataAdapter(mashSource); |
1575 // dropdownlist datasource from profile_mash |
|
1576 var mashUrl = "include/db_profile_mash.php"; |
|
1577 var mashInvSource = { |
|
1578 datatype: "json", |
|
1579 datafields: [ |
|
1580 { name: 'record', type: 'number' }, |
|
1581 { name: 'name', type: 'string' }, |
|
1582 { name: 'steps', type: 'array' } |
|
1583 ], |
|
1584 url: mashUrl, |
|
1585 async: true |
|
1586 }; |
|
1587 var mashlist = new $.jqx.dataAdapter(mashInvSource); |
|
1588 |
|
1589 $("#mashGrid").jqxGrid({ |
1458 $("#mashGrid").jqxGrid({ |
1590 width: 960, |
1459 width: 960, |
1591 height: 400, |
1460 height: 400, |
1592 source: mashAdapter, |
1461 source: mashAdapter, |
1593 theme: theme, |
1462 theme: theme, |