diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php index 677ecda7..34e7c93f 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php @@ -60,10 +60,11 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.2.0-52'; +$build = '100303-0930'; header ("Content-type: text/html; charset=utf-8"); @@ -123,6 +124,8 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} ############################################# @@ -155,7 +158,7 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } @@ -216,8 +219,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -325,7 +338,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "
Select Campaigns:
"; +$select_list = "
Select Campaigns:
"; $select_list .= ""; $select_list .= "
(To select more than 1 campaign, hold down the Ctrl key and click)"; $select_list .= "
"; $select_list .= "Close Panel

"; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select User Group:
"; - $select_list .= "

"; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
"; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
"; +$select_list .= "Inbound:
 
"; + $select_list .= "Select User Group: "; + $select_list .= "
"; +$select_list .= "Dialable Leads Alert:
"; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSION: $version   BUILD: $build"; $select_list .= "
"; @@ -707,7 +739,7 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "Real-Time Report: $group\n"; $short_header=1; @@ -734,6 +766,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; echo "Real-Time Report                                                                               \n"; echo "\n"; echo ""; + } + +# http://svn.eflo.net:40080/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -1273,6 +1464,7 @@ else echo ""; echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; } echo ""; @@ -1293,60 +1485,60 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; + echo "       VIEW USER GROUP"; } 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"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS"; + echo "       SHOW WAITING CALLS"; } if ($ALLINGROUPstats>0) { - echo "       HIDE IN-GROUP STATS"; + echo "       HIDE IN-GROUP STATS"; } else { - echo "       SHOW IN-GROUP STATS"; + echo "       SHOW IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       HIDE PHONES"; + echo "       HIDE PHONES"; } else { - echo "       SHOW PHONES"; + echo "       SHOW PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       HIDE CUSTPHONES"; + echo "       HIDE CUSTPHONES"; } else { - echo "       SHOW CUSTPHONES"; + echo "       SHOW CUSTPHONES"; } echo ""; echo ""; @@ -1590,25 +1782,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; if ($UidORname>0) { - $HTuser .= "SHOW ID "; + $HTuser .= "SHOW ID "; } else { - $HTuser .= "SHOW NAME"; + $HTuser .= "SHOW NAME"; } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1622,9 +1814,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 |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 67db5eda..34e7c93f 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -60,10 +60,11 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.2.0-52'; +$build = '100303-0930'; header ("Content-type: text/html; charset=utf-8"); @@ -123,6 +124,8 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} ############################################# @@ -216,8 +219,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -325,7 +338,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "
\n"; @@ -743,9 +776,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFY | \n"; @@ -964,6 +997,164 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
"; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
     $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
no log entries
"; + $CARRIERstatsHTML .= "
Select Campaigns:
"; +$select_list = "
Select Campaigns:
"; $select_list .= ""; $select_list .= "
(To select more than 1 campaign, hold down the Ctrl key and click)"; $select_list .= "
"; $select_list .= "Close Panel

"; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select User Group:
"; - $select_list .= "

"; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
"; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
"; +$select_list .= "Inbound:
 
"; + $select_list .= "Select User Group: "; + $select_list .= "
"; +$select_list .= "Dialable Leads Alert:
"; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSION: $version   BUILD: $build"; $select_list .= "
"; @@ -707,7 +739,7 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "Real-Time Report: $group\n"; $short_header=1; @@ -734,6 +766,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; echo "Real-Time Report                                                                               \n"; echo "\n"; echo ""; + } + +# http://svn.eflo.net:40080/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -1273,6 +1464,7 @@ else echo ""; echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; } echo ""; @@ -1293,60 +1485,60 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; + echo "       VIEW USER GROUP"; } 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"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS"; + echo "       SHOW WAITING CALLS"; } if ($ALLINGROUPstats>0) { - echo "       HIDE IN-GROUP STATS"; + echo "       HIDE IN-GROUP STATS"; } else { - echo "       SHOW IN-GROUP STATS"; + echo "       SHOW IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       HIDE PHONES"; + echo "       HIDE PHONES"; } else { - echo "       SHOW PHONES"; + echo "       SHOW PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       HIDE CUSTPHONES"; + echo "       HIDE CUSTPHONES"; } else { - echo "       SHOW CUSTPHONES"; + echo "       SHOW CUSTPHONES"; } echo ""; echo ""; @@ -1590,25 +1782,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; if ($UidORname>0) { - $HTuser .= "SHOW ID "; + $HTuser .= "SHOW ID "; } else { - $HTuser .= "SHOW NAME"; + $HTuser .= "SHOW NAME"; } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1622,9 +1814,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 |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = '';
\n"; @@ -743,9 +776,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFY | \n"; @@ -964,6 +997,164 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
"; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
     $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
no log entries
"; + $CARRIERstatsHTML .= "