diff -r dcfb78cd37ab -r f8d16480a6a7 www/js/prod_inprod.js
--- a/www/js/prod_inprod.js Fri Sep 06 13:35:18 2019 +0200
+++ b/www/js/prod_inprod.js Fri Sep 06 13:51:16 2019 +0200
@@ -36,8 +36,9 @@
],
id: 'record',
url: "includes/db_product.php?select=inprod"
- };
- var dataAdapter = new $.jqx.dataAdapter(source);
+ },
+ dataAdapter = new $.jqx.dataAdapter(source);
+
// initialize jqxGrid
$("#jqxgrid").jqxGrid({
width: 1280,
@@ -46,15 +47,15 @@
theme: theme,
showstatusbar: true,
renderstatusbar: function (statusbar) {
- var container = $("
");
- var addButton = $("Add ");
+ var container, addButton;
+ container = $("");
+ addButton = $("Add ");
container.append(addButton);
statusbar.append(container);
addButton.jqxButton({ theme: theme, width: 90, height: 20 });
// add new recipe.
addButton.click(function (event) {
- var url= "prod_new.php?return=prod_inprod.php";
- window.location.href = url;
+ window.location.href = "prod_new.php?return=prod_inprod.php";
});
},
columns: [
@@ -63,14 +64,15 @@
{ text: 'Naam', datafield: 'name' },
{ text: 'Fase', datafield: 'stage', width: 200,
cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
+ var fase, d, date1, date2, date1_unixtime, date2_unixtime, timeDifference, timeDifferenceInDays;
// 2 = brew, 6 = package, 7 = carbonation, 8 = mature, 9 = taste
- var fase = StageData[value].nl;
+ fase = StageData[value].nl;
if (value == 2) {
fase = StageData[value].nl + " op " + rowdata.brew_date;
}
if (value == 7 || value == 8) {
- var d = new Date();
- var date2 = rowdata.package_date;
+ d = new Date();
+ date2 = rowdata.package_date;
date2 = date2.split('-');
// Now we convert the array to a Date object
date1 = new Date(d.getFullYear(), d.getMonth(), d.getDate());
@@ -79,9 +81,9 @@
date1_unixtime = parseInt(date1.getTime() / 1000);
date2_unixtime = parseInt(date2.getTime() / 1000);
// This is the calculated difference in seconds
- var timeDifference = date1_unixtime - date2_unixtime;
+ timeDifference = date1_unixtime - date2_unixtime;
// Round the result for brews that overlap summer/wintertime changes.
- var timeDifferenceInDays = Math.round(timeDifference / 60 / 60 / 24);
+ timeDifferenceInDays = Math.round(timeDifference / 60 / 60 / 24);
if (timeDifferenceInDays >= 14)
fase = StageData[value].nl + " dag " + (timeDifferenceInDays - 14) + " van 28";
else
@@ -94,8 +96,7 @@
return "Wijzig";
}, buttonclick: function (row) {
var datarecord = dataAdapter.records[row];
- var url= "prod_edit.php?record=" + datarecord.record + "&select=inprod&return=prod_inprod.php";
- window.location.href = url;
+ window.location.href = "prod_edit.php?record=" + datarecord.record + "&select=inprod&return=prod_inprod.php";
}
}
],