var stat_options = $.extend({'sAjaxSource':"/dashboard/graph/", "aoColumns": [
{ "mData": "date" },
//{"mData":"clicks"},
{ "mData":"unique_clicks" },
{ "mData":"events_count" },
{ "mData":"approved" },
{ "mData":"pending" },
{ "mData":"rejected" },
{ "mData":"cpc" },
{ "mData":"ltr" },
{ "mData":"approval_rate" },
//{"mData":"total_revenue"},
//{"mData":"rejected_revenue"},
{ "mData":"pending_revenue" },
{ "mData":"approved_revenue" }
], "fnFooterCallback": function( nRow, aaData, iStart, iEnd, aiDisplay ) {
var iTotal = 0
var iTotal2 = 0
for ( var i=0 ; i<aaData.length ; i++ )
{
iTotal += aaData[i][9]*1;
iTotal2 += aaData[i][10]*1;
}
var nCells = nRow.getElementsByTagName('th');
nCells[9].innerHTML = parseInt(iTotal);
nCells[10].innerHTML = parseInt(iTotal2);
<b> });</b>
},tables_options);
var stat_options = $.extend({
"sAjaxSource": "/dashboard/graph/",
"aoColumns": [
{ "mData": "date" },
// {"mData":"clicks"},
{ "mData":"unique_clicks" },
{ "mData":"events_count" },
{ "mData":"approved" },
{ "mData":"pending" },
{ "mData":"rejected" },
{ "mData":"cpc" },
{ "mData":"ltr" },
{ "mData":"approval_rate" },
// {"mData":"total_revenue"},
// {"mData":"rejected_revenue"},
{ "mData":"pending_revenue" },
{ "mData":"approved_revenue" }
],
"fnFooterCallback": function( nRow, aaData, iStart, iEnd, aiDisplay ) {
var iTotal = 0;
var iTotal2 = 0;
for ( var i=0 ; i<aaData.length ; i++ ) {
iTotal += aaData[i][9]*1;
iTotal2 += aaData[i][10]*1;
}
var nCells = nRow.getElementsByTagName('th');
nCells[9].innerHTML = parseInt(iTotal);
nCells[10].innerHTML = parseInt(iTotal2);
});
}, tables_options);