Modified to include disposition seconds in Erlang C report
Minor fix for Agent Days Detail report git-svn-id: svn://192.168.202.10@2871 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
# 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs
|
# 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs
|
||||||
# 170409-1542 - Added IP List validation code
|
# 170409-1542 - Added IP List validation code
|
||||||
# 171012-2015 - Fixed javascript/apache errors with graphs
|
# 171012-2015 - Fixed javascript/apache errors with graphs
|
||||||
|
# 171204-2300 - Fixed minor reporting bug
|
||||||
#
|
#
|
||||||
|
|
||||||
$startMS = microtime();
|
$startMS = microtime();
|
||||||
@@ -547,7 +548,7 @@ else
|
|||||||
while ($m < $k)
|
while ($m < $k)
|
||||||
{
|
{
|
||||||
$Sdate=$datesARY[$m];
|
$Sdate=$datesARY[$m];
|
||||||
$Scalls=$calls[$m];
|
$Scalls=0;
|
||||||
$SstatusesHTML='';
|
$SstatusesHTML='';
|
||||||
$SstatusesFILE='';
|
$SstatusesFILE='';
|
||||||
$CIScount=0;
|
$CIScount=0;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
# 170504-2245 - Minor bug fixes
|
# 170504-2245 - Minor bug fixes
|
||||||
# 170829-0040 - Added screen color settings
|
# 170829-0040 - Added screen color settings
|
||||||
# 171012-2015 - Fixed javascript/apache errors with graphs
|
# 171012-2015 - Fixed javascript/apache errors with graphs
|
||||||
|
# 171205-2304 - Modified to include disposition seconds in C report
|
||||||
#
|
#
|
||||||
|
|
||||||
$startMS = microtime();
|
$startMS = microtime();
|
||||||
@@ -681,7 +682,7 @@ else
|
|||||||
|
|
||||||
$avg_stmt="select avg(length_in_sec) as avg_length from vicidial_log where length_in_sec is not null and campaign_id in ($campaign_SQL) and call_date>='$query_date 00:00:00' and call_date<='$end_date 23:59:59'"; # **
|
$avg_stmt="select avg(length_in_sec) as avg_length from vicidial_log where length_in_sec is not null and campaign_id in ($campaign_SQL) and call_date>='$query_date 00:00:00' and call_date<='$end_date 23:59:59'"; # **
|
||||||
|
|
||||||
$wrapup_stmt="select uniqueid from vicidial_log where length_in_sec is not null and user!='VDCL' and campaign_id in ($campaign_SQL) and call_date>='$query_date 00:00:00' and call_date<='$end_date 23:59:59'"; # ***
|
$wrapup_stmt="select uniqueid from vicidial_log where length_in_sec is not null and user!='VDAD' and campaign_id in ($campaign_SQL) and call_date>='$query_date 00:00:00' and call_date<='$end_date 23:59:59'"; # ***
|
||||||
}
|
}
|
||||||
if ($DB) {echo "|$hour_stmt|\n";}
|
if ($DB) {echo "|$hour_stmt|\n";}
|
||||||
if ($DB) {echo "|$avg_stmt|\n";}
|
if ($DB) {echo "|$avg_stmt|\n";}
|
||||||
@@ -696,18 +697,32 @@ else
|
|||||||
$avg_row=mysqli_fetch_array($avg_rslt);
|
$avg_row=mysqli_fetch_array($avg_rslt);
|
||||||
$average_call_length=$avg_row["avg_length"];
|
$average_call_length=$avg_row["avg_length"];
|
||||||
|
|
||||||
$wrapup_rslt=mysql_to_mysqli($wrapup_stmt, $link); # ***
|
if ($erlang_type=="C") { # Erlang B reports SHOULD NOT INCLUDE WRAPUP TIME
|
||||||
$wrapup_calls=mysqli_num_rows($wrapup_rslt);
|
$wrapup_rslt=mysql_to_mysqli($wrapup_stmt, $link); # ***
|
||||||
$uid_ct=0;
|
$wrapup_calls=mysqli_num_rows($wrapup_rslt);
|
||||||
$uid_clause="";
|
$uid_ct=0;
|
||||||
$dispo_secs=0;
|
$uid_clause="";
|
||||||
$talk_secs=0;
|
$dispo_secs=0;
|
||||||
while ($wrapup_row=mysqli_fetch_row($wrapup_rslt)) {
|
$talk_secs=0;
|
||||||
$uid_ct++;
|
while ($wrapup_row=mysqli_fetch_row($wrapup_rslt)) {
|
||||||
$uid_clause.="'$wrapup_row[0]',";
|
$uid_ct++;
|
||||||
if ($uid_ct%100==0) {
|
$uid_clause.="'$wrapup_row[0]',";
|
||||||
|
if ($uid_ct%100==0) {
|
||||||
|
$uid_clause=preg_replace('/,$/', '', $uid_clause);
|
||||||
|
$uid_stmt="select dispo_sec, talk_sec from vicidial_agent_log where uniqueid in ($uid_clause)";
|
||||||
|
if ($DB) {echo "|$uid_stmt|\n";}
|
||||||
|
$uid_rslt=mysql_to_mysqli($uid_stmt, $link);
|
||||||
|
while ($uid_row=mysqli_fetch_row($uid_rslt)) {
|
||||||
|
$dispo_secs+=$uid_row[0];
|
||||||
|
$talk_secs+=$uid_row[1];
|
||||||
|
}
|
||||||
|
$uid_clause="";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen($uid_clause)>0) {
|
||||||
$uid_clause=preg_replace('/,$/', '', $uid_clause);
|
$uid_clause=preg_replace('/,$/', '', $uid_clause);
|
||||||
$uid_stmt="select dispo_sec, talk_sec from vicidial_agent_log where uniqueid in ($uid_clause)";
|
$uid_stmt="select dispo_sec, talk_sec from vicidial_agent_log where uniqueid in ($uid_clause)";
|
||||||
|
if ($DB) {echo "|$uid_stmt|\n";}
|
||||||
$uid_rslt=mysql_to_mysqli($uid_stmt, $link);
|
$uid_rslt=mysql_to_mysqli($uid_stmt, $link);
|
||||||
while ($uid_row=mysqli_fetch_row($uid_rslt)) {
|
while ($uid_row=mysqli_fetch_row($uid_rslt)) {
|
||||||
$dispo_secs+=$uid_row[0];
|
$dispo_secs+=$uid_row[0];
|
||||||
@@ -715,19 +730,13 @@ else
|
|||||||
}
|
}
|
||||||
$uid_clause="";
|
$uid_clause="";
|
||||||
}
|
}
|
||||||
|
$avg_dispo_sec=MathZDC($dispo_secs, $wrapup_calls);
|
||||||
|
$avg_talk_sec=MathZDC($talk_secs, $wrapup_calls);
|
||||||
|
|
||||||
|
$average_talk_length=$average_call_length;
|
||||||
|
$average_call_length+=$avg_dispo_sec;
|
||||||
}
|
}
|
||||||
if (strlen($uid_clause)>0) {
|
|
||||||
$uid_clause=preg_replace('/,$/', '', $uid_clause);
|
|
||||||
$uid_stmt="select dispo_sec, talk_sec from vicidial_agent_log where uniqueid in ($uid_clause)";
|
|
||||||
$uid_rslt=mysql_to_mysqli($uid_stmt, $link);
|
|
||||||
while ($uid_row=mysqli_fetch_row($uid_rslt)) {
|
|
||||||
$dispo_secs+=$uid_row[0];
|
|
||||||
$talk_secs+=$uid_row[1];
|
|
||||||
}
|
|
||||||
$uid_clause="";
|
|
||||||
}
|
|
||||||
$avg_dispo_sec=MathZDC($dispo_secs, $wrapup_calls);
|
|
||||||
$avg_talk_sec=MathZDC($talk_secs, $wrapup_calls);
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
||||||
@@ -800,8 +809,8 @@ else
|
|||||||
$ASCII_text.="| ".sprintf("%70s", _QXZ("Desired sale rate: ")).sprintf("%-5.2f", "$sale_chance").sprintf("%-142s", " %")." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Desired sale rate: ")).sprintf("%-5.2f", "$sale_chance").sprintf("%-142s", " %")." |\n";
|
||||||
$ASCII_text.="| ".sprintf("%70s", _QXZ("Actual sale rate: ")).sprintf("%-5.2f", (100*$sale_percent)).sprintf("%-142s", " %")." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Actual sale rate: ")).sprintf("%-5.2f", (100*$sale_percent)).sprintf("%-142s", " %")." |\n";
|
||||||
$ASCII_text.="| ".sprintf("%70s", _QXZ("Average call duration: ")).sprintf("%-147.2f", "$average_call_length")." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Average call duration: ")).sprintf("%-147.2f", "$average_call_length")." |\n";
|
||||||
# $ASCII_text.="| ".sprintf("%70s", _QXZ("Average talk length: ")).sprintf("%-147.4f", "$avg_talk_sec")." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Average call length: ")).sprintf("%-147.4f", "$average_talk_length")." |\n";
|
||||||
# $ASCII_text.="| ".sprintf("%70s", _QXZ("Average wrapup time: ")).sprintf("%-147.4f", "$avg_dispo_sec")." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Average wrapup time: ")).sprintf("%-147.4f", "$avg_dispo_sec")." |\n";
|
||||||
$ASCII_text.="| ".sprintf("%70s", _QXZ("Erlangs: ")).sprintf("%-147.4f", $total_erlangs)." |\n";
|
$ASCII_text.="| ".sprintf("%70s", _QXZ("Erlangs: ")).sprintf("%-147.4f", $total_erlangs)." |\n";
|
||||||
}
|
}
|
||||||
$HTML_text.="<table width='640' border='0' cellpadding='2' cellspacing='0'>";
|
$HTML_text.="<table width='640' border='0' cellpadding='2' cellspacing='0'>";
|
||||||
|
|||||||
Reference in New Issue
Block a user