more PHP7 fixes for admin scripts
git-svn-id: svn://192.168.202.10@3138 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_CLOSER_service_level.php
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -41,6 +41,7 @@
|
||||
# 170829-0040 - Added screen color settings
|
||||
# 171012-2015 - Fixed javascript/apache errors with graphs
|
||||
# 180502-2115 - Added new help display
|
||||
# 190930-1647 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -304,6 +305,8 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$groups=array();
|
||||
$group_names=array();
|
||||
$groups_string='|';
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
@@ -534,6 +537,8 @@ $CSV_text.="\n";
|
||||
$CSV_text.="\""._QXZ("Time range")." $DURATIONday "._QXZ("days").":\",\"$query_date_BEGIN "._QXZ("to")." $query_date_END\"\n\n";
|
||||
|
||||
$d=0;
|
||||
$daySTART=array();
|
||||
$dayEND=array();
|
||||
while ($d < $DURATIONday)
|
||||
{
|
||||
$dSQepoch = ($SQepoch + ($d * 86400) );
|
||||
@@ -570,6 +575,12 @@ if ($SQtime_ARY[1] > 14)
|
||||
}
|
||||
if ($SQtime_ARY[1] > 29) {$h=2;}
|
||||
if ($SQtime_ARY[1] > 44) {$h=3;}
|
||||
|
||||
$HMdisplay=array();
|
||||
$HMstart=array();
|
||||
$HMend=array();
|
||||
$HMSepoch=array();
|
||||
$HMEepoch=array();
|
||||
while ($i < 96)
|
||||
{
|
||||
$startSEC = ($startSEC + 900);
|
||||
@@ -640,6 +651,11 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$records_to_grab = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$qs=array();
|
||||
$dt=array();
|
||||
$ut=array();
|
||||
$ls=array();
|
||||
$st=array();
|
||||
while ($i < $records_to_grab)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -664,6 +680,34 @@ while ($i < $records_to_grab)
|
||||
}
|
||||
|
||||
### PARSE THROUGH ALL RECORDS AND GENERATE STATS ###
|
||||
$MT=array();
|
||||
$hd__0=array();
|
||||
$hd_20=array();
|
||||
$hd_40=array();
|
||||
$hd_60=array();
|
||||
$hd_80=array();
|
||||
$hd100=array();
|
||||
$hd120=array();
|
||||
$hd121=array();
|
||||
$jd__0=array();
|
||||
$jd_20=array();
|
||||
$jd_40=array();
|
||||
$jd_60=array();
|
||||
$jd_80=array();
|
||||
$jd100=array();
|
||||
$jd120=array();
|
||||
$jd121=array();
|
||||
$Phd__0=array();
|
||||
$Phd_20=array();
|
||||
$Phd_40=array();
|
||||
$Phd_60=array();
|
||||
$Phd_80=array();
|
||||
$Phd100=array();
|
||||
$Phd120=array();
|
||||
$Phd121=array();
|
||||
$totCALLSsecDATE=array();
|
||||
$totDROPSsecDATE=array();
|
||||
$totQUEUEsecDATE=array();
|
||||
$MT[0]='0';
|
||||
$totCALLS=0;
|
||||
$totDROPS=0;
|
||||
@@ -692,6 +736,7 @@ $qrtQUEUEmax=$MT;
|
||||
$j=0;
|
||||
while ($j < $TOTintervals)
|
||||
{
|
||||
$hd__0[$j]=0; $hd_20[$j]=0; $hd_40[$j]=0; $hd_60[$j]=0; $hd_80[$j]=0; $hd100[$j]=0; $hd120[$j]=0; $hd121[$j]=0;
|
||||
$jd__0[$j]=0; $jd_20[$j]=0; $jd_40[$j]=0; $jd_60[$j]=0; $jd_80[$j]=0; $jd100[$j]=0; $jd120[$j]=0; $jd121[$j]=0;
|
||||
$Phd__0[$j]=0; $Phd_20[$j]=0; $Phd_40[$j]=0; $Phd_60[$j]=0; $Phd_80[$j]=0; $Phd100[$j]=0; $Phd120[$j]=0; $Phd121[$j]=0;
|
||||
$qrtCALLS[$j]=0; $qrtCALLSsec[$j]=0; $qrtCALLSmax[$j]=0;
|
||||
@@ -765,6 +810,13 @@ $CSV_text.="\""._QXZ("SHIFT DATE-TIME RANGE")."\",\""._QXZ("DROPS")."\",\" "._QX
|
||||
|
||||
|
||||
$graph_stats=array();
|
||||
$totDROPSpctDATE=array();
|
||||
$totDROPSavgDATE=array();
|
||||
$totQUEUEpctDATE=array();
|
||||
$totQUEUEavgDATE=array();
|
||||
$totQUEUEtotDATE=array();
|
||||
$totCALLSavgDATE=array();
|
||||
|
||||
$max_drops=1;
|
||||
$max_droppct=1;
|
||||
$max_avgdrops=1;
|
||||
@@ -822,10 +874,10 @@ while ($d < $DURATIONday)
|
||||
$graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d]));
|
||||
$graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d]));
|
||||
$graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d]));
|
||||
$graph_stats[$d][8]=trim($totCALLSdate[$d]);
|
||||
$graph_stats[$d][9]=trim($totCALLSsecDATE[$d]);
|
||||
$graph_stats[$d][8]=trim($totCALLSdate[$d]+0);
|
||||
$graph_stats[$d][9]=trim($totCALLSsecDATE[$d]+0);
|
||||
$graph_stats[$d][10]=trim($totTIME_MS);
|
||||
$graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d]));
|
||||
$graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d]+0));
|
||||
|
||||
$totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]);
|
||||
$totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]);
|
||||
@@ -1363,6 +1415,10 @@ $CSV_text.="\""._QXZ("CALL HOLD TIME BREAKDOWN IN SECONDS")."\"\n";
|
||||
$CSV_text.="\""._QXZ("TIME 15-MIN INT")."\",\""._QXZ("CALLS")."\",\"0 ("._QXZ("seconds").")\",\"20\",\"40\",\"60\",\"80\",\"100\",\"120\",\"120+\",\""._QXZ("AVG TIME BEFORE ANSWER(SEC)")."\"\n";
|
||||
|
||||
$APhd__0=0; $APhd_20=0; $APhd_40=0; $APhd_60=0; $APhd_80=0; $APhd100=0; $APhd120=0; $APhd121=0;
|
||||
$ALLhd__0=0; $ALLhd_20=0; $ALLhd_40=0; $ALLhd_60=0; $ALLhd_80=0; $ALLhd100=0; $ALLhd120=0; $ALLhd121=0;
|
||||
$Aavg_hold=array();
|
||||
$qrtQUEUEavg_scale=array();
|
||||
$qrtQUEUEavg_val=array();
|
||||
$h=0;
|
||||
while ($h < $TOTintervals)
|
||||
{
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
# 180323-2306 - Fix for user time calculation, subtracted queue_seconds
|
||||
# 180712-1508 - Fix for rare allowed reports issue
|
||||
# 190508-1900 - Streamlined DID check to optimize page load
|
||||
# 190930-1345 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -306,6 +307,9 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTgroups=array();
|
||||
$LISTgroup_names=array();
|
||||
$LISTgroup_ids=array();
|
||||
$LISTgroups[$i]='---NONE---';
|
||||
$i++;
|
||||
$groups_to_print++;
|
||||
@@ -408,6 +412,9 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$statcats_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$vsc_id=array();
|
||||
$vsc_name=array();
|
||||
$vsc_count=array();
|
||||
while ($i < $statcats_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -616,7 +623,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
|
||||
$did_id=array();
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
|
||||
@@ -657,6 +664,7 @@ if ($DID=='Y')
|
||||
|
||||
}
|
||||
|
||||
$graph_data_ary=array();
|
||||
if ($group_ct > 1)
|
||||
{
|
||||
$ASCII_text.="\n";
|
||||
@@ -1003,6 +1011,12 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$statuses_to_print = mysqli_num_rows($rslt);
|
||||
$p=0;
|
||||
$status=array();
|
||||
$status_name=array();
|
||||
$human_answered=array();
|
||||
$category=array();
|
||||
$statname_list=array();
|
||||
$statcat_list=array();
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -1165,6 +1179,8 @@ $CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"
|
||||
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$graph_stats=array();
|
||||
$sec_ary=array();
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
@@ -2094,6 +2110,7 @@ $max_calls=1;
|
||||
$max_total_time=1;
|
||||
$max_avg_time=1;
|
||||
$max_callshr=1;
|
||||
$graph_stats=array();
|
||||
###########################
|
||||
|
||||
while ($i < $statuses_to_print)
|
||||
@@ -2498,6 +2515,7 @@ $CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$graph_stats=array();
|
||||
$queue_position=array();
|
||||
$stmt="select count(*),queue_position as qp from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
|
||||
@@ -2857,6 +2875,11 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$calls_to_print = mysqli_num_rows($rslt);
|
||||
$j=0;
|
||||
$Cstatus=array();
|
||||
$Cqueue=array();
|
||||
$Cepoch=array();
|
||||
$Cdate=array();
|
||||
$Crem=array();
|
||||
while ($j < $calls_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -2873,6 +2896,23 @@ while ($j < $calls_to_print)
|
||||
|
||||
### Loop through all call records and gather stats for total call/drop report and answered report
|
||||
$j=0;
|
||||
$Ftotal=array();
|
||||
$Fdrop=array();
|
||||
$adB_0=array();
|
||||
$adB_5=array();
|
||||
$adB10=array();
|
||||
$adB15=array();
|
||||
$adB20=array();
|
||||
$adB25=array();
|
||||
$adB30=array();
|
||||
$adB35=array();
|
||||
$adB40=array();
|
||||
$adB45=array();
|
||||
$adB50=array();
|
||||
$adB55=array();
|
||||
$adB60=array();
|
||||
$adB90=array();
|
||||
$adB99=array();
|
||||
while ($j < $calls_to_print)
|
||||
{
|
||||
$i=0; $sec=0; $sec_end=900;
|
||||
@@ -2923,6 +2963,8 @@ $hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
$hour_count=array();
|
||||
$drop_count=array();
|
||||
while ($i <= 96)
|
||||
{
|
||||
$hour_count[$i] = $Ftotal[$i];
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
# 180323-2307 - Fix for user time calculation, subtracted queue_seconds
|
||||
# 180712-1508 - Fix for rare allowed reports issue
|
||||
# 190508-1901 - Streamlined DID check to optimize page load
|
||||
# 190930-1345 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -315,6 +316,9 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTgroups=array();
|
||||
$LISTgroup_names=array();
|
||||
$LISTgroup_ids=array();
|
||||
$LISTgroups[$i]='---NONE---';
|
||||
$i++;
|
||||
$groups_to_print++;
|
||||
@@ -417,6 +421,9 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$statcats_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$vsc_id=array();
|
||||
$vsc_name=array();
|
||||
$vsc_count=array();
|
||||
while ($i < $statcats_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -906,7 +913,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
|
||||
$did_id=array();
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL) $LOGadmin_viewable_groupsSQL;";
|
||||
@@ -946,6 +953,7 @@ if ($DID=='Y')
|
||||
|
||||
}
|
||||
|
||||
$graph_data_ary=array();
|
||||
if ($group_ct > 1)
|
||||
{
|
||||
$ASCII_text.="\n";
|
||||
@@ -1332,6 +1340,12 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$statuses_to_print = mysqli_num_rows($rslt);
|
||||
$p=0;
|
||||
$status=array();
|
||||
$status_name=array();
|
||||
$human_answered=array();
|
||||
$category=array();
|
||||
$statname_list=array();
|
||||
$statcat_list=array();
|
||||
while ($p < $statuses_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -1512,6 +1526,7 @@ $CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"
|
||||
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$graph_stats=array();
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
@@ -2108,6 +2123,7 @@ $CSV_text2.="\""._QXZ("CUM ANS")." %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$graph_stats=array();
|
||||
$sec_ary=array();
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;";
|
||||
@@ -2438,6 +2454,7 @@ $max_calls=1;
|
||||
$max_total_time=1;
|
||||
$max_avg_time=1;
|
||||
$max_callshr=1;
|
||||
$graph_stats=array();
|
||||
###########################
|
||||
|
||||
while ($i < $statuses_to_print)
|
||||
@@ -2842,6 +2859,7 @@ $CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$graph_stats=array();
|
||||
$queue_position=array();
|
||||
$stmt="select count(*),queue_position as qp from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $calldate_call_time_clause and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
|
||||
@@ -3203,6 +3221,11 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$calls_to_print = mysqli_num_rows($rslt);
|
||||
$j=0;
|
||||
$Cstatus=array();
|
||||
$Cqueue=array();
|
||||
$Cepoch=array();
|
||||
$Cdate=array();
|
||||
$Crem=array();
|
||||
while ($j < $calls_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -3219,6 +3242,23 @@ while ($j < $calls_to_print)
|
||||
|
||||
### Loop through all call records and gather stats for total call/drop report and answered report
|
||||
$j=0;
|
||||
$Ftotal=array();
|
||||
$Fdrop=array();
|
||||
$adB_0=array();
|
||||
$adB_5=array();
|
||||
$adB10=array();
|
||||
$adB15=array();
|
||||
$adB20=array();
|
||||
$adB25=array();
|
||||
$adB30=array();
|
||||
$adB35=array();
|
||||
$adB40=array();
|
||||
$adB45=array();
|
||||
$adB50=array();
|
||||
$adB55=array();
|
||||
$adB60=array();
|
||||
$adB90=array();
|
||||
$adB99=array();
|
||||
while ($j < $calls_to_print)
|
||||
{
|
||||
$i=0; $sec=0; $sec_end=900;
|
||||
@@ -3269,6 +3309,8 @@ $hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
$hour_count=array();
|
||||
$drop_count=array();
|
||||
while ($i <= 96)
|
||||
{
|
||||
$hour_count[$i] = $Ftotal[$i];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_rt_whiteboard_rpt.php
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Real-time report that allows users to create a customized, graphical display of various data sets
|
||||
#
|
||||
@@ -9,6 +9,7 @@
|
||||
# 180129-1745 - Translation corrections, uses vicidial_state_report_functions.php instead of vicidial_state_report_functions.js
|
||||
# 180507-2315 - Added new help display
|
||||
# 180512-0000 - Fixed slave server capability
|
||||
# 190927-1758 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -126,7 +127,7 @@ if ($sl_ct > 0)
|
||||
$auth=0;
|
||||
$reports_auth=0;
|
||||
$admin_auth=0;
|
||||
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1);
|
||||
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0);
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
@@ -238,6 +239,17 @@ $LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
|
||||
|
||||
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||
@@ -246,6 +258,21 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($campaigns)) {$campaigns = array();}
|
||||
if (!isset($users)) {$users = array();}
|
||||
if (!isset($user_groups)) {$user_groups = array();}
|
||||
if (!isset($dids)) {$dids = array();}
|
||||
if (!isset($groups)) {$groups = array();}
|
||||
if (!isset($report_display_type)) {$report_display_type = "HTML";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
|
||||
$stmt="SELECT campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -253,6 +280,7 @@ $campaigns_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$campaign_string='|';
|
||||
$campaigns_selected=count($campaigns);
|
||||
$campaign_list=array();
|
||||
while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -280,6 +308,8 @@ if ($DB) {$MAIN.="$stmt\n";}
|
||||
$users_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$user_array=array(); # For quick full-name reference
|
||||
$user_list=array();
|
||||
$user_names=array();
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -303,6 +333,8 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$user_groups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$user_group_list=array();
|
||||
$user_group_names=array();
|
||||
$user_group_array=array(); # For quick full-name reference
|
||||
while ($i < $user_groups_to_print)
|
||||
{
|
||||
@@ -323,6 +355,9 @@ $i=0;
|
||||
#$i++;
|
||||
# $groups_to_print++;
|
||||
$groups_string='|';
|
||||
$LISTgroups=array();
|
||||
$LISTgroup_names=array();
|
||||
$LISTgroup_ids=array();
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -371,6 +406,9 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$dids_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$did_pattern=array();
|
||||
$did_description=array();
|
||||
$did_ids=array();
|
||||
$did_array=array(); # For quick full-name reference
|
||||
while ($i < $dids_to_print)
|
||||
{
|
||||
@@ -382,21 +420,6 @@ while ($i < $dids_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($campaigns)) {$campaign = array();}
|
||||
if (!isset($users)) {$users = array();}
|
||||
if (!isset($user_groups)) {$user_groups = array();}
|
||||
if (!isset($dids)) {$dids = array();}
|
||||
if (!isset($groups)) {$groups = array();}
|
||||
if (!isset($report_display_type)) {$report_display_type = "HTML";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$i=0;
|
||||
$campaigns_string='|';
|
||||
$campaign_ct = count($campaigns);
|
||||
|
||||
@@ -114,10 +114,11 @@
|
||||
# 190513-1711 - Added ingroup filter
|
||||
# 190525-2133 - Added new agent time segment display
|
||||
# 190531-1454 - Upgraded ingroup filter
|
||||
# 190927-1759 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$version = '2.14-100';
|
||||
$build = '190525-2133';
|
||||
$version = '2.14-101';
|
||||
$build = '190927-1759';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -254,6 +255,7 @@ if (!isset($RR)) {$RR=40;}
|
||||
if (!isset($group)) {$group='ALL-ACTIVE';}
|
||||
if (!isset($groups)) {$groups=array();}
|
||||
if (!isset($user_group_filter)) {$user_group_filter=array();}
|
||||
if (!isset($ingroup_filter)) {$ingroup_filter=array();}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
|
||||
@@ -542,6 +544,8 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTgroups=array();
|
||||
$LISTnames=array();
|
||||
$LISTgroups[$i]='ALL-ACTIVE';
|
||||
$i++;
|
||||
$groups_to_print++;
|
||||
@@ -693,6 +697,8 @@ if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$usergroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$usergroups=array();
|
||||
$usergroupnames=array();
|
||||
$usergroups[$i]='ALL-GROUPS';
|
||||
$usergroupnames[$i] = 'All user groups';
|
||||
$i++;
|
||||
@@ -709,6 +715,8 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$ingroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTingroups=array();
|
||||
$LISTingroup_names=array();
|
||||
$LISTingroups[$i]='ALL-INGROUPS';
|
||||
$i++;
|
||||
$ingroups_to_print++;
|
||||
@@ -1540,6 +1548,15 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) )
|
||||
$CARRIERstatsHTML='';
|
||||
if ($CARRIERstats > 0)
|
||||
{
|
||||
$TFhour_status=array();
|
||||
$TFhour_count=array();
|
||||
$TFhour_total=array();
|
||||
$SIXhour_count=array();
|
||||
$ONEhour_count=array();
|
||||
$FTminute_count=array();
|
||||
$FIVEminute_count=array();
|
||||
$ONEminute_count=array();
|
||||
|
||||
if ($cache_carrier_stats_realtime > 0)
|
||||
{
|
||||
$stmtB="SELECT stats_html from vicidial_html_cache_stats where stats_type='carrier_stats' and stats_id='ALL';";
|
||||
@@ -2321,6 +2338,15 @@ $out_ring=0;
|
||||
$out_live=0;
|
||||
$in_ivr=0;
|
||||
$D_active_calls=0;
|
||||
$CDstatus=array();
|
||||
$CDcampaign_id=array();
|
||||
$CDphone_number=array();
|
||||
$CDserver_ip=array();
|
||||
$CDcall_time=array();
|
||||
$CDcall_type=array();
|
||||
$CDqueue_priority=array();
|
||||
$CDagent_only=array();
|
||||
|
||||
$stmt = "$stmtA $stmtB";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -3006,6 +3032,28 @@ if ( (preg_match('/ALL\-GROUPS/i',$user_group_string)) and (strlen($user_group_S
|
||||
else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";}
|
||||
|
||||
$ring_agents=0;
|
||||
$Aextension=array();
|
||||
$Auser=array();
|
||||
$Asessionid=array();
|
||||
$Astatus=array();
|
||||
$Aserver_ip=array();
|
||||
$Acall_time=array();
|
||||
$Acall_finish=array();
|
||||
$Acall_server_ip=array();
|
||||
$Acampaign_id=array();
|
||||
$Auser_group=array();
|
||||
$Afull_name=array();
|
||||
$Acomments=array();
|
||||
$Acalls_today=array();
|
||||
$Acallerid=array();
|
||||
$Alead_id=array();
|
||||
$Astate_change=array();
|
||||
$Aon_hook_agent=array();
|
||||
$Aring_callerid=array();
|
||||
$Aagent_log_id=array();
|
||||
$Aring_note=array();
|
||||
$VAClead_ids=array();
|
||||
$VACphones=array();
|
||||
$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,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and vicidial_users.user_hide_realtime='0' $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_timeonVDADallSUMMARY.php
|
||||
#
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||
#
|
||||
@@ -30,6 +30,7 @@
|
||||
# 141001-2200 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-0038 - Added code for on-the-fly language translations display
|
||||
# 170409-1534 - Added IP List validation code
|
||||
# 190927-1300 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
@@ -210,6 +211,7 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$groups=array();
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
|
||||
@@ -4523,12 +4523,13 @@ else
|
||||
# 190722-1602 - Added ENABLED_EXTENDED_RANGE Agent Screen Time campaign option
|
||||
# 190724-1603 - Added sip_event_logging campaign actions
|
||||
# 190902-0839 - Fixes for PHP 7.2
|
||||
# 190930-2110 - More PHP7 fixes
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
|
||||
|
||||
$admin_version = '2.14-718a';
|
||||
$build = '190902-0839';
|
||||
$admin_version = '2.14-719a';
|
||||
$build = '190930-2110';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -38612,6 +38613,14 @@ if ($ADD==130)
|
||||
echo "<TD><font size=1 color=white>"._QXZ("MODIFY")."</TD>\n";
|
||||
echo "</TR>\n";
|
||||
|
||||
$dl_id_ary = $MT;
|
||||
$dl_name_ary = $MT;
|
||||
$last_run_ary = $MT;
|
||||
$dl_active_ary = $MT;
|
||||
$list_id_ary = $MT;
|
||||
$group_group_ary = $MT;
|
||||
$closer_campaigns_ary = $MT;
|
||||
|
||||
$o=0;
|
||||
while ($droplists_to_print > $o)
|
||||
{
|
||||
@@ -38683,6 +38692,14 @@ if ($ADD==1000)
|
||||
echo "<TD><font size=1 color=white>"._QXZ("MODIFY")."</TD>\n";
|
||||
echo "</TR>\n";
|
||||
|
||||
$group_id_ary = $MT;
|
||||
$group_name_ary = $MT;
|
||||
$group_priority_ary = $MT;
|
||||
$group_active_ary = $MT;
|
||||
$group_time_ary = $MT;
|
||||
$group_color_ary = $MT;
|
||||
$group_group_ary = $MT;
|
||||
|
||||
$o=0;
|
||||
while ($ingroups_to_print > $o)
|
||||
{
|
||||
@@ -38986,6 +39003,10 @@ if ($ADD==1500)
|
||||
|
||||
$o=0;
|
||||
$menu_id = $MT;
|
||||
$menu_name = $MT;
|
||||
$menu_prompt = $MT;
|
||||
$menu_timeout = $MT;
|
||||
$menu_group = $MT;
|
||||
|
||||
while ($menus_to_print > $o)
|
||||
{
|
||||
@@ -40683,6 +40704,8 @@ if ($ADD==710000000000000)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$user_name='';
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$names_to_print = mysqli_num_rows($rslt);
|
||||
@@ -41085,6 +41108,8 @@ if ($ADD==810000000000000)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$user_name='';
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$stage' $LOGadmin_viewable_groupsSQL;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$names_to_print = mysqli_num_rows($rslt);
|
||||
@@ -41225,6 +41250,17 @@ if ($ADD==999999)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$server_id=$MT;
|
||||
$server_description=$MT;
|
||||
$server_ip=$MT;
|
||||
$active=$MT;
|
||||
$sysload=$MT;
|
||||
$channels_total=$MT;
|
||||
$cpu_idle_percent=$MT;
|
||||
$disk_usage=$MT;
|
||||
$active_agent_login_server=$MT;
|
||||
$active_asterisk_server=$MT;
|
||||
|
||||
$stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage,active_agent_login_server,active_asterisk_server from servers order by server_id;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
@@ -46,12 +46,13 @@
|
||||
# 190420-1729 - Added RS_ListenBarge options.php setting
|
||||
# 190513-1711 - Added ingroup filter
|
||||
# 190525-2205 - Added rust color definition
|
||||
# 190927-1758 - Fixed PHP7 array issue
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
|
||||
$version = '2.14-33';
|
||||
$build = '190525-2205';
|
||||
$version = '2.14-34';
|
||||
$build = '190927-1758';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -266,6 +267,8 @@ $ingroup_detail='';
|
||||
|
||||
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group;}
|
||||
else {$group = $groups[0];}
|
||||
if (!isset($user_group_filter)) {$user_group_filter=array();}
|
||||
if (!isset($ingroup_filter)) {$ingroup_filter=array();}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$NOW_DAY = date("Y-m-d");
|
||||
@@ -578,6 +581,8 @@ $stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y'
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysqli_num_rows($rslt);
|
||||
$LISTgroups=array();
|
||||
$LISTnames=array();
|
||||
$i=0;
|
||||
$LISTgroups[$i]='ALL-ACTIVE';
|
||||
$i++;
|
||||
@@ -733,6 +738,8 @@ if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$usergroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$usergroups=array();
|
||||
$usergroupnames=array();
|
||||
$usergroups[$i]='ALL-GROUPS';
|
||||
$usergroupnames[$i] = _QXZ("All user groups");
|
||||
$i++;
|
||||
@@ -750,6 +757,8 @@ $rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$ingroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTingroups=array();
|
||||
$LISTingroup_names=array();
|
||||
$LISTingroups[$i]='ALL-INGROUPS';
|
||||
$i++;
|
||||
$ingroups_to_print++;
|
||||
|
||||
Reference in New Issue
Block a user