????
Current Path : C:/inetpub/vhost/sdoc.gdtsolutions.vn/package/app/controllers/ |
Current File : C:/inetpub/vhost/sdoc.gdtsolutions.vn/package/app/controllers/HelperController.js |
var stt = 0; module.exports.STT = function(val){ if(val == 0){ stt = 0; return 'STT'; }else{ stt++; return stt; } }//create STT for table module.exports.getSelected = function(value, options){ return options.fn(this).replace(new RegExp(' value="' + value + '"'),'$& selected="selected"'); }; module.exports.getSum = function(value, value2, _options){ var sum = 0; value.forEach(function(val){ Object.keys(val).forEach(function(index){ if(index == value2){ sum += parseInt(val[index]); return false; } }); }); return sum; }