From 14878bc37d0848d14f63d86483b955591eaf79d6 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 2 Nov 2006 17:11:23 +0000 Subject: [PATCH] Added a few new display options to AST_timeonVDADall.php script including modurizing the columns a bit more and allowing for hiding of the server info git-svn-id: svn://192.168.202.10@369 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../trunk/www/vicidial/AST_timeonVDADall.php | 126 +++++++++++------- 1 file changed, 81 insertions(+), 45 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 855319c4..f12d4cf0 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -21,6 +21,7 @@ # 61002-1642 - Added TRUNK SHORT/FILL stats # 61101-1318 - Added SIP and IAX Listen and Barge links option # 61101-1647 - Added Usergroup column and user name option as well as sorting +# 61102-1155 - made display of columns more modular, added ability to hide server info # header ("Content-type: text/html; charset=utf-8"); @@ -58,6 +59,8 @@ if (isset($_GET["UidORname"])) {$UidORname=$_GET["UidORname"];} elseif (isset($_POST["UidORname"])) {$UidORname=$_POST["UidORname"];} 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"];} @@ -67,6 +70,7 @@ if (!isset($usergroup)) {$usergroup='';} 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 function get_server_load($windows = false) { $os = strtolower(PHP_OS); @@ -204,7 +208,7 @@ if ($reset_counter > 7) \n"; -echo"\n"; +echo"\n"; echo "VICIDIAL: Time On VDAD Campaign: $group\n"; echo "
\n"; echo "VICIDIAL: Realtime Campaign: \n"; @@ -217,6 +221,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 | REPORTS \n"; echo "\n\n"; @@ -367,23 +372,31 @@ 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"; + } +else + { + echo "       SHOW SERVER INFO"; } echo ""; echo ""; @@ -470,40 +483,59 @@ $Aecho = ''; $Aecho .= "VICIDIAL: Agents Time On Calls Campaign: $group $NOW_TIME\n\n"; -if ($UGdisplay > 0) +$HDbegin = "+"; +$HTbegin = "|"; +$HDstation = "------------+"; +$HTstation = " STATION |"; +$HDuser = "--------------------+"; +$HTuser = " USER |"; +$HDusergroup = "--------------+"; +$HTusergroup = " USER GROUP |"; +$HDsessionid = "------------------+"; +$HTsessionid = " SESSIONID |"; +$HDbarge = "-------+"; +$HTbarge = " BARGE |"; +$HDstatus = "--------+"; +$HTstatus = " STATUS |"; +$HDserver_ip = "-----------------+"; +$HTserver_ip = " SERVER IP |"; +$HDcall_server_ip = "-----------------+"; +$HTcall_server_ip = " CALL SERVER IP |"; +$HDtime = "---------+"; +$HTtime = " MM:SS |"; +$HDcampaign = "------------+"; +$HTcampaign = " CAMPAIGN |"; + +if ($UGdisplay < 1) { - if ( ($SIPmonitorLINK>0) or ($IAXmonitorLINK>0) ) - { - $Aline = "+------------|------------+--------------+------------------+-------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= "$Aline"; - $Aecho .= "| STATION | USER | USER GROUP | SESSIONID | BARGE | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; - $Aecho .= "$Aline"; - } - else - { - $Aline = "+------------|------------+--------------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= "$Aline"; - $Aecho .= "| STATION | USER | USER GROUP | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; - $Aecho .= "$Aline"; - } + $HDusergroup = ''; + $HTusergroup = ''; } -else +if ( ($SIPmonitorLINK<1) && ($IAXmonitorLINK<1) ) { - if ( ($SIPmonitorLINK>0) or ($IAXmonitorLINK>0) ) - { - $Aline = "+------------|------------+------------------+-------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= "$Aline"; - $Aecho .= "| STATION | USER | SESSIONID | BARGE | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; - $Aecho .= "$Aline"; - } - else - { - $Aline = "+------------|------------+-----------+--------+-----------------+-----------------+---------+------------+\n"; - $Aecho .= "$Aline"; - $Aecho .= "| STATION | USER | SESSIONID | STATUS | SERVER IP | CALL SERVER IP | MM:SS | CAMPAIGN |\n"; - $Aecho .= "$Aline"; - } + $HDsessionid = "-----------+"; + $HTsessionid = " SESSIONID |"; } +if ( ($SIPmonitorLINK<2) && ($IAXmonitorLINK<2) ) + { + $HDbarge = ''; + $HTbarge = ''; + } +if ($SERVdisplay < 1) + { + $HDserver_ip = ''; + $HTserver_ip = ''; + $HDcall_server_ip = ''; + $HTcall_server_ip = ''; + } + + + +$Aline = "$HDbegin$HDstation$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign\n"; +$Bline = "$HTbegin$HTstation$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign\n"; +$Aecho .= "$Aline"; +$Aecho .= "$Bline"; +$Aecho .= "$Aline"; if ($orderby=='timeup') {$orderSQL='status,last_call_time';} if ($orderby=='timedown') {$orderSQL='status desc,last_call_time desc';} @@ -549,7 +581,7 @@ $talking_to_print = mysql_num_rows($rslt); $extension = sprintf("%-10s", $extension); while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} $Luser = $row[1]; - $user = sprintf("%-10s", $row[1]); + $user = sprintf("%-18s", $row[1]); $Lsessionid = $row[2]; $sessionid = sprintf("%-9s", $row[2]); $Lstatus = $row[3]; @@ -564,8 +596,8 @@ $talking_to_print = mysql_num_rows($rslt); } if ($UidORname > 0) { - $user = sprintf("%-10s", $row[10]); - while(strlen($user)>10) {$user = substr("$user", 0, -1);} + $user = sprintf("%-18s", $row[10]); + while(strlen($user)>18) {$user = substr("$user", 0, -1);} } if (!eregi("INCALL|QUEUE",$row[3])) {$call_time_S = ($STARTtime - $row[6]);} @@ -616,16 +648,20 @@ $talking_to_print = mysql_num_rows($rslt); $L=''; $R=''; - if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R=' | ';} - if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R=' | ';} + if ($SIPmonitorLINK>0) {$L=" LISTEN"; $R='';} + if ($IAXmonitorLINK>0) {$L=" LISTEN"; $R='';} if ($SIPmonitorLINK>1) {$R=" | BARGE";} if ($IAXmonitorLINK>1) {$R=" | BARGE";} if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} + if ($SERVdisplay > 0) {$SVD = "$G$server_ip$EG | $G$call_server_ip$EG | ";} + else {$SVD = "";} + $agentcount++; - $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG | $G$server_ip$EG | $G$call_server_ip$EG | $G$call_time_MS$EG | $G$campaign_id$EG |\n"; + + $Aecho .= "| $G$extension$EG | $G$user$EG |$UGD $G$sessionid$EG$L$R | $G$status$EG | $SVD$G$call_time_MS$EG | $G$campaign_id$EG |\n"; $i++; }