added DISPO status to timeonVDADall report

fixed VDAD stats Human Answered calculations
timeclock report calculations fixed for same day numbers

git-svn-id: svn://192.168.202.10@893 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-06-20 04:40:20 +00:00
parent 5f49414ff2
commit 8479ef9f94
8 changed files with 105 additions and 13 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ agent actions - used by vicidial.php, vdc_db_query.php and AST_VDremote_agents.p
UNPAUSE
PAUSEREASON
call actions before going to agent - used by agi-VDADtransfer scripts
call actions before going to agent - used by agi-VDAD_ALL_inbound/outbound scripts
ENTERQUEUE(url|callerid)
CONNECT(holdtime)
EXITWITHTIMEOUT(position)
+1
View File
@@ -5,6 +5,7 @@ Timeclock process flow 2008-05-12
This will outline the process I have thought through for adding a timeclock component to the VICIDIAL system. The objective is to add the following features to make VICIDIAL a more well-rounded product:
- Allow vicidial users to clock-in to the system
- Add a SHIFT section to administration
- Allow restrictions of agent-login by shift
- Allow ability to not allow agents to log-in to any VICIDIAL page(admin or agent) without clocking in.
- Have reports showing all timeclock totals for various parameters(user-group/campaign/time-period/in-groups/etc...)
+29
View File
@@ -0,0 +1,29 @@
NEW - New Lead - Lead has not been called, or cannot be called
QUEUE - Lead To Be Called - Lead is about to be sent to an agent
INCALL - Lead Being Called - Agent is talking to the lead
DROP - Agent Not Available - Call was dropped while customer was waiting for an agent
XDROP - Agent Not Available IN - Call was dropped while customer was waiting for an agent on an inbound call
NA - No Answer AutoDial - Any outbound call that does not receive an Answer signal(or other signal) from the carrier. This can include ring-no-answer, disconnected, carrier congestion and other errors
CALLBK - Call Back - Callback, both scheduled and non-scheduled
CBHOLD - Call Back Hold - Scheduled ANYONE callback that has not hit it's trigger, or an AGENTONLY callback
A - Answering Machine - Agent-defined Answering Machine
AA - Answering Machine Auto - Dialer-defined Answering Machine
AM - Answering Machine Sent to Mesg - AMD(Answering Machine Detection) call sent to a message to be played
AL - Answering Machine Msg Played - AMD(Answering Machine Detection) call sent to a message and message has been played
B - Busy - Carrier-received Busy signal, or agent-defined Busy if allowed
DC - Disconnected Number - Disconnected number
DEC - Declined Sale - Agent-defined status
DNC - DO NOT CALL - If defined, lead will also go int he VICIDIAL DNC list
DNCL - DO NOT CALL Hopper Match - status of a lead that matches the phone number of a lead that has been placed in the VICIDIAL DNC list
SALE - Sale Made - Agent-defined status
N - No Answer - Agent-defined status
NI - Not Interested - Agent-defined status
NP - No Pitch No Price - Agent-defined status
PU - Call Picked Up - Status that a call is changed to as soon as the carrier has sent the Answer signal and before the call is sent on to an agent
PM - Played Message - outbound broadcast or SURVEY campaign status for when a message has been played to the customer
XFER - Call Transferred - Call has been sent from an agent to a Closer agent
ERI - Agent Error - An agent has closed their browser before dispositioning a lead
SVYEXT - Survey sent to Extension - Survey outbound campaign status only
SVYVM - Survey sent to Voicemail - Survey outbound campaign status only
SVYHU - Survey Hungup - Survey outbound campaign status only
SVYREC - Survey sent to Record - Survey outbound campaign status only
@@ -239,6 +239,7 @@ INSERT INTO vicidial_statuses values('NP','No Pitch No Price','Y','Y','UNDEFINED
INSERT INTO vicidial_statuses values('PU','Call Picked Up','N','N','UNDEFINED');
INSERT INTO vicidial_statuses values('PM','Played Message','N','N','UNDEFINED');
INSERT INTO vicidial_statuses values('XFER','Call Transferred','Y','Y','UNDEFINED');
INSERT INTO vicidial_statuses values('ERI','Agent Error','N','N','UNDEFINED');
INSERT INTO vicidial_statuses values('SVYEXT','Survey sent to Extension','N','N','UNDEFINED');
INSERT INTO vicidial_statuses values('SVYVM','Survey sent to Voicemail','N','N','UNDEFINED');
INSERT INTO vicidial_statuses values('SVYHU','Survey Hungup','N','N','UNDEFINED');
+34 -4
View File
@@ -10,6 +10,7 @@
# 71008-1436 - Added shift to be defined in dbconnect.php
# 71218-1155 - Added end_date for multi-day reports
# 80430-1920 - Added Customer hangup cause stats
# 80620-0031 - Fixed human answered calculation for drop perfentage
#
header ("Content-type: text/html; charset=utf-8");
@@ -22,15 +23,17 @@ $PHP_SELF=$_SERVER['PHP_SELF'];
if (isset($_GET["group"])) {$group=$_GET["group"];}
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -195,7 +198,34 @@ $DROPcalls = sprintf("%10s", $row[0]);
$DROPcallsRAW = $row[0];
$DROPseconds = $row[1];
$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');";
# GET LIST OF HUMAN-ANSWERED STATUSES
$stmt = "SELECT status from vicidial_statuses where human_answered='Y';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$statuses_to_print = mysql_num_rows($rslt);
$p=0;
while ($p < $statuses_to_print)
{
$row=mysql_fetch_row($rslt);
$camp_ANS_STAT_SQL .= "'$row[0]',";
$p++;
}
$stmt = "SELECT status from vicidial_campaign_statuses where campaign_id='" . mysql_real_escape_string($group) . "' and human_answered='Y';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$statuses_to_print = mysql_num_rows($rslt);
$p=0;
while ($p < $statuses_to_print)
{
$row=mysql_fetch_row($rslt);
$camp_ANS_STAT_SQL .= "'$row[0]',";
$p++;
}
$camp_ANS_STAT_SQL = eregi_replace(",$",'',$camp_ANS_STAT_SQL);
$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN($camp_ANS_STAT_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -34,6 +34,7 @@
# 80422-1001 - Fixed sort by phone login
# 80424-0515 - Added non_latin lookup from system_settings
# 80525-1040 - Added IVR status display and summary for inbound calls
# 80619-2047 - Added DISPO status for post-call-work while paused
#
header ("Content-type: text/html; charset=utf-8");
@@ -785,7 +786,7 @@ else {$groupSQL = " and vicidial_live_agents.campaign_id='" . mysql_real_escape_
if (strlen($usergroup)<1) {$usergroupSQL = '';}
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $groupSQL $usergroupSQL order by $orderSQL;";
if ($non_latin > 0)
{
$rslt=mysql_query("SET NAMES 'UTF8'");
@@ -814,6 +815,7 @@ $talking_to_print = mysql_num_rows($rslt);
$Acomments[$i] = $row[11];
$Acalls_today[$i] = $row[12];
$Acallerid[$i] = $row[13];
$Alead_id[$i] = $row[14];
$i++;
}
@@ -883,6 +885,13 @@ $talking_to_print = mysql_num_rows($rslt);
if (eregi("READY|PAUSED",$Astatus[$i]))
{
$Acall_time[$i]=$Acall_finish[$i];
if ($Alead_id[$i] > 0)
{
$Astatus[$i] = 'DISPO';
$Lstatus = 'DISPO';
$status = ' DISPO';
}
}
if ($non_latin < 1)
{
@@ -920,7 +929,7 @@ $talking_to_print = mysql_num_rows($rslt);
{$CM='I';}
else
{$CM='M';}
}
}
}
else {$CM=' ';}
@@ -972,6 +981,19 @@ $talking_to_print = mysql_num_rows($rslt);
if ($call_time_M_int >= 5) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
# if ($call_time_M_int >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
}
if ($Lstatus=='DISPO')
{
if ($call_time_M_int >= 360)
{$j++; continue;}
else
{
$agent_paused++; $agent_total++;
$G=''; $EG='';
if ($call_time_S >= 10) {$G='<SPAN class="khaki"><B>'; $EG='</B></SPAN>';}
if ($call_time_M_int >= 1) {$G='<SPAN class="yellow"><B>'; $EG='</B></SPAN>';}
if ($call_time_M_int >= 5) {$G='<SPAN class="olive"><B>'; $EG='</B></SPAN>';}
}
}
if (eregi("PAUSED",$Astatus[$i]))
{
if ($call_time_M_int >= 360)
@@ -988,7 +1010,7 @@ $talking_to_print = mysql_num_rows($rslt);
# if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") )
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;}
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) or (eregi("DISPO",$status)) ) {$agent_incall++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) )
{
@@ -6,6 +6,7 @@
# CHANGES
#
# 80529-0055 - First build
# 80617-1416 - Fixed totals tally bug
#
require("dbconnect.php");
@@ -217,7 +218,8 @@ echo "<PRE><FONT SIZE=3>\n";
echo "VICIDIAL: User Timeclock Report $NOW_TIME\n";
echo "Time range: $query_date to $end_date\n\n";
echo "---------- USER TIMECLOCK DETAILS -------------\n</PRE>\n";
echo "---------- USER TIMECLOCK DETAILS -------------\n";
echo "These totals do NOT include any active sessions\n</PRE>\n";
echo "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n";
echo "<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n";
@@ -237,7 +239,7 @@ if ($order == 'name_down') {$order_SQL = "order by full_name desc";}
if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";}
else {$user_SQL='';}
$stmt="select vicidial_users.user,full_name,sum(login_sec) as login from vicidial_users,vicidial_timeclock_log where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL group by vicidial_users.user $order_SQL limit 100000;";
$stmt="select vicidial_users.user,full_name,sum(login_sec) as login from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL group by vicidial_users.user $order_SQL limit 100000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$rows_to_print = mysql_num_rows($rslt);
@@ -280,7 +282,7 @@ while ($j < $rows_to_print)
echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n";
echo "<TD><FONT class=\"data_records\">$user_id[$i] </TD>\n";
echo "<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n";
echo "<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n";
echo "<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n";
echo "</TR>\n";
+9 -2
View File
@@ -12,6 +12,7 @@
# 80117-0316 - Added vicidial_user_closer_log entries to display
# 80501-0506 - Added Hangup Reason to logs display
# 80523-2012 - Added vicidial timeclock records display
# 80617-1402 - Fixed timeclock total logged-in time
#
header ("Content-type: text/html; charset=utf-8");
@@ -278,6 +279,7 @@ echo "</TABLE></center>\n";
##### vicidial_timeclock log records for user #####
$total_login_time=0;
$SQday_ARY = explode('-',$begin_date);
$EQday_ARY = explode('-',$end_date);
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
@@ -338,7 +340,9 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f
echo "<td align=right><font size=2> $TC_log_date</td>\n";
echo "<td align=right><font size=2> $row[4]</td>\n";
echo "<td align=right><font size=2> $row[2]</td>\n";
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n";
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
if ($DB) {echo " - $total_login_time - $login_sec";}
echo "</td></tr>\n";
}
$o++;
}
@@ -346,15 +350,18 @@ if (strlen($login_sec)<1)
{
$login_sec = ($STARTtime - $row[1]);
$total_login_time = ($total_login_time + $login_sec);
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
}
$total_login_hours = ($total_login_time / 3600);
$total_login_hours_int = round($total_login_hours, 2);
$total_login_hours_int = intval("$total_login_hours");
$total_login_hours_int = intval("$total_login_hours_int");
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
$total_login_minutes = ($total_login_minutes * 60);
$total_login_minutes_int = round($total_login_minutes, 0);
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
if ($DB) {echo " - $total_login_time - $login_sec";}
echo "<tr><td align=right><font size=2> </td>";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";