www/js/prod_inprod-min.js

changeset 467
f8d16480a6a7
parent 463
0efdafd23753
equal deleted inserted replaced
466:dcfb78cd37ab 467:f8d16480a6a7
1 $(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"birth",type:"string"},{name:"stage",type:"int"},{name:"brew_date",type:"string"},{name:"package_date",type:"string"},],id:"record",url:"includes/db_product.php?select=inprod"};var b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var d=$("<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;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:90,height:20});d.click(function(g){var f="prod_new.php?return=prod_inprod.php";window.location.href=f})},columns:[{text:"Datum",datafield:"birth",width:120},{text:"Code",datafield:"code",width:120},{text:"Naam",datafield:"name"},{text:"Fase",datafield:"stage",width:200,cellsrenderer:function(i,f,k,m,g,n){var c=StageData[k].nl;if(k==2){c=StageData[k].nl+" op "+n.brew_date}if(k==7||k==8){var j=new Date();var l=n.package_date;l=l.split("-");date1=new Date(j.getFullYear(),j.getMonth(),j.getDate());l=new Date(l[0],l[1]-1,l[2]);date1_unixtime=parseInt(date1.getTime()/1000);date2_unixtime=parseInt(l.getTime()/1000);var h=date1_unixtime-date2_unixtime;var e=Math.round(h/60/60/24);if(e>=14){c=StageData[k].nl+" dag "+(e-14)+" van 28"}else{c=StageData[k].nl+" dag "+e+" van 14"}}return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+c+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(e){var d=b.records[e];var c="prod_edit.php?record="+d.record+"&select=inprod&return=prod_inprod.php";window.location.href=c}}],})}); 1 $(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"birth",type:"string"},{name:"stage",type:"int"},{name:"brew_date",type:"string"},{name:"package_date",type:"string"},],id:"record",url:"includes/db_product.php?select=inprod"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c,d;c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");d=$("<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;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:90,height:20});d.click(function(f){window.location.href="prod_new.php?return=prod_inprod.php"})},columns:[{text:"Datum",datafield:"birth",width:120},{text:"Code",datafield:"code",width:120},{text:"Naam",datafield:"name"},{text:"Fase",datafield:"stage",width:200,cellsrenderer:function(k,f,m,o,g,q){var c,l,p,n,h,j,i,e;c=StageData[m].nl;if(m==2){c=StageData[m].nl+" op "+q.brew_date}if(m==7||m==8){l=new Date();n=q.package_date;n=n.split("-");p=new Date(l.getFullYear(),l.getMonth(),l.getDate());n=new Date(n[0],n[1]-1,n[2]);h=parseInt(p.getTime()/1000);j=parseInt(n.getTime()/1000);i=h-j;e=Math.round(i/60/60/24);if(e>=14){c=StageData[m].nl+" dag "+(e-14)+" van 28"}else{c=StageData[m].nl+" dag "+e+" van 14"}}return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+c+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(d){var c=b.records[d];window.location.href="prod_edit.php?record="+c.record+"&select=inprod&return=prod_inprod.php"}}],})});

mercurial