Имя Последний посещенный исходящий вызов Входящий вызов Пропущенный вызов Исходящий SMS Входящие SMS
$. Ajax ({url: 'api / callanalytics.php', тип: 'POST', данные: {'startd': start.format ('YYYY)-MM-DD '),' endd ': end.format (' YYYY-MM-DD '),' userID ': userid,' all ': allchart}, success: function (response) {res = JSON.parse (ответ); if (res.outboundPast> res.outbound) {$ ('# outbound_stats'). html ("" + res.outbound);} else $ ('# outbound_stats'). html ("" + res.outbound);
if (res.inboundPast>res.inbound) {
$('#inbound_stats').html("<span style='color:red;'>"+res.inbound);
} else $('#inbound_stats').html("<span style='color:green;'>"+res.inbound);
if (res.missedPast>res.missed) {
$('#missed_stats').html("<span style='color:red;'>"+res.missed);}
else $('#missed_stats').html("<span style='color:red;'>"+res.missed);
if (res.missed_aft_ofc_hrs_CallsPast<res.missed_aft_ofc_hrs_Calls) {
$('#missed_aft_ofc_hrs_Calls').html("<span style='color:red;'>"+res.missed_aft_ofc_hrs_Calls);}
else $('#missed_aft_ofc_hrs_Calls').html("<span style='color:red;'>"+res.missed_aft_ofc_hrs_Calls);
if (res.missed_not_picked_CallsPast<res.missed_not_picked_Calls) {
$('#missed_not_picked_Calls').html("<span style='color:red;'>"+res.missed_not_picked_Calls);}
else $('#missed_not_picked_Calls').html("<span style='color:red;'>"+res.missed_not_picked_Calls);
if (res.missed_abd_CallsPast<res.missed_abd_Calls) {
$('#missed_abd_Calls').html("<span style='color:red;'>"+res.missed_abd_Calls);}
else $('#missed_abd_Calls').html("<span style='color:red;'>"+res.missed_abd_Calls);
$('#past_outbound_stats').html(res.outboundPast);
$('#past_inbound_stats').html(res.inboundPast);
$('#past_missed_stats').html(res.missedPast);
$('#missed_aft_ofc_hrs_CallsPast').html(res.missed_aft_ofc_hrs_CallsPast);
$('#missed_not_picked_CallsPast').html(res.missed_not_picked_CallsPast);
$('#missed_abd_CallsPast').html(res.missed_abd_CallsPast);
if (res.tabledata.length>0) {
var tr=" ";
for (var i=0;i<res.tabledata.length;i++){
tr += "<tr>";
tr+="<td class='text-center'>" + res.tabledata[i].name + "</td>";
tr+="<td class='text-center'>" + res.tabledata[i].lastSeen + "</td>";
tr+="<td class='text-center'>" + res.tabledata[i].outboundCalls + " <span>("+res.tabledata[i].outboundCallsPast+")</span></td>";
tr+="<td class='text-center'>" + res.tabledata[i].inboundCalls + " <span>("+res.tabledata[i].inboundCallsPast+")</span></td>";
tr+="<td class='text-center'>" + res.tabledata[i].missedCalls + " <span>("+res.tabledata[i].missedCallsPast+")</span></td>";
tr+="<td class='text-center'>" + res.tabledata[i].outboundSms + " <span>("+res.tabledata[i].outboundSmsPast+")</span></td>";
tr+="<td class='text-center'>" + res.tabledata[i].inboundSms + " <span>("+res.tabledata[i].inboundSmsPast+")</span></td></tr>";
} $('#teamanalytics').html(tr);
}
else {
tr = $('<tr/>');
tr.append("<td class='text-center' colspan='7' style='color:red;'><b>NO DATA FOUND</b></td>");}
$('#teamanalytics').html(tr);
get_chart_new_ui(res);
}
});