From 6b5dbbb5a02f5e697d7f97d007e2ae6c2d4358db Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 11 Dec 2007 20:39:13 +0000 Subject: [PATCH] added waiting calls detail display option to AST_timeonVDADall.php script git-svn-id: svn://192.168.202.10@745 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../trunk/www/vicidial/AST_timeonVDADall.php | 151 +++++++++++++++--- 1 file changed, 127 insertions(+), 24 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 93bacffc..044daf92 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -41,6 +41,8 @@ if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["RR"])) {$RR=$_GET["RR"];} elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} +if (isset($_GET["inbound"])) {$inbound=$_GET["inbound"];} + elseif (isset($_POST["inbound"])) {$inbound=$_POST["inbound"];} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];} @@ -65,7 +67,8 @@ if (isset($_GET["orderby"])) {$orderby=$_GET["orderby"];} elseif (isset($_POST["orderby"])) {$orderby=$_POST["orderby"];} if (isset($_GET["SERVdisplay"])) {$SERVdisplay=$_GET["SERVdisplay"];} elseif (isset($_POST["SERVdisplay"])) {$SERVdisplay=$_POST["SERVdisplay"];} - +if (isset($_GET["CALLSdisplay"])) {$CALLSdisplay=$_GET["CALLSdisplay"];} + elseif (isset($_POST["CALLSdisplay"])) {$CALLSdisplay=$_POST["CALLSdisplay"];} if (!isset($RR)) {$gRRroup=4;} @@ -75,6 +78,8 @@ if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name if (!isset($orderby)) {$orderby='timeup';} if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes +if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes + function get_server_load($windows = false) { $os = strtolower(PHP_OS); @@ -211,17 +216,34 @@ $F=''; $FG=''; $B=''; $BG=''; .b2 {color: black; background-color: #9999FF} .b3 {color: black; background-color: #6666FF} .b4 {color: white; background-color: #0000FF} ---> - + 0) + { + $g=0; + while ($g < $INgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $group_id[$g] = $row[0]; + $group_color[$g] = $row[1]; + echo " .$group_id[$g] {color: black; background-color: $group_color[$g]}\n"; + $g++; + } + } + +echo "\n-->\n +\n"; -\n"; -echo"\n"; +echo"\n"; echo "VICIDIAL: Time On VDAD Campaign: $group\n"; echo "
\n"; echo "VICIDIAL Campaign: \n"; @@ -235,6 +257,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; echo "\n"; } echo "         \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; echo "       MODIFY | \n"; echo "SUMMARY | \n"; echo "REPORTS \n"; @@ -436,31 +459,39 @@ echo ""; if ($adastats<2) { - echo "+ VIEW MORE SETTINGS"; + echo "+ VIEW MORE SETTINGS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; + echo "       VIEW USER GROUP"; } if ($UidORname>0) { - echo "       SHOW AGENT ID"; + echo "       SHOW AGENT ID"; } else { - echo "       SHOW AGENT NAME"; + echo "       SHOW AGENT NAME"; } if ($SERVdisplay>0) { - echo "       HIDE SERVER INFO"; + echo "       HIDE SERVER INFO"; } else { - echo "       SHOW SERVER INFO"; + echo "       SHOW SERVER INFO"; + } +if ($CALLSdisplay>0) + { + echo "       HIDE WAITING CALLS DETAIL"; + } +else + { + echo "       SHOW WAITING CALLS DETAIL"; } echo ""; echo ""; @@ -469,7 +500,7 @@ echo ""; echo "
\n\n"; } ################################################################################### -###### OUTBOUND CALLS +###### INBOUND/OUTBOUND CALLS ################################################################################### if ($campaign_allow_inbound > 0) { @@ -484,19 +515,31 @@ if ($campaign_allow_inbound > 0) $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type IN('OUT','OUTBALANCE')) ) order by campaign_id,call_time;"; } else { if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; + $stmtB="from vicidial_auto_calls where status NOT IN('XFER') $groupSQL order by campaign_id,call_time;"; } +if ($CALLSdisplay > 0) + { + $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type"; + } +else + { + $stmtA = "SELECT status"; + } + if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'"); } + +$k=0; +$stmt = "$stmtA $stmtB"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $parked_to_print = mysql_num_rows($rslt); @@ -511,7 +554,20 @@ $parked_to_print = mysql_num_rows($rslt); $row=mysql_fetch_row($rslt); if (eregi("LIVE",$row[0])) - {$out_live++;} + { + $out_live++; + + if ($CALLSdisplay > 0) + { + $CDstatus[$k] = $row[0]; + $CDcampaign_id[$k] = $row[1]; + $CDphone_number[$k] = $row[2]; + $CDserver_ip[$k] = $row[3]; + $CDcall_time[$k] = $row[4]; + $CDcall_type[$k] = $row[5]; + $k++; + } + } else { if (eregi("CLOSER",$row[0])) @@ -519,6 +575,7 @@ $parked_to_print = mysql_num_rows($rslt); else {$out_ring++;} } + $out_total++; $i++; } @@ -542,6 +599,51 @@ $parked_to_print = mysql_num_rows($rslt); } + +################################################################################### +###### CALLS WAITING +################################################################################### + +$Cecho = ''; +$Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE |\n"; +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+\n"; + +$p=0; +while($p<$k) + { + $Cstatus = sprintf("%-6s", $CDstatus[$p]); + $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); + $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); + $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); + + $Ccall_time_S = ($STARTtime - $CDcall_time[$p]); + $Ccall_time_M = ($Ccall_time_S / 60); + $Ccall_time_M = round($Ccall_time_M, 2); + $Ccall_time_M_int = intval("$Ccall_time_M"); + $Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int); + $Ccall_time_SEC = ($Ccall_time_SEC * 60); + $Ccall_time_SEC = round($Ccall_time_SEC, 0); + if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";} + $Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC"; + $Ccall_time_MS = sprintf("%7s", $Ccall_time_MS); + + $G = ''; $EG = ''; + if ($CDcall_type[$p] == 'IN') + { + $G=""; $EG=''; + } + $Cecho .= "| $G$Cstatus$EG | $G$Ccampaign_id$EG | $G$Cphone_number$EG | $G$Cserver_ip$EG | $G$Ccall_time_MS$EG | $G$Ccall_type$EG |\n"; + + $p++; + } +$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+\n\n"; + +if ($p<1) + {$Cecho='';} + ################################################################################### ###### TIME ON SYSTEM ################################################################################### @@ -552,7 +654,7 @@ $agent_paused=0; $agent_total=0; $Aecho = ''; -$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; +$Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n"; $HDbegin = "+"; @@ -560,9 +662,9 @@ $HTbegin = "|"; $HDstation = "------------+"; $HTstation = " STATION |"; $HDuser = "--------------------+"; -$HTuser = " USER |"; +$HTuser = " USER |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -574,9 +676,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; if ($UGdisplay < 1) { @@ -813,6 +915,7 @@ $talking_to_print = mysql_num_rows($rslt); echo "
";
 		echo "";
+		echo "$Cecho";
 		echo "$Aecho";
 	}
 	else