Added Inbound Email Report and link

Also added Status Display LEADID options(issue #639)<Framercy>

git-svn-id: svn://192.168.202.10@1924 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2013-01-24 22:24:46 +00:00
parent 2cb3ce4e95
commit ae5a93167e
2 changed files with 161 additions and 70 deletions
+154 -66
View File
@@ -1,7 +1,7 @@
<?php
# AST_CLOSERstats.php
#
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -36,6 +36,7 @@
# 111103-2003 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs
# 120730-0724 - Small fix for HTML output
# 130124-1719 - Added email report support
#
require("dbconnect.php");
@@ -58,6 +59,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
if (isset($_GET["DID"])) {$DID=$_GET["DID"];}
elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];}
if (isset($_GET["EMAIL"])) {$EMAIL=$_GET["EMAIL"];}
elseif (isset($_POST["EMAIL"])) {$EMAIL=$_POST["EMAIL"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
@@ -186,9 +189,16 @@ if (!isset($group)) {$group = '';}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
$stmt="select group_id,group_name,8 from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;";
$stmt="select group_id,group_name,8 from vicidial_inbound_groups where group_handling='PHONE' $LOGadmin_viewable_groupsSQL order by group_id;";
if ($DID=='Y')
{$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";}
{
$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids $whereLOGadmin_viewable_groupsSQL order by did_pattern;";
}
if ($EMAIL=='Y')
{
$stmt="select email_account_id,email_account_name,email_account_id from vicidial_email_accounts $whereLOGadmin_viewable_groupsSQL order by email_account_id;";
$stmt="select group_id,group_name,8 from vicidial_inbound_groups where group_handling='EMAIL' $LOGadmin_viewable_groupsSQL order by group_id;";
}
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$groups_to_print = mysql_num_rows($rslt);
@@ -287,6 +297,7 @@ $MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=POST name=vicidial_report id=vicidial_
$MAIN.="<TABLE BORDER=0><TR><TD VALIGN=TOP>\n";
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
$MAIN.="<INPUT TYPE=HIDDEN NAME=DID VALUE=\"$DID\">\n";
$MAIN.="<INPUT TYPE=HIDDEN NAME=EMAIL VALUE=\"$EMAIL\">\n";
$MAIN.="Date Range:<BR>\n";
$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
@@ -315,7 +326,9 @@ $MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
if ($DID=='Y')
if ($EMAIL=='Y')
{$MAIN.="Email Accts: \n";}
else if ($DID=='Y')
{$MAIN.="Inbound DIDs: \n";}
else
{$MAIN.="Inbound Groups: \n";}
@@ -373,6 +386,8 @@ $MAIN.="<PRE><FONT SIZE=2>\n\n";
if ($groups_to_print < 1)
{
$MAIN.="\n\n";
if ($EMAIL=='Y')
{$MAIN.="PLEASE SELECT AN EMAIL ACCOUNT AND DATE RANGE ABOVE AND CLICK SUBMIT\n";}
if ($DID=='Y')
{$MAIN.="PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK SUBMIT\n";}
else
@@ -403,12 +418,18 @@ if ($shift == 'ALL')
$query_date_BEGIN = "$query_date $time_BEGIN";
$query_date_END = "$end_date $time_END";
if ($EMAIL=='Y')
{
$MAIN.="Inbound Email Stats: $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a>\n";
$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
}
else
{
$MAIN.="Inbound Call Stats: $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a>\n";
$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
}
$MAIN.="Inbound Call Stats: $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a>\n";
$CSV_text1.="\"Inbound Call Stats:\",\"$group_string\",\"$NOW_TIME\"\n";
if ($DID=='Y')
{
@@ -453,7 +474,14 @@ if ($group_ct > 1)
$CSV_text1.="\n\"MULTI-GROUP BREAKDOWN:\"\n";
if ($DID=='Y')
if ($EMAIL=='Y')
{
$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
$ASCII_text.="| EMAIL | EMAILS | DROPS | DROP % | IVR |\n";
$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
$CSV_text1.="\"EMAIL\",\"CALLS\",\"DROPS\",\"DROP %\",\"IVR\"\n";
}
else if ($DID=='Y')
{
$ASCII_text.="+----------------------+---------+---------+---------+---------+\n";
$ASCII_text.="| DID | CALLS | DROPS | DROP % | IVR |\n";
@@ -656,18 +684,34 @@ else
$average_answer_seconds = sprintf("%10s", $average_answer_seconds);
}
if ($EMAIL=='Y')
{
$MAIN.="Total Emails taken in to this In-Group: $TOTALcalls\n";
$MAIN.="Average Email Length for all Emails: $average_call_seconds seconds\n";
$MAIN.="Answered Emails: $ANSWEREDcalls $ANSWEREDpercent%\n";
$MAIN.="Average queue time for Answered Emails: $average_answer_seconds seconds\n";
$MAIN.="Emails taken into the IVR for this In-Group: $IVRcalls\n";
$MAIN.="Total calls taken in to this In-Group: $TOTALcalls\n";
$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n";
$MAIN.="Answered Calls: $ANSWEREDcalls $ANSWEREDpercent%\n";
$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n";
$MAIN.="Calls taken into the IVR for this In-Group: $IVRcalls\n";
$CSV_text1.="\"Total Emails taken in to this In-Group:\",\"$TOTALcalls\"\n";
$CSV_text1.="\"Average Email Length for all Emails:\",\"$average_call_seconds seconds\"\n";
$CSV_text1.="\"Answered Emails:\",\"$ANSWEREDcalls\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average queue time for Answered Emails:\",\"$average_answer_seconds seconds\"\n";
$CSV_text1.="\"Emails taken into the IVR for this In-Group:\",\"$IVRcalls\"\n";
}
else
{
$MAIN.="Total calls taken in to this In-Group: $TOTALcalls\n";
$MAIN.="Average Call Length for all Calls: $average_call_seconds seconds\n";
$MAIN.="Answered Calls: $ANSWEREDcalls $ANSWEREDpercent%\n";
$MAIN.="Average queue time for Answered Calls: $average_answer_seconds seconds\n";
$MAIN.="Calls taken into the IVR for this In-Group: $IVRcalls\n";
$CSV_text1.="\"Total calls taken in to this In-Group:\",\"$TOTALcalls\"\n";
$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n";
$CSV_text1.="\"Answered Calls:\",\"$ANSWEREDcalls\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n";
$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n";
$CSV_text1.="\"Total calls taken in to this In-Group:\",\"$TOTALcalls\"\n";
$CSV_text1.="\"Average Call Length for all Calls:\",\"$average_call_seconds seconds\"\n";
$CSV_text1.="\"Answered Calls:\",\"$ANSWEREDcalls\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average queue time for Answered Calls:\",\"$average_answer_seconds seconds\"\n";
$CSV_text1.="\"Calls taken into the IVR for this In-Group:\",\"$IVRcalls\"\n";
}
$MAIN.="\n";
$MAIN.="---------- DROPS\n";
@@ -710,12 +754,22 @@ else
$DROP_ANSWEREDpercent = round($DROP_ANSWEREDpercent, 0);
}
$MAIN.="Total DROP Calls: $DROPcalls $DROPpercent% drop/answered: $DROP_ANSWEREDpercent%\n";
$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n";
if ($EMAIL=='Y')
{
$MAIN.="Total DROP Emails: $DROPcalls $DROPpercent% drop/answered: $DROP_ANSWEREDpercent%\n";
$MAIN.="Average hold time for DROP Emails: $average_hold_seconds seconds\n";
$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n";
$CSV_text1.="\"Total DROP Emails:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average hold time for DROP Emails:\",\"$average_hold_seconds seconds\"\n";
}
else
{
$MAIN.="Total DROP Calls: $DROPcalls $DROPpercent% drop/answered: $DROP_ANSWEREDpercent%\n";
$MAIN.="Average hold time for DROP Calls: $average_hold_seconds seconds\n";
$CSV_text1.="\"Total DROP Calls:\",\"$DROPcalls\",\"$DROPpercent%\",\"drop/answered:\",\"$DROP_ANSWEREDpercent%\"\n";
$CSV_text1.="\"Average hold time for DROP Calls:\",\"$average_hold_seconds seconds\"\n";
}
if (strlen($group_SQL)>3)
{
@@ -751,14 +805,29 @@ if (strlen($group_SQL)>3)
}
}
}
$MAIN.="\n";
$MAIN.="---------- CUSTOM INDICATORS\n";
$MAIN.="GDE (Answered/Total calls taken in to this In-Group): $ANSWEREDpercent%\n";
$MAIN.="ACR (Dropped/Answered): $DROP_ANSWEREDpercent%\n";
$CSV_text1.="\n\"CUSTOM INDICATORS\"\n";
$CSV_text1.="\"GDE (Answered/Total calls taken in to this In-Group):\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_ANSWEREDpercent%\"\n";
if ($EMAIL=='Y')
{
$MAIN.="\n";
$MAIN.="---------- CUSTOM INDICATORS\n";
$MAIN.="GDE (Answered/Total emails taken in to this In-Group): $ANSWEREDpercent%\n";
$MAIN.="ACR (Dropped/Answered): $DROP_ANSWEREDpercent%\n";
$CSV_text1.="\n\"CUSTOM INDICATORS\"\n";
$CSV_text1.="\"GDE (Answered/Total emails taken in to this In-Group):\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_ANSWEREDpercent%\"\n";
}
else
{
$MAIN.="\n";
$MAIN.="---------- CUSTOM INDICATORS\n";
$MAIN.="GDE (Answered/Total calls taken in to this In-Group): $ANSWEREDpercent%\n";
$MAIN.="ACR (Dropped/Answered): $DROP_ANSWEREDpercent%\n";
$CSV_text1.="\n\"CUSTOM INDICATORS\"\n";
$CSV_text1.="\"GDE (Answered/Total calls taken in to this In-Group):\",\"$ANSWEREDpercent%\"\n";
$CSV_text1.="\"ACR (Dropped/Answered):\",\"$DROP_ANSWEREDpercent%\"\n";
}
if ($DID!='Y')
{
@@ -849,15 +918,34 @@ else
$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
}
$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n";
$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n";
$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n";
if ($EMAIL=='Y')
{
$MAIN.="Total Emails That entered Queue: $QUEUEcalls $QUEUEpercent%\n";
$MAIN.="Average QUEUE Length for queue emails: $average_queue_seconds seconds\n";
$MAIN.="Average QUEUE Length across all emails: $average_total_queue_seconds seconds\n";
$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n";
$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n";
$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n";
$CSV_text1.="\"Total Emails That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n";
$CSV_text1.="\"Average QUEUE Length for queue emails:\",\"$average_queue_seconds seconds\"\n";
$CSV_text1.="\"Average QUEUE Length across all emails:\",\"$average_total_queue_seconds seconds\"\n";
}
else
{
$MAIN.="Total Calls That entered Queue: $QUEUEcalls $QUEUEpercent%\n";
$MAIN.="Average QUEUE Length for queue calls: $average_queue_seconds seconds\n";
$MAIN.="Average QUEUE Length across all calls: $average_total_queue_seconds seconds\n";
$CSV_text1.="\"Total Calls That entered Queue:\",\"$QUEUEcalls\",\"$QUEUEpercent%\"\n";
$CSV_text1.="\"Average QUEUE Length for queue calls:\",\"$average_queue_seconds seconds\"\n";
$CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_seconds seconds\"\n";
}
if ($EMAIL=='Y') {
$rpt_type_verbiage='EMAIL';
$rpt_type_verbiages='EMAILS';
} else {
$rpt_type_verbiage='CALL ';
$rpt_type_verbiages='CALLS ';
}
##############################
######### CALL HOLD TIME BREAKDOWN IN SECONDS
@@ -865,12 +953,12 @@ $CSV_text1.="\"Average QUEUE Length across all calls:\",\"$average_total_queue_s
$TOTALcalls = 0;
$ASCII_text="\n";
$ASCII_text.="---------- CALL HOLD TIME BREAKDOWN IN SECONDS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=2\">DOWNLOAD</a>\n";
$ASCII_text.="---------- $rpt_type_verbiage HOLD TIME BREAKDOWN IN SECONDS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=2\">DOWNLOAD</a>\n";
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
$CSV_text2.="\n\"CALL HOLD TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\n\"$rpt_type_verbiage HOLD TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n";
@@ -1010,12 +1098,12 @@ else
$BDdropCALLS = 0;
$ASCII_text="\n";
$ASCII_text.="---------- CALL DROP TIME BREAKDOWN IN SECONDS\n";
$ASCII_text.="---------- $rpt_type_verbiage DROP TIME BREAKDOWN IN SECONDS\n";
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
$CSV_text2.="\n\"CALL DROP TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\n\"$rpt_type_verbiage DROP TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n";
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
@@ -1155,12 +1243,12 @@ else
$BDansweredCALLS = 0;
$ASCII_text="\n";
$ASCII_text.=" CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\n";
$ASCII_text.=" $rpt_type_verbiage ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\n";
$ASCII_text.=" +-------------------------------------------------------------------------------------------+------------+\n";
$ASCII_text.=" | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
$ASCII_text.="----------+-------------------------------------------------------------------------------------------+------------+\n";
$CSV_text2.="\n\"CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\n\"$rpt_type_verbiage ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\"\n";
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n";
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;";
@@ -1443,13 +1531,13 @@ else
$TOTALcalls = 0;
$ASCII_text="\n";
$ASCII_text.="---------- CALL HANGUP REASON STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=3\">DOWNLOAD</a>\n";
$ASCII_text.="---------- $rpt_type_verbiage HANGUP REASON STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=3\">DOWNLOAD</a>\n";
$ASCII_text.="+----------------------+------------+\n";
$ASCII_text.="| HANGUP REASON | CALLS |\n";
$ASCII_text.="| HANGUP REASON | $rpt_type_verbiages |\n";
$ASCII_text.="+----------------------+------------+\n";
$CSV_text3.="\n\"CALL HANGUP REASON STATS\"\n";
$CSV_text3.="\"HANGUP REASON\",\"CALLS\"\n";
$CSV_text3.="\n\"$rpt_type_verbiage HANGUP REASON STATS\"\n";
$CSV_text3.="\"HANGUP REASON\",\"$rpt_type_verbiages\"\n";
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;";
if ($DID=='Y')
@@ -1497,11 +1585,11 @@ if ($report_display_type=="HTML")
$i++;
}
$GRAPH_text="</PRE>\n";
$GRAPH_text.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"CALL HANGUP REASON STATS\" class=\"horizontalgraph\">\n";
$GRAPH_text.=" <caption align=\"top\">CALL HANGUP REASON STATS</caption>\n";
$GRAPH_text.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"$rpt_type_verbiage HANGUP REASON STATS\" class=\"horizontalgraph\">\n";
$GRAPH_text.=" <caption align=\"top\">$rpt_type_verbiage HANGUP REASON STATS</caption>\n";
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">REASON </th>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">CALLS </th>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">$rpt_type_verbiages </th>\n";
$GRAPH_text.=" </tr>\n";
for ($i=0; $i<count($ct_ary); $i++) {
if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";}
@@ -1511,7 +1599,7 @@ if ($report_display_type=="HTML")
$GRAPH_text.=" </tr>\n";
}
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">TOTAL CALLS:</th>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">TOTAL ".$rpt_type_verbiage.":</th>\n";
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTALcalls)."</th>\n";
$GRAPH_text.=" </tr>\n";
$GRAPH_text.="</table>\n";
@@ -1529,17 +1617,17 @@ else
$TOTALcalls = 0;
$ASCII_text="\n";
$ASCII_text.="---------- CALL STATUS STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=4\">DOWNLOAD</a>\n";
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
$ASCII_text.="| STATUS | DESCRIPTION | CATEGORY | CALLS | TOTAL TIME | AVG TIME |CALLS/HOUR|\n";
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+----------+\n";
$ASCII_text.="---------- $rpt_type_verbiage STATUS STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=4\">DOWNLOAD</a>\n";
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+-----------+\n";
$ASCII_text.="| STATUS | DESCRIPTION | CATEGORY | $rpt_type_verbiages | TOTAL TIME | AVG TIME |$rpt_type_verbiages/HOUR|\n";
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+-----------+\n";
$GRAPH="<BR><BR><a name='cssgraph'><table border='0' cellpadding='0' cellspacing='2' width='800'>";
$GRAPH.="<tr><th width='25%' class='grey_graph_cell' id='cssgraph1'><a href='#' onClick=\"DrawCSSGraph('CALLS', '1'); return false;\">CALLS</a></th><th width=25% class='grey_graph_cell' id='cssgraph2'><a href='#' onClick=\"DrawCSSGraph('TOTALTIME', '2'); return false;\">TOTAL TIME</a></th><th width=25% class='grey_graph_cell' id='cssgraph3'><a href='#' onClick=\"DrawCSSGraph('AVGTIME', '3'); return false;\">AVG TIME</a></th><th width=25% class='grey_graph_cell' id='cssgraph4'><a href='#' onClick=\"DrawCSSGraph('CALLSHOUR', '4'); return false;\">CALLS/HR</a></th></tr>";
$GRAPH.="<tr><td colspan='4' class='graph_span_cell'><span id='call_status_stats_graph'><BR>&nbsp;<BR></span></td></tr></table><BR><BR>";
$CSV_text4.="\n\"CALL STATUS STATS\"\n";
$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"CATEGORY\",\"CALLS\",\"TOTAL TIME\",\"AVG TIME\",\"CALLS/HOUR\"\n";
$CSV_text4.="\n\"$rpt_type_verbiage STATUS STATS\"\n";
$CSV_text4.="\"STATUS\",\"DESCRIPTION\",\"CATEGORY\",\"$rpt_type_verbiages\",\"TOTAL TIME\",\"AVG TIME\",\"$rpt_type_verbiages/HOUR\"\n";
@@ -1712,11 +1800,11 @@ else
$ASCII_text="\n";
$ASCII_text.="---------- CUSTOM STATUS CATEGORY STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=5\">DOWNLOAD</a>\n";
$ASCII_text.="+----------------------+------------+--------------------------------+\n";
$ASCII_text.="| CATEGORY | CALLS | DESCRIPTION |\n";
$ASCII_text.="| CATEGORY | $rpt_type_verbiages | DESCRIPTION |\n";
$ASCII_text.="+----------------------+------------+--------------------------------+\n";
$CSV_text5.="\n\"CUSTOM STATUS CATEGORY STATS\"\n";
$CSV_text5.="\"CATEGORY\",\"CALLS\",\"DESCRIPTION\"\n";
$CSV_text5.="\"CATEGORY\",\"$rpt_type_verbiages\",\"DESCRIPTION\"\n";
$TOTCATcalls=0;
$r=0;
@@ -1796,12 +1884,12 @@ else
$TOTALcalls = 0;
$ASCII_text="\n";
$ASCII_text.="---------- CALL INITIAL QUEUE POSITION BREAKDOWN <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=6\">DOWNLOAD</a>\n";
$ASCII_text.="---------- $rpt_type_verbiage INITIAL QUEUE POSITION BREAKDOWN <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=6\">DOWNLOAD</a>\n";
$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
$ASCII_text.="| 1 2 3 4 5 6 7 8 9 10 15 20 25 +25 | TOTAL |\n";
$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
$CSV_text6.="\n\"CALL INITIAL QUEUE POSITION BREAKDOWN\"\n";
$CSV_text6.="\n\"$rpt_type_verbiage INITIAL QUEUE POSITION BREAKDOWN\"\n";
$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\"TOTAL\"\n";
@@ -1940,11 +2028,11 @@ $TOTavg=0;
$ASCII_text="\n";
$ASCII_text.="---------- AGENT STATS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=7\">DOWNLOAD</a>\n";
$ASCII_text.="+--------------------------+------------+------------+--------+\n";
$ASCII_text.="| AGENT | CALLS | TIME H:M:S |AVERAGE |\n";
$ASCII_text.="| AGENT | $rpt_type_verbiages | TIME H:M:S |AVERAGE |\n";
$ASCII_text.="+--------------------------+------------+------------+--------+\n";
$CSV_text7.="\n\"AGENT STATS\"\n";
$CSV_text7.="\"AGENT\",\"CALLS\",\"TIME H:M:S\",\"AVERAGE\"\n";
$CSV_text7.="\"AGENT\",\"$rpt_type_verbiages\",\"TIME H:M:S\",\"AVERAGE\"\n";
$max_calls=1;
@@ -1955,7 +2043,7 @@ $GRAPH="<BR><BR><a name='agent_stats_graph'/><table border='0' cellpadding='0' c
$GRAPH.="<tr><th width='34%' class='grey_graph_cell' id='agent_stats_graph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">CALLS</a></th><th width=33% class='grey_graph_cell' id='agent_stats_graph2'><a href='#' onClick=\"DrawGraph('TIMEHMS', '2'); return false;\">TIME H:M:S</a></th><th width=33% class='grey_graph_cell' id='agent_stats_graph3'><a href='#' onClick=\"DrawGraph('AVERAGE', '3'); return false;\">AVERAGE</a></th></tr>";
$GRAPH.="<tr><td colspan='4' class='graph_span_cell'><span id='agentstats_graph'><BR>&nbsp;<BR></span></td></tr></table><BR><BR>";
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>AGENT STATS</caption><tr><th class='thgraph' scope='col'>AGENT</th>";
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>$rpt_type_verbiages </th></tr>";
$TIMEHMS_graph=$graph_header."<th class='thgraph' scope='col'>TIME H:M:S</th></tr>";
$AVERAGE_graph=$graph_header."<th class='thgraph' scope='col'>AVERAGE</th></tr>";
@@ -2175,7 +2263,7 @@ else
}
$ASCII_text.="<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS TAKEN INTO THIS IN-GROUP\n";
$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF TOTAL $rpt_type_verbiages TAKEN INTO THIS IN-GROUP\n";
$k=1;
@@ -2349,12 +2437,12 @@ else
##### Answered wait time breakdown
$MAIN.="\n";
$MAIN.="---------- CALL ANSWERED TIME BREAKDOWN IN SECONDS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=8\">DOWNLOAD</a>\n";
$MAIN.="---------- $rpt_type_verbiage ANSWERED TIME BREAKDOWN IN SECONDS <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=8\">DOWNLOAD</a>\n";
$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n";
$MAIN.="| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n";
$CSV_text8.="\n\"CALL ANSWERED TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text8.="\n\"$rpt_type_verbiage ANSWERED TIME BREAKDOWN IN SECONDS\"\n";
$CSV_text8.="\"HOUR\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n";
$ZZ = '00';
+7 -4
View File
@@ -109,7 +109,7 @@ $QUERY_STRING = getenv("QUERY_STRING");
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs';
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs';
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs';
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
@@ -3219,12 +3219,13 @@ else
# 121212-1529 - Standardization of list_id fields at 19 digits in forms
# 121222-2146 - Added new email features
# 130102-1135 - Small change to admin log viewing for email accounts
# 130124-1721 - Added Inbound Email report link, added Status Display LEADID options(issue #639)
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.6-392a';
$build = '130102-1135';
$admin_version = '2.6-393a';
$build = '130124-1721';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -22545,7 +22546,7 @@ if ($ADD==31)
else {$ASLlink = "$PHP_SELF?ADD=381111111111&label_id=$screen_labels";}
echo "<tr bgcolor=#8EBCFD><td align=right><a href=\"$ASLlink\">Agent Screen Labels</a>: </td><td align=left><select size=1 name=screen_labels>$labels_menu<option value=\"--SYSTEM-SETTINGS--\">--SYSTEM-SETTINGS-- - Default</option><option SELECTED>$screen_labels</option></select>$NWB#vicidial_campaigns-screen_labels$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Status Display Fields: </td><td align=left><select size=1 name=status_display_fields><option>CALLID</option><option>CALLID_LEADID</option><option>CALLID_LEADID_LISTID</option><option>---NONE---</option><option SELECTED>$status_display_fields</option></select>$NWB#vicidial_campaigns-status_display_fields$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Status Display Fields: </td><td align=left><select size=1 name=status_display_fields><option>CALLID</option><option>LEADID</option><option>LISTID</option><option>CALLID_LEADID</option><option>CALLID_LEADID_LISTID</option><option>---NONE---</option><option SELECTED>$status_display_fields</option></select>$NWB#vicidial_campaigns-status_display_fields$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Agent Display Queue Count: </td><td align=left><select size=1 name=display_queue_count><option>Y</option><option>N</option><option SELECTED>$display_queue_count</option></select>$NWB#vicidial_campaigns-display_queue_count$NWE</td></tr>\n";
@@ -34701,6 +34702,8 @@ if ($ADD==999999)
{echo "<LI><a href=\"AST_CLOSERstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Report</a></FONT>\n";}
if ( ( (preg_match("/Inbound Report/",$LOGallowed_reports)) and (preg_match("/Inbound DID Report/",$LOGallowed_reports)) ) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSERstats.php?DID=Y\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Report by DID</a></FONT>\n";}
if ( ( (preg_match("/Inbound Report/",$LOGallowed_reports)) and (preg_match("/Inbound Email Report/",$LOGallowed_reports)) ) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSERstats.php?EMAIL=Y\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Email Report</a></FONT>\n";}
if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
{echo "<LI><a href=\"AST_CLOSER_service_level.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Service Level Report</a></FONT>\n";}
if ( (preg_match("/Inbound Summary Hourly Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )