Added agent activity section to User Stats report
Added Customer Time columns to agent time and performance detail report Added rare vicidial_closer_log 0 length check to AST_cleanup_agent_log.pl script git-svn-id: svn://192.168.202.10@1329 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?
|
<?
|
||||||
# user_stats.php
|
# user_stats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
# 90208-0504 - Added link to multi-day report and fixed call status summary section
|
# 90208-0504 - Added link to multi-day report and fixed call status summary section
|
||||||
# 90305-1226 - Added user_call_log manual dial logs
|
# 90305-1226 - Added user_call_log manual dial logs
|
||||||
# 90310-0734 - Added admin header
|
# 90310-0734 - Added admin header
|
||||||
|
# 100203-1051 - Added AGENT seconds to inbound section
|
||||||
#
|
#
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
@@ -519,37 +520,52 @@ echo "</TABLE><BR><BR>\n";
|
|||||||
##### vicidial agent inbound calls for this time period #####
|
##### vicidial agent inbound calls for this time period #####
|
||||||
|
|
||||||
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||||
|
|
||||||
$stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
$stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$logs_to_print = mysql_num_rows($rslt);
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
$u=0;
|
$u=0;
|
||||||
while ($logs_to_print > $u) {
|
$TOTALinSECONDS=0;
|
||||||
$row=mysql_fetch_row($rslt);
|
$TOTALagentSECONDS=0;
|
||||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
while ($logs_to_print > $u)
|
||||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
{
|
||||||
else
|
$row=mysql_fetch_row($rslt);
|
||||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
$u++;
|
$TOTALinSECONDS = ($TOTALinSECONDS + $row[1]);
|
||||||
echo "<tr $bgcolor>";
|
$AGENTseconds = ($row[1] - $row[5]);
|
||||||
echo "<td><font size=1>$u</td>";
|
if ($AGENTseconds < 0)
|
||||||
echo "<td><font size=2>$row[4]</td>";
|
{$AGENTseconds=0;}
|
||||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
|
||||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
|
||||||
echo "<td align=left><font size=2> $row[10] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[3] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[14] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[17] </td></tr>\n";
|
|
||||||
|
|
||||||
|
$TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds);
|
||||||
|
|
||||||
|
$u++;
|
||||||
|
echo "<tr $bgcolor>";
|
||||||
|
echo "<td><font size=1>$u</td>";
|
||||||
|
echo "<td><font size=2>$row[0]</td>";
|
||||||
|
echo "<td align=left><font size=2> $row[1]</td>\n";
|
||||||
|
echo "<td align=left><font size=2> $row[2]</td>\n";
|
||||||
|
echo "<td align=left><font size=2> $row[3] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[4] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[5] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $AGENTseconds </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[6] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[8] </td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=2>TOTALS</td>";
|
||||||
|
echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n";
|
||||||
|
echo "<td colspan=3><font size=2> </td></tr>\n";
|
||||||
echo "</TABLE></center><BR><BR>\n";
|
echo "</TABLE></center><BR><BR>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# This program only needs to be run by one server
|
# This program only needs to be run by one server
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 60711-0945 - Changed to DBI by Marin Blu
|
# 60711-0945 - Changed to DBI by Marin Blu
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
# 91209-0956 - Added PAUSEREASON-LAGGED queue_log correction during live call
|
# 91209-0956 - Added PAUSEREASON-LAGGED queue_log correction during live call
|
||||||
# 91210-0609 - Added LOGOFF queue_log correction during live call
|
# 91210-0609 - Added LOGOFF queue_log correction during live call
|
||||||
# 91214-0933 - Added queue_position to queue_log COMPLETE... and ABANDON records
|
# 91214-0933 - Added queue_position to queue_log COMPLETE... and ABANDON records
|
||||||
|
# 100203-1110 - Added fix for vicidial_closer_log records with 0 length
|
||||||
#
|
#
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
@@ -151,12 +152,14 @@ if ($Tsec < 10) {$Tsec = "0$Tsec";}
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date > \"$TDSQLdate\" and call_date < \"$FDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
||||||
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
||||||
|
|
||||||
if ($ALL_TIME > 0)
|
if ($ALL_TIME > 0)
|
||||||
{
|
{
|
||||||
$VDAD_SQL_time = "";
|
$VDAD_SQL_time = "";
|
||||||
|
$VDCL_SQL_time = "";
|
||||||
$QM_SQL_time = "";
|
$QM_SQL_time = "";
|
||||||
}
|
}
|
||||||
if ($TWENTYFOUR_HOURS > 0)
|
if ($TWENTYFOUR_HOURS > 0)
|
||||||
@@ -173,6 +176,7 @@ if ($TWENTYFOUR_HOURS > 0)
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
||||||
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
||||||
}
|
}
|
||||||
@@ -190,6 +194,7 @@ if ($TWENTYFOUR_OLDER > 0)
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time < \"$TDSQLdate\"";
|
$VDAD_SQL_time = "and event_time < \"$TDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date < \"$TDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id < $TDtarget";
|
$QM_SQL_time = "and time_id < $TDtarget";
|
||||||
$QM_SQL_time_H = "and time_id < $TDtarget";
|
$QM_SQL_time_H = "and time_id < $TDtarget";
|
||||||
}
|
}
|
||||||
@@ -741,6 +746,17 @@ if ($TEST < 1)
|
|||||||
if ($DB) {print STDERR " Bad Dispo times zeroed out: $affected_rows\n";}
|
if ($DB) {print STDERR " Bad Dispo times zeroed out: $affected_rows\n";}
|
||||||
|
|
||||||
|
|
||||||
|
if ($DBX) {print "\n\n";}
|
||||||
|
if ($DB) {print " - cleaning up closer records\n";}
|
||||||
|
$stmtA = "UPDATE vicidial_closer_log set length_in_sec=(end_epoch - start_epoch) where length_in_sec < 1 and end_epoch > 1000 $VDCL_SQL_time;";
|
||||||
|
if($DBX){print STDERR "|$stmtA|\n";}
|
||||||
|
if ($TEST < 1)
|
||||||
|
{
|
||||||
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
|
}
|
||||||
|
if ($DB) {print STDERR " Bad Closer times recalculated: $affected_rows\n\n";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_performance_detail.php
|
# AST_agent_performance_detail.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
|
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
|
||||||
# 90717-1500 - Changed to be multi-campaign, multi-user-group select
|
# 90717-1500 - Changed to be multi-campaign, multi-user-group select
|
||||||
# 90908-1058 - Added DEAD time statistics
|
# 90908-1058 - Added DEAD time statistics
|
||||||
|
# 100203-1131 - Added CUSTOMER time statistics
|
||||||
#
|
#
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -58,12 +59,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;";
|
|||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$qm_conf_ct = mysql_num_rows($rslt);
|
$qm_conf_ct = mysql_num_rows($rslt);
|
||||||
$i=0;
|
if ($qm_conf_ct > 0)
|
||||||
while ($i < $qm_conf_ct)
|
|
||||||
{
|
{
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$non_latin = $row[0];
|
$non_latin = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
@@ -78,7 +77,7 @@ $rslt=mysql_query($stmt, $link);
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
Header("HTTP/1.0 401 Unauthorized");
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
@@ -306,6 +305,9 @@ while ($i < $rows_to_print)
|
|||||||
$dispo_sec[$i] = $row[6];
|
$dispo_sec[$i] = $row[6];
|
||||||
$status[$i] = $row[7];
|
$status[$i] = $row[7];
|
||||||
$dead_sec[$i] = $row[8];
|
$dead_sec[$i] = $row[8];
|
||||||
|
$customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]);
|
||||||
|
if ($customer_sec[$i] < 1)
|
||||||
|
{$customer_sec[$i]=0;}
|
||||||
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
||||||
{
|
{
|
||||||
$statusesTXT = sprintf("%8s", $status[$i]);
|
$statusesTXT = sprintf("%8s", $status[$i]);
|
||||||
@@ -327,9 +329,9 @@ while ($i < $rows_to_print)
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
|
echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG |$statusesHTML\n";
|
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
|
|
||||||
|
|
||||||
### BEGIN loop through each user ###
|
### BEGIN loop through each user ###
|
||||||
@@ -345,6 +347,7 @@ while ($m < $k)
|
|||||||
$Swait_sec=0;
|
$Swait_sec=0;
|
||||||
$Sdispo_sec=0;
|
$Sdispo_sec=0;
|
||||||
$Sdead_sec=0;
|
$Sdead_sec=0;
|
||||||
|
$Scustomer_sec=0;
|
||||||
$SstatusesHTML='';
|
$SstatusesHTML='';
|
||||||
|
|
||||||
### BEGIN loop through each status ###
|
### BEGIN loop through each status ###
|
||||||
@@ -365,6 +368,7 @@ while ($m < $k)
|
|||||||
$Swait_sec = ($Swait_sec + $wait_sec[$i]);
|
$Swait_sec = ($Swait_sec + $wait_sec[$i]);
|
||||||
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
|
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
|
||||||
$Sdead_sec = ($Sdead_sec + $dead_sec[$i]);
|
$Sdead_sec = ($Sdead_sec + $dead_sec[$i]);
|
||||||
|
$Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]);
|
||||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||||
$SstatusesHTML .= " $SstatusTXT |";
|
$SstatusesHTML .= " $SstatusTXT |";
|
||||||
$status_found++;
|
$status_found++;
|
||||||
@@ -387,6 +391,7 @@ while ($m < $k)
|
|||||||
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
||||||
$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
|
$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
|
||||||
$TOTtotDEAD=($TOTtotDEAD + $Sdead_sec);
|
$TOTtotDEAD=($TOTtotDEAD + $Sdead_sec);
|
||||||
|
$TOTtotCUSTOMER=($TOTtotCUSTOMER + $Scustomer_sec);
|
||||||
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
||||||
if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
|
if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
|
||||||
else {$Stalk_avg=0;}
|
else {$Stalk_avg=0;}
|
||||||
@@ -398,6 +403,8 @@ while ($m < $k)
|
|||||||
else {$Sdispo_avg=0;}
|
else {$Sdispo_avg=0;}
|
||||||
if ( ($Scalls > 0) and ($Sdead_sec > 0) ) {$Sdead_avg = ($Sdead_sec/$Scalls);}
|
if ( ($Scalls > 0) and ($Sdead_sec > 0) ) {$Sdead_avg = ($Sdead_sec/$Scalls);}
|
||||||
else {$Sdead_avg=0;}
|
else {$Sdead_avg=0;}
|
||||||
|
if ( ($Scalls > 0) and ($Scustomer_sec > 0) ) {$Scustomer_avg = ($Scustomer_sec/$Scalls);}
|
||||||
|
else {$Scustomer_avg=0;}
|
||||||
|
|
||||||
$RAWuser = $Suser;
|
$RAWuser = $Suser;
|
||||||
$RAWcalls = $Scalls;
|
$RAWcalls = $Scalls;
|
||||||
@@ -429,6 +436,8 @@ while ($m < $k)
|
|||||||
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
|
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
|
||||||
$USERtotDEAD_MS = sec_convert($Sdead_sec,'H');
|
$USERtotDEAD_MS = sec_convert($Sdead_sec,'H');
|
||||||
$USERavgDEAD_MS = sec_convert($Sdead_avg,'M');
|
$USERavgDEAD_MS = sec_convert($Sdead_avg,'M');
|
||||||
|
$USERtotCUSTOMER_MS = sec_convert($Scustomer_sec,'H');
|
||||||
|
$USERavgCUSTOMER_MS = sec_convert($Scustomer_avg,'M');
|
||||||
|
|
||||||
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
|
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
|
||||||
$pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
|
$pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
|
||||||
@@ -441,9 +450,11 @@ while ($m < $k)
|
|||||||
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
|
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
|
||||||
$pfUSERtotDEAD_MS = sprintf("%8s", $USERtotDEAD_MS);
|
$pfUSERtotDEAD_MS = sprintf("%8s", $USERtotDEAD_MS);
|
||||||
$pfUSERavgDEAD_MS = sprintf("%6s", $USERavgDEAD_MS);
|
$pfUSERavgDEAD_MS = sprintf("%6s", $USERavgDEAD_MS);
|
||||||
|
$pfUSERtotCUSTOMER_MS = sprintf("%8s", $USERtotCUSTOMER_MS);
|
||||||
|
$pfUSERavgCUSTOMER_MS = sprintf("%6s", $USERavgCUSTOMER_MS);
|
||||||
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
|
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
|
||||||
|
|
||||||
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS |$SstatusesHTML\n";
|
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
|
||||||
|
|
||||||
$TOPsorted_output[$m] = $Toutput;
|
$TOPsorted_output[$m] = $Toutput;
|
||||||
|
|
||||||
@@ -531,6 +542,8 @@ if ($TOTtotPAUSE < 1) {$TOTavgPAUSE = '0';}
|
|||||||
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
|
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
|
||||||
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
|
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
|
||||||
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
|
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
|
||||||
|
if ($TOTtotCUSTOMER < 1) {$TOTavgCUSTOMER = '0';}
|
||||||
|
else {$TOTavgCUSTOMER = ($TOTtotCUSTOMER / $TOTcalls);}
|
||||||
|
|
||||||
$TOTtime_MS = sec_convert($TOTtime,'H');
|
$TOTtime_MS = sec_convert($TOTtime,'H');
|
||||||
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
|
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
|
||||||
@@ -538,11 +551,13 @@ $TOTtotDISPO_MS = sec_convert($TOTtotDISPO,'H');
|
|||||||
$TOTtotDEAD_MS = sec_convert($TOTtotDEAD,'H');
|
$TOTtotDEAD_MS = sec_convert($TOTtotDEAD,'H');
|
||||||
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
|
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
|
||||||
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
|
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
|
||||||
|
$TOTtotCUSTOMER_MS = sec_convert($TOTtotCUSTOMER,'H');
|
||||||
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
|
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
|
||||||
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
|
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
|
||||||
$TOTavgDEAD_MS = sec_convert($TOTavgDEAD,'H');
|
$TOTavgDEAD_MS = sec_convert($TOTavgDEAD,'H');
|
||||||
$TOTavgPAUSE_MS = sec_convert($TOTavgPAUSE,'H');
|
$TOTavgPAUSE_MS = sec_convert($TOTavgPAUSE,'H');
|
||||||
$TOTavgWAIT_MS = sec_convert($TOTavgWAIT,'H');
|
$TOTavgWAIT_MS = sec_convert($TOTavgWAIT,'H');
|
||||||
|
$TOTavgCUSTOMER_MS = sec_convert($TOTavgCUSTOMER,'H');
|
||||||
|
|
||||||
$TOTtime_MS = sprintf("%10s", $TOTtime_MS);
|
$TOTtime_MS = sprintf("%10s", $TOTtime_MS);
|
||||||
$TOTtotTALK_MS = sprintf("%10s", $TOTtotTALK_MS);
|
$TOTtotTALK_MS = sprintf("%10s", $TOTtotTALK_MS);
|
||||||
@@ -550,11 +565,13 @@ $TOTtotDISPO_MS = sprintf("%10s", $TOTtotDISPO_MS);
|
|||||||
$TOTtotDEAD_MS = sprintf("%10s", $TOTtotDEAD_MS);
|
$TOTtotDEAD_MS = sprintf("%10s", $TOTtotDEAD_MS);
|
||||||
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
|
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
|
||||||
$TOTtotWAIT_MS = sprintf("%10s", $TOTtotWAIT_MS);
|
$TOTtotWAIT_MS = sprintf("%10s", $TOTtotWAIT_MS);
|
||||||
|
$TOTtotCUSTOMER_MS = sprintf("%10s", $TOTtotCUSTOMER_MS);
|
||||||
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
|
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
|
||||||
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
|
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
|
||||||
$TOTavgDEAD_MS = sprintf("%6s", $TOTavgDEAD_MS);
|
$TOTavgDEAD_MS = sprintf("%6s", $TOTavgDEAD_MS);
|
||||||
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
|
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
|
||||||
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
|
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
|
||||||
|
$TOTavgCUSTOMER_MS = sprintf("%6s", $TOTavgCUSTOMER_MS);
|
||||||
|
|
||||||
while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
|
while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
|
||||||
while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
||||||
@@ -562,16 +579,18 @@ while(strlen($TOTtotDISPO_MS)>10) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0
|
|||||||
while(strlen($TOTtotDEAD_MS)>10) {$TOTtotDEAD_MS = substr("$TOTtotDEAD_MS", 0, -1);}
|
while(strlen($TOTtotDEAD_MS)>10) {$TOTtotDEAD_MS = substr("$TOTtotDEAD_MS", 0, -1);}
|
||||||
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
||||||
while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
|
while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
|
||||||
|
while(strlen($TOTtotCUSTOMER_MS)>10) {$TOTtotCUSTOMER_MS = substr("$TOTtotCUSTOMER_MS", 0, -1);}
|
||||||
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
|
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
|
||||||
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
|
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
|
||||||
while(strlen($TOTavgDEAD_MS)>6) {$TOTavgDEAD_MS = substr("$TOTavgDEAD_MS", 0, -1);}
|
while(strlen($TOTavgDEAD_MS)>6) {$TOTavgDEAD_MS = substr("$TOTavgDEAD_MS", 0, -1);}
|
||||||
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
|
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
|
||||||
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
|
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
|
||||||
|
while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);}
|
||||||
|
|
||||||
|
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$SUMstatusesHTML\n";
|
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
|
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
# Pulls time stats per agent selectable by campaign or user group
|
# Pulls time stats per agent selectable by campaign or user group
|
||||||
# should be most accurate agent stats of all of the reports
|
# should be most accurate agent stats of all of the reports
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 90522-0723 - First build
|
# 90522-0723 - First build
|
||||||
# 90908-1103 - Added DEAD time stats
|
# 90908-1103 - Added DEAD time stats
|
||||||
|
# 100203-1147 - Added CUSTOMER time statistics
|
||||||
#
|
#
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -47,12 +48,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;";
|
|||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$qm_conf_ct = mysql_num_rows($rslt);
|
$qm_conf_ct = mysql_num_rows($rslt);
|
||||||
$i=0;
|
if ($qm_conf_ct > 0)
|
||||||
while ($i < $qm_conf_ct)
|
|
||||||
{
|
{
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$non_latin = $row[0];
|
$non_latin = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
@@ -67,7 +66,7 @@ $rslt=mysql_query($stmt, $link);
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
Header("HTTP/1.0 401 Unauthorized");
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
@@ -345,17 +344,20 @@ else
|
|||||||
$lead = $row[5];
|
$lead = $row[5];
|
||||||
$status = $row[6];
|
$status = $row[6];
|
||||||
$dead = $row[7];
|
$dead = $row[7];
|
||||||
|
|
||||||
if ($wait > 30000) {$wait=0;}
|
if ($wait > 30000) {$wait=0;}
|
||||||
if ($talk > 30000) {$talk=0;}
|
if ($talk > 30000) {$talk=0;}
|
||||||
if ($dispo > 30000) {$dispo=0;}
|
if ($dispo > 30000) {$dispo=0;}
|
||||||
if ($pause > 30000) {$pause=0;}
|
if ($pause > 30000) {$pause=0;}
|
||||||
if ($dead > 30000) {$dead=0;}
|
if ($dead > 30000) {$dead=0;}
|
||||||
|
$customer = ($talk - $dead);
|
||||||
|
if ($customer < 1)
|
||||||
|
{$customer=0;}
|
||||||
$TOTwait = ($TOTwait + $wait);
|
$TOTwait = ($TOTwait + $wait);
|
||||||
$TOTtalk = ($TOTtalk + $talk);
|
$TOTtalk = ($TOTtalk + $talk);
|
||||||
$TOTdispo = ($TOTdispo + $dispo);
|
$TOTdispo = ($TOTdispo + $dispo);
|
||||||
$TOTpause = ($TOTpause + $pause);
|
$TOTpause = ($TOTpause + $pause);
|
||||||
$TOTdead = ($TOTdead + $dead);
|
$TOTdead = ($TOTdead + $dead);
|
||||||
|
$TOTcustomer = ($TOTcustomer + $customer);
|
||||||
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
|
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
|
||||||
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
|
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
|
||||||
|
|
||||||
@@ -377,6 +379,7 @@ else
|
|||||||
$Sdispo[$m] = ($Sdispo[$m] + $dispo);
|
$Sdispo[$m] = ($Sdispo[$m] + $dispo);
|
||||||
$Spause[$m] = ($Spause[$m] + $pause);
|
$Spause[$m] = ($Spause[$m] + $pause);
|
||||||
$Sdead[$m] = ($Sdead[$m] + $dead);
|
$Sdead[$m] = ($Sdead[$m] + $dead);
|
||||||
|
$Scustomer[$m] = ($Scustomer[$m] + $customer);
|
||||||
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
|
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
|
||||||
}
|
}
|
||||||
$m++;
|
$m++;
|
||||||
@@ -390,6 +393,7 @@ else
|
|||||||
$Sdispo[$uc] = $dispo;
|
$Sdispo[$uc] = $dispo;
|
||||||
$Spause[$uc] = $pause;
|
$Spause[$uc] = $pause;
|
||||||
$Sdead[$uc] = $dead;
|
$Sdead[$uc] = $dead;
|
||||||
|
$Scustomer[$uc] = $customer;
|
||||||
if ($lead > 0) {$Scalls[$uc]++;}
|
if ($lead > 0) {$Scalls[$uc]++;}
|
||||||
$uc++;
|
$uc++;
|
||||||
}
|
}
|
||||||
@@ -410,13 +414,13 @@ else
|
|||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
echo "AGENT TIME BREAKDOWN:\n";
|
echo "AGENT TIME BREAKDOWN:\n";
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | |$sub_statusesHTML\n";
|
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n";
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD$sub_statusesFILE\n";
|
$file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n";
|
||||||
}
|
}
|
||||||
##### END print the output to screen or put into file output variable
|
##### END print the output to screen or put into file output variable
|
||||||
|
|
||||||
@@ -445,6 +449,7 @@ else
|
|||||||
$Sdispo[$m]= sec_convert($Sdispo[$m],'H');
|
$Sdispo[$m]= sec_convert($Sdispo[$m],'H');
|
||||||
$Spause[$m]= sec_convert($Spause[$m],'H');
|
$Spause[$m]= sec_convert($Spause[$m],'H');
|
||||||
$Sdead[$m]= sec_convert($Sdead[$m],'H');
|
$Sdead[$m]= sec_convert($Sdead[$m],'H');
|
||||||
|
$Scustomer[$m]= sec_convert($Scustomer[$m],'H');
|
||||||
$Stime[$m]= sec_convert($Stime[$m],'H');
|
$Stime[$m]= sec_convert($Stime[$m],'H');
|
||||||
|
|
||||||
$RAWtime = $Stime[$m];
|
$RAWtime = $Stime[$m];
|
||||||
@@ -453,6 +458,7 @@ else
|
|||||||
$RAWdispo = $Sdispo[$m];
|
$RAWdispo = $Sdispo[$m];
|
||||||
$RAWpause = $Spause[$m];
|
$RAWpause = $Spause[$m];
|
||||||
$RAWdead = $Sdead[$m];
|
$RAWdead = $Sdead[$m];
|
||||||
|
$RAWcustomer = $Scustomer[$m];
|
||||||
|
|
||||||
$n=0;
|
$n=0;
|
||||||
$user_name_found=0;
|
$user_name_found=0;
|
||||||
@@ -547,6 +553,7 @@ else
|
|||||||
$Sdispo[$m]= sprintf("%10s", $Sdispo[$m]);
|
$Sdispo[$m]= sprintf("%10s", $Sdispo[$m]);
|
||||||
$Spause[$m]= sprintf("%10s", $Spause[$m]);
|
$Spause[$m]= sprintf("%10s", $Spause[$m]);
|
||||||
$Sdead[$m]= sprintf("%10s", $Sdead[$m]);
|
$Sdead[$m]= sprintf("%10s", $Sdead[$m]);
|
||||||
|
$Scustomer[$m]= sprintf("%10s", $Scustomer[$m]);
|
||||||
$Scalls[$m]= sprintf("%8s", $Scalls[$m]);
|
$Scalls[$m]= sprintf("%8s", $Scalls[$m]);
|
||||||
$Stime[$m]= sprintf("%10s", $Stime[$m]);
|
$Stime[$m]= sprintf("%10s", $Stime[$m]);
|
||||||
|
|
||||||
@@ -568,11 +575,11 @@ else
|
|||||||
|
|
||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | |$SstatusesHTML\n";
|
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead$SstatusesFILE\n";
|
$fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$TOPsorted_output[$m] = $Toutput;
|
$TOPsorted_output[$m] = $Toutput;
|
||||||
@@ -620,7 +627,7 @@ else
|
|||||||
$TOT_AGENTS = sprintf("%4s", $m);
|
$TOT_AGENTS = sprintf("%4s", $m);
|
||||||
$k=$m;
|
$k=$m;
|
||||||
|
|
||||||
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
||||||
|
|
||||||
|
|
||||||
### BEGIN sort through output to display properly ###
|
### BEGIN sort through output to display properly ###
|
||||||
@@ -704,6 +711,7 @@ else
|
|||||||
$TOTdispo = sec_convert($TOTdispo,'H');
|
$TOTdispo = sec_convert($TOTdispo,'H');
|
||||||
$TOTpause = sec_convert($TOTpause,'H');
|
$TOTpause = sec_convert($TOTpause,'H');
|
||||||
$TOTdead = sec_convert($TOTdead,'H');
|
$TOTdead = sec_convert($TOTdead,'H');
|
||||||
|
$TOTcustomer = sec_convert($TOTcustomer,'H');
|
||||||
$TOTALtime = sec_convert($TOTALtime,'H');
|
$TOTALtime = sec_convert($TOTALtime,'H');
|
||||||
$TOTtimeTC = sec_convert($TOTtimeTC,'H');
|
$TOTtimeTC = sec_convert($TOTtimeTC,'H');
|
||||||
|
|
||||||
@@ -713,6 +721,7 @@ else
|
|||||||
$TOTdispo = sprintf("%11s", $TOTdispo);
|
$TOTdispo = sprintf("%11s", $TOTdispo);
|
||||||
$TOTpause = sprintf("%11s", $TOTpause);
|
$TOTpause = sprintf("%11s", $TOTpause);
|
||||||
$TOTdead = sprintf("%11s", $TOTdead);
|
$TOTdead = sprintf("%11s", $TOTdead);
|
||||||
|
$TOTcustomer = sprintf("%11s", $TOTcustomer);
|
||||||
$TOTALtime = sprintf("%11s", $TOTALtime);
|
$TOTALtime = sprintf("%11s", $TOTALtime);
|
||||||
$TOTtimeTC = sprintf("%11s", $TOTtimeTC);
|
$TOTtimeTC = sprintf("%11s", $TOTtimeTC);
|
||||||
###### END LAST LINE TOTALS FORMATTING ##########
|
###### END LAST LINE TOTALS FORMATTING ##########
|
||||||
@@ -721,16 +730,16 @@ else
|
|||||||
|
|
||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead | |$SUMstatusesHTML\n";
|
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n";
|
||||||
echo "+----------------------------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
if ($AUTOLOGOUTflag > 0)
|
if ($AUTOLOGOUTflag > 0)
|
||||||
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
||||||
echo "\n\n</PRE>";
|
echo "\n\n</PRE>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead$SUMstatusesFILE\n";
|
$file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead,$TOTcustomer$SUMstatusesFILE\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# user_stats.php
|
# user_stats.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
# 90508-0644 - Changed to PHP long tags
|
# 90508-0644 - Changed to PHP long tags
|
||||||
# 90524-2009 - Changed time display to use functions.php
|
# 90524-2009 - Changed time display to use functions.php
|
||||||
# 91130-2037 - Added user closer log manager flag display
|
# 91130-2037 - Added user closer log manager flag display
|
||||||
|
# 100203-1008 - Added agent activity log section
|
||||||
#
|
#
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
@@ -506,40 +507,150 @@ echo "</TABLE><BR><BR>\n";
|
|||||||
##### vicidial agent inbound calls for this time period #####
|
##### vicidial agent inbound calls for this time period #####
|
||||||
|
|
||||||
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||||
|
|
||||||
$stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
$stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$logs_to_print = mysql_num_rows($rslt);
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
$u=0;
|
$u=0;
|
||||||
while ($logs_to_print > $u) {
|
$TOTALinSECONDS=0;
|
||||||
$row=mysql_fetch_row($rslt);
|
$TOTALagentSECONDS=0;
|
||||||
if (eregi("1$|3$|5$|7$|9$", $u))
|
while ($logs_to_print > $u)
|
||||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
{
|
||||||
else
|
$row=mysql_fetch_row($rslt);
|
||||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
$u++;
|
$TOTALinSECONDS = ($TOTALinSECONDS + $row[1]);
|
||||||
echo "<tr $bgcolor>";
|
$AGENTseconds = ($row[1] - $row[5]);
|
||||||
echo "<td><font size=1>$u</td>";
|
if ($AGENTseconds < 0)
|
||||||
echo "<td><font size=2>$row[4]</td>";
|
{$AGENTseconds=0;}
|
||||||
echo "<td align=left><font size=2> $row[7]</td>\n";
|
|
||||||
echo "<td align=left><font size=2> $row[8]</td>\n";
|
|
||||||
echo "<td align=left><font size=2> $row[10] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[3] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[14] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[2] </td>\n";
|
|
||||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n";
|
|
||||||
echo "<td align=right><font size=2> $row[17] </td></tr>\n";
|
|
||||||
|
|
||||||
|
$TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds);
|
||||||
|
|
||||||
|
$u++;
|
||||||
|
echo "<tr $bgcolor>";
|
||||||
|
echo "<td><font size=1>$u</td>";
|
||||||
|
echo "<td><font size=2>$row[0]</td>";
|
||||||
|
echo "<td align=left><font size=2> $row[1]</td>\n";
|
||||||
|
echo "<td align=left><font size=2> $row[2]</td>\n";
|
||||||
|
echo "<td align=left><font size=2> $row[3] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[4] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[5] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $AGENTseconds </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[6] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $row[8] </td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=2>TOTALS</td>";
|
||||||
|
echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n";
|
||||||
|
echo "<td colspan=3><font size=2> </td></tr>\n";
|
||||||
|
echo "</TABLE></center><BR><BR>\n";
|
||||||
|
|
||||||
|
|
||||||
|
##### vicidial agent activity records for this time period #####
|
||||||
|
echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<tr><td colspan=2><font size=1> </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1> </td></tr>\n";
|
||||||
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> PAUSE CODE</td></tr>\n";
|
||||||
|
|
||||||
|
$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
|
$u=0;
|
||||||
|
$TOTALpauseSECONDS=0;
|
||||||
|
$TOTALwaitSECONDS=0;
|
||||||
|
$TOTALtalkSECONDS=0;
|
||||||
|
$TOTALdispoSECONDS=0;
|
||||||
|
$TOTALdeadSECONDS=0;
|
||||||
|
$TOTALcustomerSECONDS=0;
|
||||||
|
while ($logs_to_print > $u)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$event_time = $row[0];
|
||||||
|
$lead_id = $row[1];
|
||||||
|
$campaign_id = $row[2];
|
||||||
|
$pause_sec = $row[3];
|
||||||
|
$wait_sec = $row[4];
|
||||||
|
$talk_sec = $row[5];
|
||||||
|
$dispo_sec = $row[6];
|
||||||
|
$dead_sec = $row[7];
|
||||||
|
$status = $row[8];
|
||||||
|
$pause_code = $row[9];
|
||||||
|
$user_group = $row[10];
|
||||||
|
$customer_sec = ($talk_sec - $dead_sec);
|
||||||
|
if ($customer_sec < 0)
|
||||||
|
{$customer_sec=0;}
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
|
$TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec);
|
||||||
|
$TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec);
|
||||||
|
$TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec);
|
||||||
|
$TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec);
|
||||||
|
$TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec);
|
||||||
|
$TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec);
|
||||||
|
|
||||||
|
|
||||||
|
$u++;
|
||||||
|
echo "<tr $bgcolor>";
|
||||||
|
echo "<td><font size=1>$u</td>";
|
||||||
|
echo "<td><font size=2>$event_time</td>";
|
||||||
|
echo "<td align=right><font size=2> $pause_sec</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $wait_sec</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $talk_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $dispo_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $dead_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $customer_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $status </td>\n";
|
||||||
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$lead_id</A> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $campaign_id </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $pause_code </td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=2>TOTALS</td>";
|
||||||
|
echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td></tr>\n";
|
||||||
|
|
||||||
|
$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H');
|
||||||
|
$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H');
|
||||||
|
$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H');
|
||||||
|
$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H');
|
||||||
|
$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H');
|
||||||
|
$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H');
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>";
|
||||||
|
echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td></tr>\n";
|
||||||
|
|
||||||
echo "</TABLE></center><BR><BR>\n";
|
echo "</TABLE></center><BR><BR>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### vicidial recordings for this time period #####
|
##### vicidial recordings for this time period #####
|
||||||
|
|
||||||
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# This program only needs to be run by one server
|
# This program only needs to be run by one server
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 60711-0945 - Changed to DBI by Marin Blu
|
# 60711-0945 - Changed to DBI by Marin Blu
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
# 91209-0956 - Added PAUSEREASON-LAGGED queue_log correction during live call
|
# 91209-0956 - Added PAUSEREASON-LAGGED queue_log correction during live call
|
||||||
# 91210-0609 - Added LOGOFF queue_log correction during live call
|
# 91210-0609 - Added LOGOFF queue_log correction during live call
|
||||||
# 91214-0933 - Added queue_position to queue_log COMPLETE... and ABANDON records
|
# 91214-0933 - Added queue_position to queue_log COMPLETE... and ABANDON records
|
||||||
|
# 100203-1110 - Added fix for vicidial_closer_log records with 0 length
|
||||||
#
|
#
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
@@ -151,12 +152,14 @@ if ($Tsec < 10) {$Tsec = "0$Tsec";}
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date > \"$TDSQLdate\" and call_date < \"$FDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
||||||
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
||||||
|
|
||||||
if ($ALL_TIME > 0)
|
if ($ALL_TIME > 0)
|
||||||
{
|
{
|
||||||
$VDAD_SQL_time = "";
|
$VDAD_SQL_time = "";
|
||||||
|
$VDCL_SQL_time = "";
|
||||||
$QM_SQL_time = "";
|
$QM_SQL_time = "";
|
||||||
}
|
}
|
||||||
if ($TWENTYFOUR_HOURS > 0)
|
if ($TWENTYFOUR_HOURS > 0)
|
||||||
@@ -173,6 +176,7 @@ if ($TWENTYFOUR_HOURS > 0)
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
$VDAD_SQL_time = "and event_time > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date > \"$TDSQLdate\" and event_time < \"$FDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
$QM_SQL_time = "and time_id > $TDtarget and time_id < $FDtarget";
|
||||||
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
$QM_SQL_time_H = "and time_id > $TDtarget and time_id < $HDtarget";
|
||||||
}
|
}
|
||||||
@@ -190,6 +194,7 @@ if ($TWENTYFOUR_OLDER > 0)
|
|||||||
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
|
||||||
|
|
||||||
$VDAD_SQL_time = "and event_time < \"$TDSQLdate\"";
|
$VDAD_SQL_time = "and event_time < \"$TDSQLdate\"";
|
||||||
|
$VDCL_SQL_time = "and call_date < \"$TDSQLdate\"";
|
||||||
$QM_SQL_time = "and time_id < $TDtarget";
|
$QM_SQL_time = "and time_id < $TDtarget";
|
||||||
$QM_SQL_time_H = "and time_id < $TDtarget";
|
$QM_SQL_time_H = "and time_id < $TDtarget";
|
||||||
}
|
}
|
||||||
@@ -741,6 +746,17 @@ if ($TEST < 1)
|
|||||||
if ($DB) {print STDERR " Bad Dispo times zeroed out: $affected_rows\n";}
|
if ($DB) {print STDERR " Bad Dispo times zeroed out: $affected_rows\n";}
|
||||||
|
|
||||||
|
|
||||||
|
if ($DBX) {print "\n\n";}
|
||||||
|
if ($DB) {print " - cleaning up closer records\n";}
|
||||||
|
$stmtA = "UPDATE vicidial_closer_log set length_in_sec=(end_epoch - start_epoch) where length_in_sec < 1 and end_epoch > 1000 $VDCL_SQL_time;";
|
||||||
|
if($DBX){print STDERR "|$stmtA|\n";}
|
||||||
|
if ($TEST < 1)
|
||||||
|
{
|
||||||
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
|
}
|
||||||
|
if ($DB) {print STDERR " Bad Closer times recalculated: $affected_rows\n\n";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ Default External Server IP||
|
|||||||
If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0||
|
If set to 1, this option will make all new phones created have Use External Server IP set to Y. Default is 0||
|
||||||
Webphone URL||
|
Webphone URL||
|
||||||
This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty||
|
This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty||
|
||||||
|
AGENT ACTIVITY FOR THIS TIME PERIOD||
|
||||||
|
these fields are in seconds||
|
||||||
|
|
||||||
|
|
||||||
############################################################ CLIENT
|
############################################################ CLIENT
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# AST_agent_performance_detail.php
|
# AST_agent_performance_detail.php
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
#
|
#
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
|
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
|
||||||
# 90717-1500 - Changed to be multi-campaign, multi-user-group select
|
# 90717-1500 - Changed to be multi-campaign, multi-user-group select
|
||||||
# 90908-1058 - Added DEAD time statistics
|
# 90908-1058 - Added DEAD time statistics
|
||||||
|
# 100203-1131 - Added CUSTOMER time statistics
|
||||||
#
|
#
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -58,12 +59,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;";
|
|||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$qm_conf_ct = mysql_num_rows($rslt);
|
$qm_conf_ct = mysql_num_rows($rslt);
|
||||||
$i=0;
|
if ($qm_conf_ct > 0)
|
||||||
while ($i < $qm_conf_ct)
|
|
||||||
{
|
{
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$non_latin = $row[0];
|
$non_latin = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
@@ -78,7 +77,7 @@ $rslt=mysql_query($stmt, $link);
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
Header("HTTP/1.0 401 Unauthorized");
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
@@ -306,6 +305,9 @@ while ($i < $rows_to_print)
|
|||||||
$dispo_sec[$i] = $row[6];
|
$dispo_sec[$i] = $row[6];
|
||||||
$status[$i] = $row[7];
|
$status[$i] = $row[7];
|
||||||
$dead_sec[$i] = $row[8];
|
$dead_sec[$i] = $row[8];
|
||||||
|
$customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]);
|
||||||
|
if ($customer_sec[$i] < 1)
|
||||||
|
{$customer_sec[$i]=0;}
|
||||||
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
||||||
{
|
{
|
||||||
$statusesTXT = sprintf("%8s", $status[$i]);
|
$statusesTXT = sprintf("%8s", $status[$i]);
|
||||||
@@ -327,9 +329,9 @@ while ($i < $rows_to_print)
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
|
echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG |$statusesHTML\n";
|
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
|
|
||||||
|
|
||||||
### BEGIN loop through each user ###
|
### BEGIN loop through each user ###
|
||||||
@@ -345,6 +347,7 @@ while ($m < $k)
|
|||||||
$Swait_sec=0;
|
$Swait_sec=0;
|
||||||
$Sdispo_sec=0;
|
$Sdispo_sec=0;
|
||||||
$Sdead_sec=0;
|
$Sdead_sec=0;
|
||||||
|
$Scustomer_sec=0;
|
||||||
$SstatusesHTML='';
|
$SstatusesHTML='';
|
||||||
|
|
||||||
### BEGIN loop through each status ###
|
### BEGIN loop through each status ###
|
||||||
@@ -365,6 +368,7 @@ while ($m < $k)
|
|||||||
$Swait_sec = ($Swait_sec + $wait_sec[$i]);
|
$Swait_sec = ($Swait_sec + $wait_sec[$i]);
|
||||||
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
|
$Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]);
|
||||||
$Sdead_sec = ($Sdead_sec + $dead_sec[$i]);
|
$Sdead_sec = ($Sdead_sec + $dead_sec[$i]);
|
||||||
|
$Scustomer_sec = ($Scustomer_sec + $customer_sec[$i]);
|
||||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||||
$SstatusesHTML .= " $SstatusTXT |";
|
$SstatusesHTML .= " $SstatusTXT |";
|
||||||
$status_found++;
|
$status_found++;
|
||||||
@@ -387,6 +391,7 @@ while ($m < $k)
|
|||||||
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
||||||
$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
|
$TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec);
|
||||||
$TOTtotDEAD=($TOTtotDEAD + $Sdead_sec);
|
$TOTtotDEAD=($TOTtotDEAD + $Sdead_sec);
|
||||||
|
$TOTtotCUSTOMER=($TOTtotCUSTOMER + $Scustomer_sec);
|
||||||
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
|
||||||
if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
|
if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);}
|
||||||
else {$Stalk_avg=0;}
|
else {$Stalk_avg=0;}
|
||||||
@@ -398,6 +403,8 @@ while ($m < $k)
|
|||||||
else {$Sdispo_avg=0;}
|
else {$Sdispo_avg=0;}
|
||||||
if ( ($Scalls > 0) and ($Sdead_sec > 0) ) {$Sdead_avg = ($Sdead_sec/$Scalls);}
|
if ( ($Scalls > 0) and ($Sdead_sec > 0) ) {$Sdead_avg = ($Sdead_sec/$Scalls);}
|
||||||
else {$Sdead_avg=0;}
|
else {$Sdead_avg=0;}
|
||||||
|
if ( ($Scalls > 0) and ($Scustomer_sec > 0) ) {$Scustomer_avg = ($Scustomer_sec/$Scalls);}
|
||||||
|
else {$Scustomer_avg=0;}
|
||||||
|
|
||||||
$RAWuser = $Suser;
|
$RAWuser = $Suser;
|
||||||
$RAWcalls = $Scalls;
|
$RAWcalls = $Scalls;
|
||||||
@@ -429,6 +436,8 @@ while ($m < $k)
|
|||||||
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
|
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
|
||||||
$USERtotDEAD_MS = sec_convert($Sdead_sec,'H');
|
$USERtotDEAD_MS = sec_convert($Sdead_sec,'H');
|
||||||
$USERavgDEAD_MS = sec_convert($Sdead_avg,'M');
|
$USERavgDEAD_MS = sec_convert($Sdead_avg,'M');
|
||||||
|
$USERtotCUSTOMER_MS = sec_convert($Scustomer_sec,'H');
|
||||||
|
$USERavgCUSTOMER_MS = sec_convert($Scustomer_avg,'M');
|
||||||
|
|
||||||
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
|
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
|
||||||
$pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
|
$pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
|
||||||
@@ -441,9 +450,11 @@ while ($m < $k)
|
|||||||
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
|
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
|
||||||
$pfUSERtotDEAD_MS = sprintf("%8s", $USERtotDEAD_MS);
|
$pfUSERtotDEAD_MS = sprintf("%8s", $USERtotDEAD_MS);
|
||||||
$pfUSERavgDEAD_MS = sprintf("%6s", $USERavgDEAD_MS);
|
$pfUSERavgDEAD_MS = sprintf("%6s", $USERavgDEAD_MS);
|
||||||
|
$pfUSERtotCUSTOMER_MS = sprintf("%8s", $USERtotCUSTOMER_MS);
|
||||||
|
$pfUSERavgCUSTOMER_MS = sprintf("%6s", $USERavgCUSTOMER_MS);
|
||||||
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
|
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
|
||||||
|
|
||||||
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS |$SstatusesHTML\n";
|
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
|
||||||
|
|
||||||
$TOPsorted_output[$m] = $Toutput;
|
$TOPsorted_output[$m] = $Toutput;
|
||||||
|
|
||||||
@@ -531,6 +542,8 @@ if ($TOTtotPAUSE < 1) {$TOTavgPAUSE = '0';}
|
|||||||
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
|
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
|
||||||
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
|
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
|
||||||
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
|
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
|
||||||
|
if ($TOTtotCUSTOMER < 1) {$TOTavgCUSTOMER = '0';}
|
||||||
|
else {$TOTavgCUSTOMER = ($TOTtotCUSTOMER / $TOTcalls);}
|
||||||
|
|
||||||
$TOTtime_MS = sec_convert($TOTtime,'H');
|
$TOTtime_MS = sec_convert($TOTtime,'H');
|
||||||
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
|
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
|
||||||
@@ -538,11 +551,13 @@ $TOTtotDISPO_MS = sec_convert($TOTtotDISPO,'H');
|
|||||||
$TOTtotDEAD_MS = sec_convert($TOTtotDEAD,'H');
|
$TOTtotDEAD_MS = sec_convert($TOTtotDEAD,'H');
|
||||||
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
|
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
|
||||||
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
|
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
|
||||||
|
$TOTtotCUSTOMER_MS = sec_convert($TOTtotCUSTOMER,'H');
|
||||||
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
|
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
|
||||||
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
|
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
|
||||||
$TOTavgDEAD_MS = sec_convert($TOTavgDEAD,'H');
|
$TOTavgDEAD_MS = sec_convert($TOTavgDEAD,'H');
|
||||||
$TOTavgPAUSE_MS = sec_convert($TOTavgPAUSE,'H');
|
$TOTavgPAUSE_MS = sec_convert($TOTavgPAUSE,'H');
|
||||||
$TOTavgWAIT_MS = sec_convert($TOTavgWAIT,'H');
|
$TOTavgWAIT_MS = sec_convert($TOTavgWAIT,'H');
|
||||||
|
$TOTavgCUSTOMER_MS = sec_convert($TOTavgCUSTOMER,'H');
|
||||||
|
|
||||||
$TOTtime_MS = sprintf("%10s", $TOTtime_MS);
|
$TOTtime_MS = sprintf("%10s", $TOTtime_MS);
|
||||||
$TOTtotTALK_MS = sprintf("%10s", $TOTtotTALK_MS);
|
$TOTtotTALK_MS = sprintf("%10s", $TOTtotTALK_MS);
|
||||||
@@ -550,11 +565,13 @@ $TOTtotDISPO_MS = sprintf("%10s", $TOTtotDISPO_MS);
|
|||||||
$TOTtotDEAD_MS = sprintf("%10s", $TOTtotDEAD_MS);
|
$TOTtotDEAD_MS = sprintf("%10s", $TOTtotDEAD_MS);
|
||||||
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
|
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
|
||||||
$TOTtotWAIT_MS = sprintf("%10s", $TOTtotWAIT_MS);
|
$TOTtotWAIT_MS = sprintf("%10s", $TOTtotWAIT_MS);
|
||||||
|
$TOTtotCUSTOMER_MS = sprintf("%10s", $TOTtotCUSTOMER_MS);
|
||||||
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
|
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
|
||||||
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
|
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
|
||||||
$TOTavgDEAD_MS = sprintf("%6s", $TOTavgDEAD_MS);
|
$TOTavgDEAD_MS = sprintf("%6s", $TOTavgDEAD_MS);
|
||||||
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
|
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
|
||||||
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
|
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
|
||||||
|
$TOTavgCUSTOMER_MS = sprintf("%6s", $TOTavgCUSTOMER_MS);
|
||||||
|
|
||||||
while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
|
while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
|
||||||
while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
|
||||||
@@ -562,16 +579,18 @@ while(strlen($TOTtotDISPO_MS)>10) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0
|
|||||||
while(strlen($TOTtotDEAD_MS)>10) {$TOTtotDEAD_MS = substr("$TOTtotDEAD_MS", 0, -1);}
|
while(strlen($TOTtotDEAD_MS)>10) {$TOTtotDEAD_MS = substr("$TOTtotDEAD_MS", 0, -1);}
|
||||||
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
||||||
while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
|
while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
|
||||||
|
while(strlen($TOTtotCUSTOMER_MS)>10) {$TOTtotCUSTOMER_MS = substr("$TOTtotCUSTOMER_MS", 0, -1);}
|
||||||
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
|
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
|
||||||
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
|
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
|
||||||
while(strlen($TOTavgDEAD_MS)>6) {$TOTavgDEAD_MS = substr("$TOTavgDEAD_MS", 0, -1);}
|
while(strlen($TOTavgDEAD_MS)>6) {$TOTavgDEAD_MS = substr("$TOTavgDEAD_MS", 0, -1);}
|
||||||
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
|
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
|
||||||
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
|
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
|
||||||
|
while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);}
|
||||||
|
|
||||||
|
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$SUMstatusesHTML\n";
|
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
|
||||||
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||||
|
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
# Pulls time stats per agent selectable by campaign or user group
|
# Pulls time stats per agent selectable by campaign or user group
|
||||||
# should be most accurate agent stats of all of the reports
|
# should be most accurate agent stats of all of the reports
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# CHANGES
|
# CHANGES
|
||||||
# 90522-0723 - First build
|
# 90522-0723 - First build
|
||||||
# 90908-1103 - Added DEAD time stats
|
# 90908-1103 - Added DEAD time stats
|
||||||
|
# 100203-1147 - Added CUSTOMER time statistics
|
||||||
#
|
#
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -47,12 +48,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;";
|
|||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$qm_conf_ct = mysql_num_rows($rslt);
|
$qm_conf_ct = mysql_num_rows($rslt);
|
||||||
$i=0;
|
if ($qm_conf_ct > 0)
|
||||||
while ($i < $qm_conf_ct)
|
|
||||||
{
|
{
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$non_latin = $row[0];
|
$non_latin = $row[0];
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
##### END SETTINGS LOOKUP #####
|
##### END SETTINGS LOOKUP #####
|
||||||
###########################################
|
###########################################
|
||||||
@@ -67,7 +66,7 @@ $rslt=mysql_query($stmt, $link);
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$auth=$row[0];
|
$auth=$row[0];
|
||||||
|
|
||||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||||
{
|
{
|
||||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
Header("HTTP/1.0 401 Unauthorized");
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
@@ -345,17 +344,20 @@ else
|
|||||||
$lead = $row[5];
|
$lead = $row[5];
|
||||||
$status = $row[6];
|
$status = $row[6];
|
||||||
$dead = $row[7];
|
$dead = $row[7];
|
||||||
|
|
||||||
if ($wait > 30000) {$wait=0;}
|
if ($wait > 30000) {$wait=0;}
|
||||||
if ($talk > 30000) {$talk=0;}
|
if ($talk > 30000) {$talk=0;}
|
||||||
if ($dispo > 30000) {$dispo=0;}
|
if ($dispo > 30000) {$dispo=0;}
|
||||||
if ($pause > 30000) {$pause=0;}
|
if ($pause > 30000) {$pause=0;}
|
||||||
if ($dead > 30000) {$dead=0;}
|
if ($dead > 30000) {$dead=0;}
|
||||||
|
$customer = ($talk - $dead);
|
||||||
|
if ($customer < 1)
|
||||||
|
{$customer=0;}
|
||||||
$TOTwait = ($TOTwait + $wait);
|
$TOTwait = ($TOTwait + $wait);
|
||||||
$TOTtalk = ($TOTtalk + $talk);
|
$TOTtalk = ($TOTtalk + $talk);
|
||||||
$TOTdispo = ($TOTdispo + $dispo);
|
$TOTdispo = ($TOTdispo + $dispo);
|
||||||
$TOTpause = ($TOTpause + $pause);
|
$TOTpause = ($TOTpause + $pause);
|
||||||
$TOTdead = ($TOTdead + $dead);
|
$TOTdead = ($TOTdead + $dead);
|
||||||
|
$TOTcustomer = ($TOTcustomer + $customer);
|
||||||
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
|
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
|
||||||
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
|
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
|
||||||
|
|
||||||
@@ -377,6 +379,7 @@ else
|
|||||||
$Sdispo[$m] = ($Sdispo[$m] + $dispo);
|
$Sdispo[$m] = ($Sdispo[$m] + $dispo);
|
||||||
$Spause[$m] = ($Spause[$m] + $pause);
|
$Spause[$m] = ($Spause[$m] + $pause);
|
||||||
$Sdead[$m] = ($Sdead[$m] + $dead);
|
$Sdead[$m] = ($Sdead[$m] + $dead);
|
||||||
|
$Scustomer[$m] = ($Scustomer[$m] + $customer);
|
||||||
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
|
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
|
||||||
}
|
}
|
||||||
$m++;
|
$m++;
|
||||||
@@ -390,6 +393,7 @@ else
|
|||||||
$Sdispo[$uc] = $dispo;
|
$Sdispo[$uc] = $dispo;
|
||||||
$Spause[$uc] = $pause;
|
$Spause[$uc] = $pause;
|
||||||
$Sdead[$uc] = $dead;
|
$Sdead[$uc] = $dead;
|
||||||
|
$Scustomer[$uc] = $customer;
|
||||||
if ($lead > 0) {$Scalls[$uc]++;}
|
if ($lead > 0) {$Scalls[$uc]++;}
|
||||||
$uc++;
|
$uc++;
|
||||||
}
|
}
|
||||||
@@ -410,13 +414,13 @@ else
|
|||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
echo "AGENT TIME BREAKDOWN:\n";
|
echo "AGENT TIME BREAKDOWN:\n";
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | |$sub_statusesHTML\n";
|
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">LEADS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n";
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD$sub_statusesFILE\n";
|
$file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n";
|
||||||
}
|
}
|
||||||
##### END print the output to screen or put into file output variable
|
##### END print the output to screen or put into file output variable
|
||||||
|
|
||||||
@@ -445,6 +449,7 @@ else
|
|||||||
$Sdispo[$m]= sec_convert($Sdispo[$m],'H');
|
$Sdispo[$m]= sec_convert($Sdispo[$m],'H');
|
||||||
$Spause[$m]= sec_convert($Spause[$m],'H');
|
$Spause[$m]= sec_convert($Spause[$m],'H');
|
||||||
$Sdead[$m]= sec_convert($Sdead[$m],'H');
|
$Sdead[$m]= sec_convert($Sdead[$m],'H');
|
||||||
|
$Scustomer[$m]= sec_convert($Scustomer[$m],'H');
|
||||||
$Stime[$m]= sec_convert($Stime[$m],'H');
|
$Stime[$m]= sec_convert($Stime[$m],'H');
|
||||||
|
|
||||||
$RAWtime = $Stime[$m];
|
$RAWtime = $Stime[$m];
|
||||||
@@ -453,6 +458,7 @@ else
|
|||||||
$RAWdispo = $Sdispo[$m];
|
$RAWdispo = $Sdispo[$m];
|
||||||
$RAWpause = $Spause[$m];
|
$RAWpause = $Spause[$m];
|
||||||
$RAWdead = $Sdead[$m];
|
$RAWdead = $Sdead[$m];
|
||||||
|
$RAWcustomer = $Scustomer[$m];
|
||||||
|
|
||||||
$n=0;
|
$n=0;
|
||||||
$user_name_found=0;
|
$user_name_found=0;
|
||||||
@@ -547,6 +553,7 @@ else
|
|||||||
$Sdispo[$m]= sprintf("%10s", $Sdispo[$m]);
|
$Sdispo[$m]= sprintf("%10s", $Sdispo[$m]);
|
||||||
$Spause[$m]= sprintf("%10s", $Spause[$m]);
|
$Spause[$m]= sprintf("%10s", $Spause[$m]);
|
||||||
$Sdead[$m]= sprintf("%10s", $Sdead[$m]);
|
$Sdead[$m]= sprintf("%10s", $Sdead[$m]);
|
||||||
|
$Scustomer[$m]= sprintf("%10s", $Scustomer[$m]);
|
||||||
$Scalls[$m]= sprintf("%8s", $Scalls[$m]);
|
$Scalls[$m]= sprintf("%8s", $Scalls[$m]);
|
||||||
$Stime[$m]= sprintf("%10s", $Stime[$m]);
|
$Stime[$m]= sprintf("%10s", $Stime[$m]);
|
||||||
|
|
||||||
@@ -568,11 +575,11 @@ else
|
|||||||
|
|
||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | |$SstatusesHTML\n";
|
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead$SstatusesFILE\n";
|
$fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause,$RAWdead,$RAWcustomer$SstatusesFILE\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$TOPsorted_output[$m] = $Toutput;
|
$TOPsorted_output[$m] = $Toutput;
|
||||||
@@ -620,7 +627,7 @@ else
|
|||||||
$TOT_AGENTS = sprintf("%4s", $m);
|
$TOT_AGENTS = sprintf("%4s", $m);
|
||||||
$k=$m;
|
$k=$m;
|
||||||
|
|
||||||
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
||||||
|
|
||||||
|
|
||||||
### BEGIN sort through output to display properly ###
|
### BEGIN sort through output to display properly ###
|
||||||
@@ -704,6 +711,7 @@ else
|
|||||||
$TOTdispo = sec_convert($TOTdispo,'H');
|
$TOTdispo = sec_convert($TOTdispo,'H');
|
||||||
$TOTpause = sec_convert($TOTpause,'H');
|
$TOTpause = sec_convert($TOTpause,'H');
|
||||||
$TOTdead = sec_convert($TOTdead,'H');
|
$TOTdead = sec_convert($TOTdead,'H');
|
||||||
|
$TOTcustomer = sec_convert($TOTcustomer,'H');
|
||||||
$TOTALtime = sec_convert($TOTALtime,'H');
|
$TOTALtime = sec_convert($TOTALtime,'H');
|
||||||
$TOTtimeTC = sec_convert($TOTtimeTC,'H');
|
$TOTtimeTC = sec_convert($TOTtimeTC,'H');
|
||||||
|
|
||||||
@@ -713,6 +721,7 @@ else
|
|||||||
$TOTdispo = sprintf("%11s", $TOTdispo);
|
$TOTdispo = sprintf("%11s", $TOTdispo);
|
||||||
$TOTpause = sprintf("%11s", $TOTpause);
|
$TOTpause = sprintf("%11s", $TOTpause);
|
||||||
$TOTdead = sprintf("%11s", $TOTdead);
|
$TOTdead = sprintf("%11s", $TOTdead);
|
||||||
|
$TOTcustomer = sprintf("%11s", $TOTcustomer);
|
||||||
$TOTALtime = sprintf("%11s", $TOTALtime);
|
$TOTALtime = sprintf("%11s", $TOTALtime);
|
||||||
$TOTtimeTC = sprintf("%11s", $TOTtimeTC);
|
$TOTtimeTC = sprintf("%11s", $TOTtimeTC);
|
||||||
###### END LAST LINE TOTALS FORMATTING ##########
|
###### END LAST LINE TOTALS FORMATTING ##########
|
||||||
@@ -721,16 +730,16 @@ else
|
|||||||
|
|
||||||
if ($file_download < 1)
|
if ($file_download < 1)
|
||||||
{
|
{
|
||||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead | |$SUMstatusesHTML\n";
|
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause |$TOTdead |$TOTcustomer | |$SUMstatusesHTML\n";
|
||||||
echo "+----------------------------+----------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||||
if ($AUTOLOGOUTflag > 0)
|
if ($AUTOLOGOUTflag > 0)
|
||||||
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
||||||
echo "\n\n</PRE>";
|
echo "\n\n</PRE>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead$SUMstatusesFILE\n";
|
$file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause,$TOTdead,$TOTcustomer$SUMstatusesFILE\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
# 90524-2009 - Changed time display to use functions.php
|
# 90524-2009 - Changed time display to use functions.php
|
||||||
# 91130-2037 - Added user closer log manager flag display
|
# 91130-2037 - Added user closer log manager flag display
|
||||||
# 100126-0847 - Added DID log display options
|
# 100126-0847 - Added DID log display options
|
||||||
|
# 100203-1008 - Added agent activity log section
|
||||||
#
|
#
|
||||||
|
|
||||||
header ("Content-type: text/html; charset=utf-8");
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
@@ -552,8 +553,8 @@ if ($did < 1)
|
|||||||
##### vicidial agent inbound calls for this time period #####
|
##### vicidial agent inbound calls for this time period #####
|
||||||
|
|
||||||
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
echo "<B>INBOUND/CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n";
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||||
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n";
|
||||||
|
|
||||||
$stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
$stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
|
||||||
if ($did > 0)
|
if ($did > 0)
|
||||||
@@ -565,6 +566,7 @@ $logs_to_print = mysql_num_rows($rslt);
|
|||||||
|
|
||||||
$u=0;
|
$u=0;
|
||||||
$TOTALinSECONDS=0;
|
$TOTALinSECONDS=0;
|
||||||
|
$TOTALagentSECONDS=0;
|
||||||
while ($logs_to_print > $u)
|
while ($logs_to_print > $u)
|
||||||
{
|
{
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
@@ -584,6 +586,11 @@ while ($logs_to_print > $u)
|
|||||||
{$row[7]='0';}
|
{$row[7]='0';}
|
||||||
}
|
}
|
||||||
$TOTALinSECONDS = ($TOTALinSECONDS + $row[1]);
|
$TOTALinSECONDS = ($TOTALinSECONDS + $row[1]);
|
||||||
|
$AGENTseconds = ($row[1] - $row[5]);
|
||||||
|
if ($AGENTseconds < 0)
|
||||||
|
{$AGENTseconds=0;}
|
||||||
|
|
||||||
|
$TOTALagentSECONDS = ($TOTALagentSECONDS + $AGENTseconds);
|
||||||
|
|
||||||
$u++;
|
$u++;
|
||||||
echo "<tr $bgcolor>";
|
echo "<tr $bgcolor>";
|
||||||
@@ -594,6 +601,7 @@ while ($logs_to_print > $u)
|
|||||||
echo "<td align=left><font size=2> $row[3] </td>\n";
|
echo "<td align=left><font size=2> $row[3] </td>\n";
|
||||||
echo "<td align=right><font size=2> $row[4] </td>\n";
|
echo "<td align=right><font size=2> $row[4] </td>\n";
|
||||||
echo "<td align=right><font size=2> $row[5] </td>\n";
|
echo "<td align=right><font size=2> $row[5] </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $AGENTseconds </td>\n";
|
||||||
echo "<td align=right><font size=2> $row[6] </td>\n";
|
echo "<td align=right><font size=2> $row[6] </td>\n";
|
||||||
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n";
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$row[7]</A> </td>\n";
|
||||||
echo "<td align=right><font size=2> $row[8] </td></tr>\n";
|
echo "<td align=right><font size=2> $row[8] </td></tr>\n";
|
||||||
@@ -602,11 +610,109 @@ while ($logs_to_print > $u)
|
|||||||
echo "<tr bgcolor=white>";
|
echo "<tr bgcolor=white>";
|
||||||
echo "<td colspan=2><font size=2>TOTALS</td>";
|
echo "<td colspan=2><font size=2>TOTALS</td>";
|
||||||
echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n";
|
echo "<td align=left><font size=2> $TOTALinSECONDS</td>\n";
|
||||||
echo "<td colspan=7><font size=2> </td></tr>\n";
|
echo "<td colspan=4><font size=2> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALagentSECONDS</td>\n";
|
||||||
|
echo "<td colspan=3><font size=2> </td></tr>\n";
|
||||||
echo "</TABLE></center><BR><BR>\n";
|
echo "</TABLE></center><BR><BR>\n";
|
||||||
|
|
||||||
|
|
||||||
|
##### vicidial agent activity records for this time period #####
|
||||||
|
if ($did < 1)
|
||||||
|
{
|
||||||
|
echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
|
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<tr><td colspan=2><font size=1> </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1> </td></tr>\n";
|
||||||
|
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> PAUSE CODE</td></tr>\n";
|
||||||
|
|
||||||
|
$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$logs_to_print = mysql_num_rows($rslt);
|
||||||
|
|
||||||
|
$u=0;
|
||||||
|
$TOTALpauseSECONDS=0;
|
||||||
|
$TOTALwaitSECONDS=0;
|
||||||
|
$TOTALtalkSECONDS=0;
|
||||||
|
$TOTALdispoSECONDS=0;
|
||||||
|
$TOTALdeadSECONDS=0;
|
||||||
|
$TOTALcustomerSECONDS=0;
|
||||||
|
while ($logs_to_print > $u)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$event_time = $row[0];
|
||||||
|
$lead_id = $row[1];
|
||||||
|
$campaign_id = $row[2];
|
||||||
|
$pause_sec = $row[3];
|
||||||
|
$wait_sec = $row[4];
|
||||||
|
$talk_sec = $row[5];
|
||||||
|
$dispo_sec = $row[6];
|
||||||
|
$dead_sec = $row[7];
|
||||||
|
$status = $row[8];
|
||||||
|
$pause_code = $row[9];
|
||||||
|
$user_group = $row[10];
|
||||||
|
$customer_sec = ($talk_sec - $dead_sec);
|
||||||
|
if ($customer_sec < 0)
|
||||||
|
{$customer_sec=0;}
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $u))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
|
||||||
|
$TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec);
|
||||||
|
$TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec);
|
||||||
|
$TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec);
|
||||||
|
$TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec);
|
||||||
|
$TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec);
|
||||||
|
$TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec);
|
||||||
|
|
||||||
|
|
||||||
|
$u++;
|
||||||
|
echo "<tr $bgcolor>";
|
||||||
|
echo "<td><font size=1>$u</td>";
|
||||||
|
echo "<td><font size=2>$event_time</td>";
|
||||||
|
echo "<td align=right><font size=2> $pause_sec</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $wait_sec</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $talk_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $dispo_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $dead_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $customer_sec </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $status </td>\n";
|
||||||
|
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[7]\" target=\"_blank\">$lead_id</A> </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $campaign_id </td>\n";
|
||||||
|
echo "<td align=right><font size=2> $pause_code </td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=2>TOTALS</td>";
|
||||||
|
echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td></tr>\n";
|
||||||
|
|
||||||
|
$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H');
|
||||||
|
$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H');
|
||||||
|
$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H');
|
||||||
|
$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H');
|
||||||
|
$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H');
|
||||||
|
$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H');
|
||||||
|
|
||||||
|
echo "<tr bgcolor=white>";
|
||||||
|
echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>";
|
||||||
|
echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n";
|
||||||
|
echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n";
|
||||||
|
echo "<td colspan=4><font size=2> </td></tr>\n";
|
||||||
|
|
||||||
|
echo "</TABLE></center><BR><BR>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
##### vicidial recordings for this time period #####
|
##### vicidial recordings for this time period #####
|
||||||
|
|
||||||
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
echo "<B>RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user