aded status tallies to AST_VDADstats.php
git-svn-id: svn://192.168.202.10@565 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -202,6 +202,82 @@ echo "Total NA calls -Busy,Disconnect,RingNoAnswer: $NAcalls $NApercent%\n";
|
||||
echo "Average Call Length for NA Calls in seconds: $average_na_seconds\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL STATUS STATS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL STATUS STATS\n";
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
echo "| STATUS | DESCRIPTION | CALLS |\n";
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
|
||||
$stmt="SELECT * from vicidial_statuses order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$statuses_list='';
|
||||
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$statname_list["$rowx[0]"] = "$rowx[1]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="SELECT * from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' order by status";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Cstatuses_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$o=0;
|
||||
while ($Cstatuses_to_print > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$statname_list["$rowx[0]"] = "$rowx[1]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
|
||||
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
|
||||
$RAWstatus = $row[1];
|
||||
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$status_name = sprintf("%-20s", $statname_list[$RAWstatus]);
|
||||
while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$status_name = sprintf("%-60s", $statname_list[$RAWstatus]);
|
||||
while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
|
||||
echo "| $status | $status_name | $STATUScount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
echo "+--------+----------------------+------------+\n";
|
||||
echo "| TOTAL: | $TOTALcalls |\n";
|
||||
echo "+-------------------------------+------------+\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### USER STATS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user