Added MathZDC function to prevent division math with zero as one of the numbers

Cleaned up vdc_db_query.php mysql logging
Moved date definitions in keepalive script to the top of the script
Changed iax.conf 1.4 and higher: regcontext=iaxregistration

git-svn-id: svn://192.168.202.10@2094 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2014-04-03 01:05:16 +00:00
parent 0bae30bd36
commit 06697b0c32
40 changed files with 2236 additions and 2585 deletions
+3
View File
@@ -193,6 +193,9 @@ OTHER CHANGES:
35. Added Called Counts List IDs Report
36. Added MathZDC function to prevent division math with zero as one of the
numbers.
+36 -30
View File
@@ -98,10 +98,17 @@
$build = '140214-1519';
$DB=0; # Debug flag
# define blank variables
$MT[0]=''; $MT[1]='';
@psline=@MT;
$cu3way=0;
$cu3way_delay='';
$autodial_delay='';
$adfill_delay='';
$fill_staggered='';
# time variable definitions
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
@@ -113,10 +120,35 @@ if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$now_date = "$year-$mon-$mday $hour:$min:$sec";
$reset_test = "$hour$min";
$cu3way_delay='';
$autodial_delay='';
$adfill_delay='';
$fill_staggered='';
### calculate the date and time for slightly less than 24 hours ago
$secX = time();
$TDtarget = ($secX - 86000); # almost one day old
($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget);
$Tyear = ($Tyear + 1900);
$Tmon++;
if ($Tmon < 10) {$Tmon = "0$Tmon";}
if ($Tmday < 10) {$Tmday = "0$Tmday";}
if ($Thour < 10) {$Thour = "0$Thour";}
if ($Tmin < 10) {$Tmin = "0$Tmin";}
if ($Tsec < 10) {$Tsec = "0$Tsec";}
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
### calculate the date and time for 24 hours ago
$secX = time();
$RMtarget = ($secX - 86400); # 24 hours ago
($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($RMtarget);
$RMyear = ($RMyear + 1900);
$RMmon++;
if ($RMmon < 10) {$RMmon = "0$RMmon";}
if ($RMmday < 10) {$RMmday = "0$RMmday";}
if ($RMhour < 10) {$RMhour = "0$RMhour";}
if ($RMmin < 10) {$RMmin = "0$RMmin";}
if ($RMsec < 10) {$RMsec = "0$RMsec";}
$RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec";
$RMdate = "$RMyear-$RMmon-$RMmday";
### begin parsing run-time options ###
if (length($ARGV[0])>1)
@@ -803,18 +835,6 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "Starting clear out daily reset tables...\n";}
$secX = time();
$TDtarget = ($secX - 86000); # almost one day old
($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget);
$Tyear = ($Tyear + 1900);
$Tmon++;
if ($Tmon < 10) {$Tmon = "0$Tmon";}
if ($Tmday < 10) {$Tmday = "0$Tmday";}
if ($Thour < 10) {$Thour = "0$Thour";}
if ($Tmin < 10) {$Tmin = "0$Tmin";}
if ($Tsec < 10) {$Tsec = "0$Tsec";}
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
$stmtA = "UPDATE vicidial_xfer_stats SET xfer_count='0';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
@@ -1060,20 +1080,6 @@ if ($timeclock_end_of_day_NOW > 0)
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
### calculate the date and time for 24 hours ago
$secX = time();
$RMtarget = ($secX - 86400); # 24 hours ago
($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($RMtarget);
$RMyear = ($RMyear + 1900);
$RMmon++;
if ($RMmon < 10) {$RMmon = "0$RMmon";}
if ($RMmday < 10) {$RMmday = "0$RMmday";}
if ($RMhour < 10) {$RMhour = "0$RMhour";}
if ($RMmin < 10) {$RMmin = "0$RMmin";}
if ($RMsec < 10) {$RMsec = "0$RMsec";}
$RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec";
$RMdate = "$RMyear-$RMmon-$RMmday";
# set past holidays to EXPIRED status
$stmtA = "UPDATE vicidial_call_time_holidays SET holiday_status='EXPIRED' where holiday_date < \"$RMdate\" and holiday_status!='EXPIRED';";
if($DBX){print STDERR "\n|$stmtA|\n";}
+1 -1
View File
@@ -30,7 +30,7 @@ iaxmaxthreadcount = 250
;register => user:pass@iaxtel.com
;register => FWDNumber:passwd@iax.fwdnet.net
authdebug=no
regcontext=default
regcontext=iaxregistration
autokill=yes
codecpriority=host
allowfwdownload=no
+355 -340
View File
File diff suppressed because it is too large Load Diff
+69 -136
View File
@@ -25,6 +25,7 @@
# 130621-0806 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0737 - Changed to mysqli PHP functions
# 140108-0747 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -424,7 +425,7 @@ $SQsec = ( ($SQtime_ARY[0] * 3600) + ($SQtime_ARY[1] * 60) + ($SQtime_ARY[2] * 1
$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
$DURATIONsec = ($EQepoch - $SQepoch);
$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
$DURATIONday = intval( MathZDC($DURATIONsec, 86400) + 1 );
if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
{
@@ -705,44 +706,26 @@ while ($d < $DURATIONday)
if ($totQUEUEdate[$d] < 1) {$totQUEUEdate[$d]=0;}
if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;}
if ($totDROPSdate[$d] > 0)
{$totDROPSpctDATE[$d] = ( ($totDROPSdate[$d] / $totCALLSdate[$d]) * 100);}
else {$totDROPSpctDATE[$d] = 0;}
$totDROPSpctDATE[$d] = ( MathZDC($totDROPSdate[$d], $totCALLSdate[$d]) * 100);
$totDROPSpctDATE[$d] = round($totDROPSpctDATE[$d], 2);
if ($totQUEUEdate[$d] > 0)
{$totQUEUEpctDATE[$d] = ( ($totQUEUEdate[$d] / $totCALLSdate[$d]) * 100);}
else {$totQUEUEpctDATE[$d] = 0;}
$totQUEUEpctDATE[$d] = ( MathZDC($totQUEUEdate[$d], $totCALLSdate[$d]) * 100);
$totQUEUEpctDATE[$d] = round($totQUEUEpctDATE[$d], 2);
if ($totDROPSsecDATE[$d] > 0)
{$totDROPSavgDATE[$d] = ($totDROPSsecDATE[$d] / $totDROPSdate[$d]);}
else {$totDROPSavgDATE[$d] = 0;}
if ($totQUEUEsecDATE[$d] > 0)
{$totQUEUEavgDATE[$d] = ($totQUEUEsecDATE[$d] / $totQUEUEdate[$d]);}
else {$totQUEUEavgDATE[$d] = 0;}
if ($totQUEUEsecDATE[$d] > 0)
{$totQUEUEtotDATE[$d] = ($totQUEUEsecDATE[$d] / $totCALLSdate[$d]);}
else {$totQUEUEtotDATE[$d] = 0;}
$totDROPSavgDATE[$d] = MathZDC($totDROPSsecDATE[$d], $totDROPSdate[$d]);
$totQUEUEavgDATE[$d] = MathZDC($totQUEUEsecDATE[$d], $totQUEUEdate[$d]);
$totQUEUEtotDATE[$d] = MathZDC($totQUEUEsecDATE[$d], $totCALLSdate[$d]);
if ($totCALLSsecDATE[$d] > 0)
{
$totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]);
$totCALLSavgDATE[$d] = MathZDC($totCALLSsecDATE[$d], $totCALLSdate[$d]);
$totTIME_M = ($totCALLSsecDATE[$d] / 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
}
else
{
$totCALLSavgDATE[$d] = 0;
$totTIME_MS=' 0:00';
}
$totTIME_M = MathZDC($totCALLSsecDATE[$d], 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);}
if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);}
@@ -782,30 +765,18 @@ while ($d < $DURATIONday)
$d++;
}
if ($totDROPS > 0)
{$totDROPSpct = ( ($totDROPS / $totCALLS) * 100);}
else {$totDROPSpct = 0;}
$totDROPSpct = MathZDC($totDROPS, $totCALLS)*100;
$totDROPSpct = round($totDROPSpct, 2);
if ($totQUEUE > 0)
{$totQUEUEpct = ( ($totQUEUE / $totCALLS) * 100);}
else {$totQUEUEpct = 0;}
$totQUEUEpct = MathZDC($totQUEUE, $totCALLS)*100;
$totQUEUEpct = round($totQUEUEpct, 2);
if ($totDROPSsec > 0)
{$totDROPSavg = ($totDROPSsec / $totDROPS);}
else {$totDROPSavg = 0;}
if ($totQUEUEsec > 0)
{$totQUEUEavg = ($totQUEUEsec / $totQUEUE);}
else {$totQUEUEavg = 0;}
if ($totQUEUEsec > 0)
{$totQUEUEtot = ($totQUEUEsec / $totCALLS);}
else {$totQUEUEtot = 0;}
$totDROPSavg = MathZDC($totDROPSsec, $totDROPS);
$totQUEUEavg = MathZDC($totQUEUEsec, $totQUEUE);
$totQUEUEtot = MathZDC($totQUEUEsec, $totCALLS);
if ($totCALLSsec > 0)
{
$totCALLSavg = ($totCALLSsec / $totCALLS);
$totTIME_M = ($totCALLSsec / 60);
$totCALLSavg = MathZDC($totCALLSsec, $totCALLS);
$totTIME_M = MathZDC($totCALLSsec, 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
@@ -814,12 +785,6 @@ if ($totCALLSsec > 0)
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%9s", $totTIME_MS);
}
else
{
$totCALLSavg = 0;
$totTIME_MS=' ';
}
$FtotCALLSavg = sprintf("%6.0f", $totCALLSavg);
@@ -840,16 +805,16 @@ $CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$Ft
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_drops)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$DROPPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_droppct)."' height='16' />".$graph_stats[$d][2]."%</td></tr>";
$AVGDROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avgdrops)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$HOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_hold)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$HOLDPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_holdpct)."' height='16' />".$graph_stats[$d][5]."%</td></tr>";
$AVGHOLDS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_avgholds)."' height='16' />".$graph_stats[$d][6]."</td></tr>";
$AVGHOLDSTOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_avgholdstotal)."' height='16' />".$graph_stats[$d][7]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_calls)."' height='16' />".$graph_stats[$d][8]."</td></tr>";
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_totalcalltime)."' height='16' />".$graph_stats[$d][10]."</td></tr>";
$AVGCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][11]/$max_avgcalltime)."' height='16' />".$graph_stats[$d][11]."</td></tr>";
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_drops))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$DROPPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_droppct))."' height='16' />".$graph_stats[$d][2]."%</td></tr>";
$AVGDROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_avgdrops))."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$HOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_hold))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$HOLDPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_holdpct))."' height='16' />".$graph_stats[$d][5]."%</td></tr>";
$AVGHOLDS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_avgholds))."' height='16' />".$graph_stats[$d][6]."</td></tr>";
$AVGHOLDSTOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][7], $max_avgholdstotal))."' height='16' />".$graph_stats[$d][7]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][8], $max_calls))."' height='16' />".$graph_stats[$d][8]."</td></tr>";
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][9], $max_totalcalltime))."' height='16' />".$graph_stats[$d][10]."</td></tr>";
$AVGCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][11], $max_avgcalltime))."' height='16' />".$graph_stats[$d][11]."</td></tr>";
}
$DROPS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotDROPS)."</th></tr></table>";
$DROPPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotDROPSpct)."%</th></tr></table>";
@@ -896,15 +861,9 @@ $CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$Ft
while ($i < $TOTintervals)
{
if ($qrtCALLS[$i] > 0)
{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
else {$qrtCALLSavg[$i] = 0;}
if ($qrtDROPS[$i] > 0)
{$qrtDROPSavg[$i] = ($qrtDROPSsec[$i] / $qrtDROPS[$i]);}
else {$qrtDROPSavg[$i] = 0;}
if ($qrtQUEUE[$i] > 0)
{$qrtQUEUEavg[$i] = ($qrtQUEUEsec[$i] / $qrtQUEUE[$i]);}
else {$qrtQUEUEavg[$i] = 0;}
$qrtCALLSavg[$i] = MathZDC($qrtCALLSsec[$i], $qrtCALLS[$i]);
$qrtDROPSavg[$i] = MathZDC($qrtDROPSsec[$i], $qrtDROPS[$i]);
$qrtQUEUEavg[$i] = MathZDC($qrtQUEUEsec[$i], $qrtQUEUE[$i]);
if ($qrtCALLS[$i] > $hi_hour_count) {$hi_hour_count = $qrtCALLS[$i];}
if ($qrtQUEUEavg[$i] > $hi_hold_count) {$hi_hold_count = $qrtQUEUEavg[$i];}
@@ -917,14 +876,8 @@ $CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$Ft
$i++;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{$hour_multiplier = (20 / $hi_hour_count);}
if ($hi_hold_count < 1)
{$hold_multiplier = 0;}
else
{$hold_multiplier = (20 / $hi_hold_count);}
$hour_multiplier = MathZDC(20, $hi_hour_count);
$hold_multiplier = MathZDC(20, $hi_hold_count);
if ($report_display_type=="HTML")
{
@@ -956,15 +909,11 @@ $Mk=0;
$call_scale = '0';
while ($k <= 22)
{
if ( ($k < 1) or ($hour_multiplier <= 0) )
{$scale_num = 20;}
else
{
$TMPscale_num=(23 / $hour_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=($k / $hour_multiplier);
$scale_num = round($scale_num, 0);
}
$TMPscale_num=MathZDC(23, $hour_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$tmpscl = "$call_scale$TMPscale_num";
if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
@@ -985,15 +934,10 @@ $Mk=0;
$hold_scale = '0';
while ($k <= 22)
{
if ( ($k < 1) or ($hold_multiplier <= 0) )
{$scale_num = 20;}
else
{
$TMPscale_num=(23 / $hold_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=($k / $hold_multiplier);
$scale_num = round($scale_num, 0);
}
$TMPscale_num=MathZDC(23, $hold_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=MathZDC($k, $hold_multiplier);
$scale_num = round($scale_num, 0);
$tmpscl = "$hold_scale$TMPscale_num";
if ( ($Mk >= 4) or (strlen($tmpscl)==23) )
@@ -1151,10 +1095,7 @@ while ($i < $TOTintervals)
}
if ($totQUEUEsec > 0)
{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
else
{$totQUEUEavgRAW = 0;}
$totQUEUEavgRAW = MathZDC($totCALLS, $totQUEUEsec);
$totQUEUEavg = sprintf("%5s", $totQUEUEavg);
while (strlen($totQUEUEavg)>5) {$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);}
$totQUEUEmax = sprintf("%5s", $totQUEUEmax);
@@ -1173,13 +1114,13 @@ $CALLSHANDLED_graph="<table cellspacing='0' cellpadding='0'><caption align='top'
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$AVGHOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_avg_hold_time)."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][2]."</td></tr>";
$AVGHOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_avg_hold_time))."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][2]."</td></tr>";
$CALLSHANDLED_graph.=" <tr><td class='chart_td' width='50'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value' width='600' valign='bottom'>";
if ($graph_stats[$d][3]>0) {
$CALLSHANDLED_graph.="<ul class='overlap_barGraph'><li class='p1' style='height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][3]/$max_calls)."px'><font style='background-color: #900'>".$graph_stats[$d][3]."</font></li>";
$CALLSHANDLED_graph.="<ul class='overlap_barGraph'><li class='p1' style='height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][3], $max_calls))."px'><font style='background-color: #900'>".$graph_stats[$d][3]."</font></li>";
if ($graph_stats[$d][4]>0) {
$CALLSHANDLED_graph.="<li class='p2' style='height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][4]/$max_calls)."px'><font style='background-color: #009'>".$graph_stats[$d][4]."</font></li>";
$CALLSHANDLED_graph.="<li class='p2' style='height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][4], $max_calls))."px'><font style='background-color: #009'>".$graph_stats[$d][4]."</font></li>";
}
$CALLSHANDLED_graph.="</ul>";
} else {
@@ -1237,22 +1178,14 @@ $h=0;
while ($h < $TOTintervals)
{
$Aavg_hold[$h] = $qrtQUEUEavg[$h];
if ($hd__0[$h] > 0) {$Phd__0[$h] = round( ( ($hd__0[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd__0[$h]=0;}
if ($hd_20[$h] > 0) {$Phd_20[$h] = round( ( ($hd_20[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd_20[$h]=0;}
if ($hd_40[$h] > 0) {$Phd_40[$h] = round( ( ($hd_40[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd_40[$h]=0;}
if ($hd_60[$h] > 0) {$Phd_60[$h] = round( ( ($hd_60[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd_60[$h]=0;}
if ($hd_80[$h] > 0) {$Phd_80[$h] = round( ( ($hd_80[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd_80[$h]=0;}
if ($hd100[$h] > 0) {$Phd100[$h] = round( ( ($hd100[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd100[$h]=0;}
if ($hd120[$h] > 0) {$Phd120[$h] = round( ( ($hd120[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd120[$h]=0;}
if ($hd121[$h] > 0) {$Phd121[$h] = round( ( ($hd121[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd121[$h]=0;}
$Phd__0[$h] = round( ( MathZDC($hd__0[$h], $qrtCALLS[$h]) * 100) );
$Phd_20[$h] = round( ( MathZDC($hd_20[$h], $qrtCALLS[$h]) * 100) );
$Phd_40[$h] = round( ( MathZDC($hd_40[$h], $qrtCALLS[$h]) * 100) );
$Phd_60[$h] = round( ( MathZDC($hd_60[$h], $qrtCALLS[$h]) * 100) );
$Phd_80[$h] = round( ( MathZDC($hd_80[$h], $qrtCALLS[$h]) * 100) );
$Phd100[$h] = round( ( MathZDC($hd100[$h], $qrtCALLS[$h]) * 100) );
$Phd120[$h] = round( ( MathZDC($hd120[$h], $qrtCALLS[$h]) * 100) );
$Phd121[$h] = round( ( MathZDC($hd121[$h], $qrtCALLS[$h]) * 100) );
while (strlen($qrtQUEUEavg[$h])>4) {$qrtQUEUEavg[$h] = preg_replace('/.$/', '', $qrtQUEUEavg[$h]);}
$hd__0[$h] = sprintf("%4s", $hd__0[$h]);
$hd_20[$h] = sprintf("%4s", $hd_20[$h]);
@@ -1288,7 +1221,7 @@ while ($h < $TOTintervals)
}
else
{
$qrtQUEUEavg_val[$h] = ( (32 / 120) * $Aavg_hold[$h] );
$qrtQUEUEavg_val[$h] = ( MathZDC(32, 120) * $Aavg_hold[$h] );
$k=0;
$blank=0;
while ($k < 32)
@@ -1317,14 +1250,14 @@ while ($h < $TOTintervals)
$h++;
}
if ($ALLhd__0 > 0) {$APhd__0 = round( ( ($ALLhd__0 / $ALLcalls) * 100) );}
if ($ALLhd_20 > 0) {$APhd_20 = round( ( ($ALLhd_20 / $ALLcalls) * 100) );}
if ($ALLhd_40 > 0) {$APhd_40 = round( ( ($ALLhd_40 / $ALLcalls) * 100) );}
if ($ALLhd_60 > 0) {$APhd_60 = round( ( ($ALLhd_60 / $ALLcalls) * 100) );}
if ($ALLhd_80 > 0) {$APhd_80 = round( ( ($ALLhd_80 / $ALLcalls) * 100) );}
if ($ALLhd100 > 0) {$APhd100 = round( ( ($ALLhd100 / $ALLcalls) * 100) );}
if ($ALLhd120 > 0) {$APhd120 = round( ( ($ALLhd120 / $ALLcalls) * 100) );}
if ($ALLhd121 > 0) {$APhd121 = round( ( ($ALLhd121 / $ALLcalls) * 100) );}
$APhd__0 = round( ( MathZDC($ALLhd__0, $ALLcalls) * 100) );
$APhd_20 = round( ( MathZDC($ALLhd_20, $ALLcalls) * 100) );
$APhd_40 = round( ( MathZDC($ALLhd_40, $ALLcalls) * 100) );
$APhd_60 = round( ( MathZDC($ALLhd_60, $ALLcalls) * 100) );
$APhd_80 = round( ( MathZDC($ALLhd_80, $ALLcalls) * 100) );
$APhd100 = round( ( MathZDC($ALLhd100, $ALLcalls) * 100) );
$APhd120 = round( ( MathZDC($ALLhd120, $ALLcalls) * 100) );
$APhd121 = round( ( MathZDC($ALLhd121, $ALLcalls) * 100) );
$ALLcalls = sprintf("%5s", $ALLcalls);
$APhd__0 = sprintf("%4s", $APhd__0);
+108 -178
View File
@@ -42,6 +42,7 @@
# 130704-0936 - Fixed issue #675
# 130901-0816 - Changed to mysqli PHP functions
# 140108-0746 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -646,13 +647,8 @@ if ($group_ct > 1)
$gTOTALcalls = sprintf("%7s", $row[0]);
$gIVRcalls = sprintf("%7s", $rowx[0]);
$gDROPcalls = sprintf("%7s", $rowy[0]);
if ( ($gDROPcalls < 1) or ($gTOTALcalls < 1) )
{$gDROPpercent = '0';}
else
{
$gDROPpercent = (($gDROPcalls / $gTOTALcalls) * 100);
$gDROPpercent = round($gDROPpercent, 2);
}
$gDROPpercent = (MathZDC($gDROPcalls, $gTOTALcalls) * 100);
$gDROPpercent = round($gDROPpercent, 2);
$gDROPpercent = sprintf("%6s", $gDROPpercent);
$ASCII_text.="| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
@@ -679,7 +675,7 @@ if ($group_ct > 1)
if ($graph_data_ary[$i][1]>$max_value) {$max_value=$graph_data_ary[$i][1];}
if ($graph_data_ary[$i][1]>0) {$w++;}
}
$scale = $graph_height / $max_value;
$scale = MathZDC($graph_height, $max_value);
$GRAPH_text.="<table cellspacing='0' cellpadding='0'><caption align='top'>MULTI-GROUP BREAKDOWN</caption><tr height='25' valign='top'><th class='thgraph' scope='col'>GROUP</th><th class='thgraph' scope='col'>IVRS <img src='./images/bar_green.png' width='10' height='10'> / DROPS <img src='./images/bar_blue.png' width='10' height='10'> / CALLS <img src='./images/bar.png' width='10' height='10'></th></tr>";
@@ -688,12 +684,12 @@ if ($group_ct > 1)
$graph_data_ary[$d][0]=preg_replace('/\s/', "", $graph_data_ary[$d][0]);
$GRAPH_text.=" <tr><td class='chart_td' width='50'>".$graph_data_ary[$d][0]."<BR>".$graph_data_ary[$d][3]."% drops<BR>&nbsp;</td><td nowrap class='chart_td value' width='600' valign='top'>\n";
if ($graph_data_ary[$d][1]>0) {
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_data_ary[$d][1]/$max_value)."px\"><font style='background-color: #900'>".$graph_data_ary[$d][1]."</font></li>";
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_data_ary[$d][1], $max_value))."px\"><font style='background-color: #900'>".$graph_data_ary[$d][1]."</font></li>";
if ($graph_data_ary[$d][2]>0) {
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_data_ary[$d][2]/$max_value)."px\"><font style='background-color: #009'>".$graph_data_ary[$d][2]."</font></li>";
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_data_ary[$d][2], $max_value))."px\"><font style='background-color: #009'>".$graph_data_ary[$d][2]."</font></li>";
}
if ($graph_data_ary[$d][4]>0) {
$GRAPH_text.="<li class=\"p3\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_data_ary[$d][4]/$max_value)."px\"><font style='background-color: #090'>".$graph_data_ary[$d][4]."</font></li>";
$GRAPH_text.="<li class=\"p3\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_data_ary[$d][4], $max_value))."px\"><font style='background-color: #090'>".$graph_data_ary[$d][4]."</font></li>";
}
$GRAPH_text.="</ul>\n";
} else {
@@ -748,30 +744,19 @@ $rowx=mysqli_fetch_row($rslt);
$TOTALcalls = sprintf("%10s", $row[0]);
$IVRcalls = sprintf("%10s", $rowx[0]);
$TOTALsec = $row[1];
if ( ($row[0] < 1) or ($TOTALsec < 1) )
{$average_call_seconds = ' 0';}
else
{
$average_call_seconds = ($TOTALsec / $row[0]);
$average_call_seconds = round($average_call_seconds, 0);
$average_call_seconds = sprintf("%10s", $average_call_seconds);
}
$average_call_seconds = MathZDC($TOTALsec, $row[0]);
$average_call_seconds = round($average_call_seconds, 0);
$average_call_seconds = sprintf("%10s", $average_call_seconds);
$ANSWEREDcalls = sprintf("%10s", $rowy[0]);
if ( ($ANSWEREDcalls < 1) or ($TOTALcalls < 1) )
{$ANSWEREDpercent = '0';}
else
{
$ANSWEREDpercent = (($ANSWEREDcalls / $TOTALcalls) * 100);
$ANSWEREDpercent = round($ANSWEREDpercent, 0);
}
if ( ($rowy[0] < 1) or ($ANSWEREDcalls < 1) )
{$average_answer_seconds = ' 0';}
else
{
$average_answer_seconds = ($rowy[1] / $rowy[0]);
$average_answer_seconds = round($average_answer_seconds, 2);
$average_answer_seconds = sprintf("%10s", $average_answer_seconds);
}
$ANSWEREDpercent = (MathZDC($ANSWEREDcalls, $TOTALcalls) * 100);
$ANSWEREDpercent = round($ANSWEREDpercent, 0);
$average_answer_seconds = MathZDC($rowy[1], $rowy[0]);
$average_answer_seconds = round($average_answer_seconds, 2);
$average_answer_seconds = sprintf("%10s", $average_answer_seconds);
if ($EMAIL=='Y')
{
@@ -817,31 +802,15 @@ if ($DB) {$MAIN.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
$DROPcalls = sprintf("%10s", $row[0]);
if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
{$DROPpercent = '0';}
else
{
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 0);
}
$DROPpercent = (MathZDC($DROPcalls, $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 0);
if ( ($row[0] < 1) or ($row[1] < 1) )
{
$average_hold_seconds = ' 0';
}
else
{
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
}
if ( ($ANSWEREDcalls < 1) or ($DROPcalls < 1) )
{$DROP_ANSWEREDpercent = '0';}
else
{
$DROP_ANSWEREDpercent = (($DROPcalls / $ANSWEREDcalls) * 100);
$DROP_ANSWEREDpercent = round($DROP_ANSWEREDpercent, 0);
}
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
$DROP_ANSWEREDpercent = (MathZDC($DROPcalls, $ANSWEREDcalls) * 100);
$DROP_ANSWEREDpercent = round($DROP_ANSWEREDpercent, 0);
if ($EMAIL=='Y')
{
@@ -883,15 +852,12 @@ if (strlen($group_SQL)>3)
$row=mysqli_fetch_row($rslt);
$answer_sec_pct_rt_stat_two = $row[0];
if ( ($ANSWEREDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
{
$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $ANSWEREDcalls) * 100);
$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $ANSWEREDcalls) * 100);
$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
}
$PCTanswer_sec_pct_rt_stat_one = (MathZDC($answer_sec_pct_rt_stat_one, $ANSWEREDcalls) * 100);
$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
$PCTanswer_sec_pct_rt_stat_two = (MathZDC($answer_sec_pct_rt_stat_two, $ANSWEREDcalls) * 100);
$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
}
}
@@ -981,31 +947,16 @@ if ($DB) {$MAIN.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
$QUEUEcalls = sprintf("%10s", $row[0]);
if ( ($QUEUEcalls < 1) or ($TOTALcalls < 1) )
{$QUEUEpercent = '0';}
else
{
$QUEUEpercent = (($QUEUEcalls / $TOTALcalls) * 100);
$QUEUEpercent = round($QUEUEpercent, 0);
}
$QUEUEpercent = (MathZDC($QUEUEcalls, $TOTALcalls) * 100);
$QUEUEpercent = round($QUEUEpercent, 0);
if ( ($row[0] < 1) or ($row[1] < 1) )
{$average_queue_seconds = ' 0';}
else
{
$average_queue_seconds = ($row[1] / $row[0]);
$average_queue_seconds = round($average_queue_seconds, 2);
$average_queue_seconds = sprintf("%10.2f", $average_queue_seconds);
}
$average_queue_seconds = MathZDC($row[1], $row[0]);
$average_queue_seconds = round($average_queue_seconds, 2);
$average_queue_seconds = sprintf("%10.2f", $average_queue_seconds);
if ( ($TOTALcalls < 1) or ($row[1] < 1) )
{$average_total_queue_seconds = ' 0';}
else
{
$average_total_queue_seconds = ($row[1] / $TOTALcalls);
$average_total_queue_seconds = round($average_total_queue_seconds, 2);
$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
}
$average_total_queue_seconds = MathZDC($row[1], $TOTALcalls);
$average_total_queue_seconds = round($average_total_queue_seconds, 2);
$average_total_queue_seconds = sprintf("%10.2f", $average_total_queue_seconds);
if ($EMAIL=='Y')
{
@@ -1396,53 +1347,53 @@ $pad_0=0; $pad_5=0; $pad10=0; $pad15=0; $pad20=0; $pad25=0; $pad30=0; $pad35=0;
$pCad_0=0; $pCad_5=0; $pCad10=0; $pCad15=0; $pCad20=0; $pCad25=0; $pCad30=0; $pCad35=0; $pCad40=0; $pCad45=0; $pCad50=0; $pCad55=0; $pCad60=0; $pCad90=0; $pCad99=0;
if ( ($BDansweredCALLS > 0) and ($TOTALcalls > 0) )
{
if ($ad_0 > 0) {$pad_0 = (($ad_0 / $TOTALcalls) * 100); $pad_0 = round($pad_0, 0);}
if ($ad_5 > 0) {$pad_5 = (($ad_5 / $TOTALcalls) * 100); $pad_5 = round($pad_5, 0);}
if ($ad10 > 0) {$pad10 = (($ad10 / $TOTALcalls) * 100); $pad10 = round($pad10, 0);}
if ($ad15 > 0) {$pad15 = (($ad15 / $TOTALcalls) * 100); $pad15 = round($pad15, 0);}
if ($ad20 > 0) {$pad20 = (($ad20 / $TOTALcalls) * 100); $pad20 = round($pad20, 0);}
if ($ad25 > 0) {$pad25 = (($ad25 / $TOTALcalls) * 100); $pad25 = round($pad25, 0);}
if ($ad30 > 0) {$pad30 = (($ad30 / $TOTALcalls) * 100); $pad30 = round($pad30, 0);}
if ($ad35 > 0) {$pad35 = (($ad35 / $TOTALcalls) * 100); $pad35 = round($pad35, 0);}
if ($ad40 > 0) {$pad40 = (($ad40 / $TOTALcalls) * 100); $pad40 = round($pad40, 0);}
if ($ad45 > 0) {$pad45 = (($ad45 / $TOTALcalls) * 100); $pad45 = round($pad45, 0);}
if ($ad50 > 0) {$pad50 = (($ad50 / $TOTALcalls) * 100); $pad50 = round($pad50, 0);}
if ($ad55 > 0) {$pad55 = (($ad55 / $TOTALcalls) * 100); $pad55 = round($pad55, 0);}
if ($ad60 > 0) {$pad60 = (($ad60 / $TOTALcalls) * 100); $pad60 = round($pad60, 0);}
if ($ad90 > 0) {$pad90 = (($ad90 / $TOTALcalls) * 100); $pad90 = round($pad90, 0);}
if ($ad99 > 0) {$pad99 = (($ad99 / $TOTALcalls) * 100); $pad99 = round($pad99, 0);}
$pad_0 = (MathZDC($ad_0, $TOTALcalls) * 100); $pad_0 = round($pad_0, 0);
$pad_5 = (MathZDC($ad_5, $TOTALcalls) * 100); $pad_5 = round($pad_5, 0);
$pad10 = (MathZDC($ad10, $TOTALcalls) * 100); $pad10 = round($pad10, 0);
$pad15 = (MathZDC($ad15, $TOTALcalls) * 100); $pad15 = round($pad15, 0);
$pad20 = (MathZDC($ad20, $TOTALcalls) * 100); $pad20 = round($pad20, 0);
$pad25 = (MathZDC($ad25, $TOTALcalls) * 100); $pad25 = round($pad25, 0);
$pad30 = (MathZDC($ad30, $TOTALcalls) * 100); $pad30 = round($pad30, 0);
$pad35 = (MathZDC($ad35, $TOTALcalls) * 100); $pad35 = round($pad35, 0);
$pad40 = (MathZDC($ad40, $TOTALcalls) * 100); $pad40 = round($pad40, 0);
$pad45 = (MathZDC($ad45, $TOTALcalls) * 100); $pad45 = round($pad45, 0);
$pad50 = (MathZDC($ad50, $TOTALcalls) * 100); $pad50 = round($pad50, 0);
$pad55 = (MathZDC($ad55, $TOTALcalls) * 100); $pad55 = round($pad55, 0);
$pad60 = (MathZDC($ad60, $TOTALcalls) * 100); $pad60 = round($pad60, 0);
$pad90 = (MathZDC($ad90, $TOTALcalls) * 100); $pad90 = round($pad90, 0);
$pad99 = (MathZDC($ad99, $TOTALcalls) * 100); $pad99 = round($pad99, 0);
if ($Cad_0 > 0) {$pCad_0 = (($Cad_0 / $TOTALcalls) * 100); $pCad_0 = round($pCad_0, 0);}
if ($Cad_5 > 0) {$pCad_5 = (($Cad_5 / $TOTALcalls) * 100); $pCad_5 = round($pCad_5, 0);}
if ($Cad10 > 0) {$pCad10 = (($Cad10 / $TOTALcalls) * 100); $pCad10 = round($pCad10, 0);}
if ($Cad15 > 0) {$pCad15 = (($Cad15 / $TOTALcalls) * 100); $pCad15 = round($pCad15, 0);}
if ($Cad20 > 0) {$pCad20 = (($Cad20 / $TOTALcalls) * 100); $pCad20 = round($pCad20, 0);}
if ($Cad25 > 0) {$pCad25 = (($Cad25 / $TOTALcalls) * 100); $pCad25 = round($pCad25, 0);}
if ($Cad30 > 0) {$pCad30 = (($Cad30 / $TOTALcalls) * 100); $pCad30 = round($pCad30, 0);}
if ($Cad35 > 0) {$pCad35 = (($Cad35 / $TOTALcalls) * 100); $pCad35 = round($pCad35, 0);}
if ($Cad40 > 0) {$pCad40 = (($Cad40 / $TOTALcalls) * 100); $pCad40 = round($pCad40, 0);}
if ($Cad45 > 0) {$pCad45 = (($Cad45 / $TOTALcalls) * 100); $pCad45 = round($pCad45, 0);}
if ($Cad50 > 0) {$pCad50 = (($Cad50 / $TOTALcalls) * 100); $pCad50 = round($pCad50, 0);}
if ($Cad55 > 0) {$pCad55 = (($Cad55 / $TOTALcalls) * 100); $pCad55 = round($pCad55, 0);}
if ($Cad60 > 0) {$pCad60 = (($Cad60 / $TOTALcalls) * 100); $pCad60 = round($pCad60, 0);}
if ($Cad90 > 0) {$pCad90 = (($Cad90 / $TOTALcalls) * 100); $pCad90 = round($pCad90, 0);}
if ($Cad99 > 0) {$pCad99 = (($Cad99 / $TOTALcalls) * 100); $pCad99 = round($pCad99, 0);}
$pCad_0 = (MathZDC($Cad_0, $TOTALcalls) * 100); $pCad_0 = round($pCad_0, 0);
$pCad_5 = (MathZDC($Cad_5, $TOTALcalls) * 100); $pCad_5 = round($pCad_5, 0);
$pCad10 = (MathZDC($Cad10, $TOTALcalls) * 100); $pCad10 = round($pCad10, 0);
$pCad15 = (MathZDC($Cad15, $TOTALcalls) * 100); $pCad15 = round($pCad15, 0);
$pCad20 = (MathZDC($Cad20, $TOTALcalls) * 100); $pCad20 = round($pCad20, 0);
$pCad25 = (MathZDC($Cad25, $TOTALcalls) * 100); $pCad25 = round($pCad25, 0);
$pCad30 = (MathZDC($Cad30, $TOTALcalls) * 100); $pCad30 = round($pCad30, 0);
$pCad35 = (MathZDC($Cad35, $TOTALcalls) * 100); $pCad35 = round($pCad35, 0);
$pCad40 = (MathZDC($Cad40, $TOTALcalls) * 100); $pCad40 = round($pCad40, 0);
$pCad45 = (MathZDC($Cad45, $TOTALcalls) * 100); $pCad45 = round($pCad45, 0);
$pCad50 = (MathZDC($Cad50, $TOTALcalls) * 100); $pCad50 = round($pCad50, 0);
$pCad55 = (MathZDC($Cad55, $TOTALcalls) * 100); $pCad55 = round($pCad55, 0);
$pCad60 = (MathZDC($Cad60, $TOTALcalls) * 100); $pCad60 = round($pCad60, 0);
$pCad90 = (MathZDC($Cad90, $TOTALcalls) * 100); $pCad90 = round($pCad90, 0);
$pCad99 = (MathZDC($Cad99, $TOTALcalls) * 100); $pCad99 = round($pCad99, 0);
if ($Cad_0 > 0) {$ApCad_0 = (($Cad_0 / $BDansweredCALLS) * 100); $ApCad_0 = round($ApCad_0, 0);}
if ($Cad_5 > 0) {$ApCad_5 = (($Cad_5 / $BDansweredCALLS) * 100); $ApCad_5 = round($ApCad_5, 0);}
if ($Cad10 > 0) {$ApCad10 = (($Cad10 / $BDansweredCALLS) * 100); $ApCad10 = round($ApCad10, 0);}
if ($Cad15 > 0) {$ApCad15 = (($Cad15 / $BDansweredCALLS) * 100); $ApCad15 = round($ApCad15, 0);}
if ($Cad20 > 0) {$ApCad20 = (($Cad20 / $BDansweredCALLS) * 100); $ApCad20 = round($ApCad20, 0);}
if ($Cad25 > 0) {$ApCad25 = (($Cad25 / $BDansweredCALLS) * 100); $ApCad25 = round($ApCad25, 0);}
if ($Cad30 > 0) {$ApCad30 = (($Cad30 / $BDansweredCALLS) * 100); $ApCad30 = round($ApCad30, 0);}
if ($Cad35 > 0) {$ApCad35 = (($Cad35 / $BDansweredCALLS) * 100); $ApCad35 = round($ApCad35, 0);}
if ($Cad40 > 0) {$ApCad40 = (($Cad40 / $BDansweredCALLS) * 100); $ApCad40 = round($ApCad40, 0);}
if ($Cad45 > 0) {$ApCad45 = (($Cad45 / $BDansweredCALLS) * 100); $ApCad45 = round($ApCad45, 0);}
if ($Cad50 > 0) {$ApCad50 = (($Cad50 / $BDansweredCALLS) * 100); $ApCad50 = round($ApCad50, 0);}
if ($Cad55 > 0) {$ApCad55 = (($Cad55 / $BDansweredCALLS) * 100); $ApCad55 = round($ApCad55, 0);}
if ($Cad60 > 0) {$ApCad60 = (($Cad60 / $BDansweredCALLS) * 100); $ApCad60 = round($ApCad60, 0);}
if ($Cad90 > 0) {$ApCad90 = (($Cad90 / $BDansweredCALLS) * 100); $ApCad90 = round($ApCad90, 0);}
if ($Cad99 > 0) {$ApCad99 = (($Cad99 / $BDansweredCALLS) * 100); $ApCad99 = round($ApCad99, 0);}
$ApCad_0 = (MathZDC($Cad_0, $BDansweredCALLS) * 100); $ApCad_0 = round($ApCad_0, 0);
$ApCad_5 = (MathZDC($Cad_5, $BDansweredCALLS) * 100); $ApCad_5 = round($ApCad_5, 0);
$ApCad10 = (MathZDC($Cad10, $BDansweredCALLS) * 100); $ApCad10 = round($ApCad10, 0);
$ApCad15 = (MathZDC($Cad15, $BDansweredCALLS) * 100); $ApCad15 = round($ApCad15, 0);
$ApCad20 = (MathZDC($Cad20, $BDansweredCALLS) * 100); $ApCad20 = round($ApCad20, 0);
$ApCad25 = (MathZDC($Cad25, $BDansweredCALLS) * 100); $ApCad25 = round($ApCad25, 0);
$ApCad30 = (MathZDC($Cad30, $BDansweredCALLS) * 100); $ApCad30 = round($ApCad30, 0);
$ApCad35 = (MathZDC($Cad35, $BDansweredCALLS) * 100); $ApCad35 = round($ApCad35, 0);
$ApCad40 = (MathZDC($Cad40, $BDansweredCALLS) * 100); $ApCad40 = round($ApCad40, 0);
$ApCad45 = (MathZDC($Cad45, $BDansweredCALLS) * 100); $ApCad45 = round($ApCad45, 0);
$ApCad50 = (MathZDC($Cad50, $BDansweredCALLS) * 100); $ApCad50 = round($ApCad50, 0);
$ApCad55 = (MathZDC($Cad55, $BDansweredCALLS) * 100); $ApCad55 = round($ApCad55, 0);
$ApCad60 = (MathZDC($Cad60, $BDansweredCALLS) * 100); $ApCad60 = round($ApCad60, 0);
$ApCad90 = (MathZDC($Cad90, $BDansweredCALLS) * 100); $ApCad90 = round($ApCad90, 0);
$ApCad99 = (MathZDC($Cad99, $BDansweredCALLS) * 100); $ApCad99 = round($ApCad99, 0);
}
### Format variables
@@ -1684,7 +1635,7 @@ if ($report_display_type=="HTML")
if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";}
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <td class=\"chart_td$class\">".$ct_ary[$i][1]."</td>\n";
$GRAPH_text.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(200*$ct_ary[$i][0]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][0]."</td>\n";
$GRAPH_text.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(200*$ct_ary[$i][0], $high_ct))."\" height=\"16\" />".$ct_ary[$i][0]."</td>\n";
$GRAPH_text.=" </tr>\n";
}
$GRAPH_text.=" <tr>\n";
@@ -1760,14 +1711,11 @@ while ($i < $statuses_to_print)
}
$TOTALcalls = ($TOTALcalls + $row[0]);
if ( ($STATUScount < 1) or ($TOTALsec < 1) )
{$STATUSrate = 0;}
else
{$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );}
$STATUSrate = (MathZDC($STATUScount, MathZDC($TOTALsec, 3600)) );
$STATUSrate = sprintf("%.2f", $STATUSrate);
$STATUShours = sec_convert($row[2],'H');
$STATUSavg_sec = ($row[2] / $STATUScount);
$STATUSavg_sec = MathZDC($row[2], $STATUScount);
$STATUSavg = sec_convert($STATUSavg_sec,'H');
if ($row[0]>$max_calls) {$max_calls=$row[0];}
@@ -1817,14 +1765,11 @@ if ($TOTALcalls < 1)
}
else
{
if ( ($TOTALcalls < 1) or ($TOTALsec < 1) )
{$TOTALrate = 0;}
else
{$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );}
$TOTALrate = MathZDC($TOTALcalls, MathZDC($TOTALsec, 3600) );
$TOTALrate = sprintf("%.2f", $TOTALrate);
$TOTALhours = sec_convert($TOTALsec,'H');
$TOTALavg_sec = ($TOTALsec / $TOTALcalls);
$TOTALavg_sec = MathZDC($TOTALsec, $TOTALcalls);
$TOTALavg = sec_convert($TOTALavg_sec,'H');
}
$TOTALcalls = sprintf("%10s", $TOTALcalls);
@@ -1843,10 +1788,10 @@ $ASCII_text.="+------------------------------------------------------+----------
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_total_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avg_time)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLSHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_callshr)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_total_time))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_avg_time))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLSHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4] ,$max_callshr))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th></tr></table>";
$TOTALTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALhours)."</th></tr></table>";
@@ -1947,7 +1892,7 @@ if ($report_display_type=="HTML")
$GRAPH_text.=" </tr>\n";
for ($i=0; $i<count($ct_ary); $i++) {
if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";}
if ($high_ct>0) {$bar_width=round((300*$ct_ary[$i][0])/$high_ct);} else {$bar_width=0;}
$bar_width=round(MathZDC((300*$ct_ary[$i][0]), $high_ct));
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <td class=\"chart_td$class\">".$ct_ary[$i][1]."</td>\n";
$GRAPH_text.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".$bar_width."\" height=\"16\" />".$ct_ary[$i][0]."</td>\n";
@@ -2185,13 +2130,9 @@ while ($i < $users_to_print)
$i++;
}
if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
else
{
$TOTavg = ($TOTtime / $TOTcalls);
$TOTavg_MS = sec_convert($TOTavg,'H');
$TOTavg = sprintf("%6s", $TOTavg_MS);
}
$TOTavg = MathZDC($TOTtime, $TOTcalls);
$TOTavg_MS = sec_convert($TOTavg,'H');
$TOTavg = sprintf("%6s", $TOTavg_MS);
$TOTtime_MS = sec_convert($TOTtime,'H');
$TOTtime = sprintf("%10s", $TOTtime_MS);
@@ -2207,9 +2148,9 @@ $ASCII_text.="+--------------------------+------------+------------+--------+\n"
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TIMEHMS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_timehms)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVERAGE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_average)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TIMEHMS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_timehms))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVERAGE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_average))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th></tr></table>";
$TIMEHMS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtime)."</th></tr></table>";
@@ -2343,13 +2284,7 @@ while ($i <= 96)
$i++;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{
$hour_multiplier = (100 / $hi_hour_count);
#$hour_multiplier = round($hour_multiplier, 0);
}
$hour_multiplier = MathZDC(100, $hi_hour_count);
$ASCII_text.="<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF TOTAL $rpt_type_verbiages TAKEN INTO THIS IN-GROUP\n";
@@ -2363,13 +2298,8 @@ while ($k <= 102)
if ($Mk >= 5)
{
$Mk=0;
if ( ($k < 1) or ($hour_multiplier <= 0) )
{$scale_num = 100;}
else
{
$scale_num=($k / $hour_multiplier);
$scale_num = round($scale_num, 0);
}
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$LENscale_num = (strlen($scale_num));
$k = ($k + $LENscale_num);
$call_scale .= "$scale_num";
@@ -2469,7 +2399,7 @@ while ($i <= 96)
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
$ASCII_text.="|$time|<SPAN class=\"red\">";
$CSV_text9.="\"$time\",\"\"";
$CSV_text9.="\"$time\",";
$k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;}
$ASCII_text.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
$k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
@@ -2498,9 +2428,9 @@ for ($d=0; $d<count($graph_stats); $d++) {
$graph_stats[$d][0]=preg_replace('/\s/', "", $graph_stats[$d][0]);
$GRAPH_text.=" <tr><td class='chart_td' width='50'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value' width='600' valign='bottom'>\n";
if ($graph_stats[$d][1]>0) {
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][1]/$max_calls)."px\"><font style='background-color: #900'>".$graph_stats[$d][1]."</font></li>";
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][1], $max_calls))."px\"><font style='background-color: #900'>".$graph_stats[$d][1]."</font></li>";
if ($graph_stats[$d][2]>0) {
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][2]/$max_calls)."px\"><font style='background-color: #009'>".$graph_stats[$d][2]."</font></li>";
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][2], $max_calls))."px\"><font style='background-color: #009'>".$graph_stats[$d][2]."</font></li>";
}
$GRAPH_text.="</ul>\n";
} else {
+31 -59
View File
@@ -20,6 +20,7 @@
# 130621-0801 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0736 - Changed to mysqli PHP functions
# 140108-0745 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -580,7 +581,7 @@ else
if ($DB) {$ASCII_text.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
$group_name[$i] = $row[0];
$agent_alert_delay[$i] = round($row[1] / 1000);
$agent_alert_delay[$i] = round(MathZDC($row[1], 1000));
$out_of_call_time=0;
$length_in_sec[$i]=0;
@@ -687,18 +688,12 @@ else
{$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
$p++;
}
if ( ($answer_count[$i] > 0) and ($talk_sec[$i] > 0) )
{$talk_avg[$i] = ($talk_sec[$i] / $answer_count[$i]);}
else
{$talk_avg[$i] = 0;}
if ( ($calls_count[$i] > 0) and ($queue_seconds[$i] > 0) )
{$queue_avg[$i] = ($queue_seconds[$i] / $calls_count[$i]);}
else
{$queue_avg[$i] = 0;}
$talk_avg[$i] = MathZDC($talk_sec[$i], $answer_count[$i]);
$queue_avg[$i] = MathZDC($queue_seconds[$i], $calls_count[$i]);
if ($print_calls > 0)
{
$PCtemptalkmin = ($PCtemptalk / 60);
$PCtemptalkmin = MathZDC($PCtemptalk, 60);
$ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
}
@@ -804,14 +799,8 @@ else
if ($Hmax_queue_seconds[$h] > $hTOTmax_queue_seconds)
{$hTOTmax_queue_seconds = $Hmax_queue_seconds[$h];}
if ( ($Hanswer_count[$h] > 0) and ($Htalk_sec[$h] > 0) )
{$Htalk_avg[$h] = ($Htalk_sec[$h] / $Hanswer_count[$h]);}
else
{$Htalk_avg[$h] = 0;}
if ( ($Hcalls_count[$h] > 0) and ($Hqueue_seconds[$h] > 0) )
{$Hqueue_avg[$h] = ($Hqueue_seconds[$h] / $Hcalls_count[$h]);}
else
{$Hqueue_avg[$h] = 0;}
$Htalk_avg[$h] = MathZDC($Htalk_sec[$h], $Hanswer_count[$h]);
$Hqueue_avg[$h] = MathZDC($Hqueue_seconds[$h], $Hcalls_count[$h]);
$sub_graph_stats[$q][0]=sprintf("%2s", $h);
$sub_graph_stats[$q][1]=$Hcalls_count[$h];
@@ -856,14 +845,8 @@ else
$h++;
}
if ( ($hTOTanswer_count > 0) and ($hTOTtalk_sec > 0) )
{$hTOTtalk_avg = ($hTOTtalk_sec / $hTOTanswer_count);}
else
{$hTOTtalk_avg = 0;}
if ( ($hTOTcalls_count > 0) and ($hTOTqueue_seconds > 0) )
{$hTOTqueue_avg = ($hTOTqueue_seconds / $hTOTcalls_count);}
else
{$hTOTqueue_avg = 0;}
$hTOTtalk_avg = MathZDC($hTOTtalk_sec, $hTOTanswer_count);
$hTOTqueue_avg = MathZDC($hTOTqueue_seconds, $hTOTcalls_count);
$gTOTcalls_count+=$hTOTcalls_count;
$gTOTanswer_count+=$hTOTanswer_count;
@@ -892,14 +875,14 @@ else
for ($q=0; $q<count($sub_graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($sub_graph_stats)) {$class=" last";} else {$class="";}
$sub_CALLS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][1]/$sub_max_calls)."' height='16' />".$sub_graph_stats[$q][1]."</td></tr>";
$sub_ANSWER_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][2]/$sub_max_answer)."' height='16' />".$sub_graph_stats[$q][2]."</td></tr>";
$sub_TALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][3]/$sub_max_talk)."' height='16' />".sec_convert($sub_graph_stats[$q][3],'H')."</td></tr>";
$sub_AVGTALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][4]/$sub_max_avgtalk)."' height='16' />".sec_convert($sub_graph_stats[$q][4],'H')."</td></tr>";
$sub_QUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][5]/$sub_max_queue)."' height='16' />".sec_convert($sub_graph_stats[$q][5],'H')."</td></tr>";
$sub_AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][6]/$sub_max_avgqueue)."' height='16' />".sec_convert($sub_graph_stats[$q][6],'H')."</td></tr>";
$sub_MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][7]/$sub_max_maxqueue)."' height='16' />".sec_convert($sub_graph_stats[$q][7],'H')."</td></tr>";
$sub_TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][8]/$sub_max_totalabandons)."' height='16' />".$sub_graph_stats[$q][8]."</td></tr>";
$sub_CALLS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][1], $sub_max_calls))."' height='16' />".$sub_graph_stats[$q][1]."</td></tr>";
$sub_ANSWER_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][2], $sub_max_answer))."' height='16' />".$sub_graph_stats[$q][2]."</td></tr>";
$sub_TALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][3], $sub_max_talk))."' height='16' />".sec_convert($sub_graph_stats[$q][3],'H')."</td></tr>";
$sub_AVGTALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][4], $sub_max_avgtalk))."' height='16' />".sec_convert($sub_graph_stats[$q][4],'H')."</td></tr>";
$sub_QUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][5], $sub_max_queue))."' height='16' />".sec_convert($sub_graph_stats[$q][5],'H')."</td></tr>";
$sub_AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][6], $sub_max_avgqueue))."' height='16' />".sec_convert($sub_graph_stats[$q][6],'H')."</td></tr>";
$sub_MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][7], $sub_max_maxqueue))."' height='16' />".sec_convert($sub_graph_stats[$q][7],'H')."</td></tr>";
$sub_TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$sub_graph_stats[$q][8], $sub_max_totalabandons))."' height='16' />".$sub_graph_stats[$q][8]."</td></tr>";
}
$sub_CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
$sub_ANSWER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTanswer_count)."</th></tr></table>";
@@ -941,37 +924,26 @@ else
$i++;
}
$rawTOTtalk_sec = $TOTtalk_sec;
$rawTOTtalk_min = round($rawTOTtalk_sec / 60);
$rawTOTtalk_min = round(MathZDC($rawTOTtalk_sec, 60));
if ( ($TOTanswer_count > 0) and ($TOTtalk_sec > 0) )
{$TOTtalk_avg = ($TOTtalk_sec / $TOTanswer_count);}
else
{$TOTtalk_avg = 0;}
if ( ($TOTcalls_count > 0) and ($TOTqueue_seconds > 0) )
{$TOTqueue_avg = ($TOTqueue_seconds / $TOTcalls_count);}
else
{$TOTqueue_avg = 0;}
$TOTtalk_avg = MathZDC($TOTtalk_sec, $TOTanswer_count);
$TOTqueue_avg = MathZDC($TOTqueue_seconds, $TOTcalls_count);
for ($q=0; $q<count($graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_calls)."' height='16' />".$graph_stats[$q][1]."</td></tr>";
$ANSWER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][2]/$max_answer)."' height='16' />".$graph_stats[$q][2]."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][3]/$max_talk)."' height='16' />".sec_convert($graph_stats[$q][3],'H')."</td></tr>";
$AVGTALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][4]/$max_avgtalk)."' height='16' />".sec_convert($graph_stats[$q][4],'H')."</td></tr>";
$QUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][5]/$max_queue)."' height='16' />".sec_convert($graph_stats[$q][5],'H')."</td></tr>";
$AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][6]/$max_avgqueue)."' height='16' />".sec_convert($graph_stats[$q][6],'H')."</td></tr>";
$MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][7]/$max_maxqueue)."' height='16' />".sec_convert($graph_stats[$q][7],'H')."</td></tr>";
$TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][8]/$max_totalabandons)."' height='16' />".$graph_stats[$q][8]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][1], $max_calls))."' height='16' />".$graph_stats[$q][1]."</td></tr>";
$ANSWER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][2], $max_answer))."' height='16' />".$graph_stats[$q][2]."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][3], $max_talk))."' height='16' />".sec_convert($graph_stats[$q][3],'H')."</td></tr>";
$AVGTALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][4], $max_avgtalk))."' height='16' />".sec_convert($graph_stats[$q][4],'H')."</td></tr>";
$QUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][5], $max_queue))."' height='16' />".sec_convert($graph_stats[$q][5],'H')."</td></tr>";
$AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][6], $max_avgqueue))."' height='16' />".sec_convert($graph_stats[$q][6],'H')."</td></tr>";
$MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][7], $max_maxqueue))."' height='16' />".sec_convert($graph_stats[$q][7],'H')."</td></tr>";
$TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][8], $max_totalabandons))."' height='16' />".$graph_stats[$q][8]."</td></tr>";
}
if ( ($gTOTanswer_count > 0) and ($gTOTtalk_sec > 0) )
{$gTOTtalk_avg = round($gTOTtalk_sec / $gTOTanswer_count);}
else
{$gTOTtalk_avg = 0;}
if ( ($gTOTcalls_count > 0) and ($gTOTqueue_seconds > 0) )
{$gTOTqueue_avg = round($gTOTqueue_seconds / $gTOTcalls_count);}
else
{$gTOTqueue_avg = 0;}
$gTOTtalk_avg = round(MathZDC($gTOTtalk_sec, $gTOTanswer_count));
$gTOTqueue_avg = round(MathZDC($gTOTqueue_seconds, $gTOTcalls_count));
$gTOTtalk_sec = sec_convert($gTOTtalk_sec,'H');
$gTOTtalk_avg = sec_convert($gTOTtalk_avg,'H');
$gTOTqueue_seconds = sec_convert($gTOTqueue_seconds,'H');
+28 -55
View File
@@ -20,6 +20,7 @@
# 130621-0758 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0734 - Changed to mysqli PHP functions
# 140108-0742 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -469,7 +470,7 @@ else
$EQsec = ( ($EQtime_ARY[0] * 3600) + ($EQtime_ARY[1] * 60) + ($EQtime_ARY[2] * 1) );
$DURATIONsec = ($EQepoch - $SQepoch);
$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
$DURATIONday = intval( MathZDC($DURATIONsec, 86400) + 1 );
if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
{
@@ -691,7 +692,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH_text.=" </tr>\n";
}
$GRAPH_text.=" <tr>\n";
@@ -782,25 +783,17 @@ else
{
if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;}
if ($totCALLSsecDATE[$d] > 0)
{
$totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]);
$totCALLSavgDATE[$d] = MathZDC($totCALLSsecDATE[$d], $totCALLSdate[$d]);
$totTIME_M = ($totCALLSsecDATE[$d] / 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
}
else
{
$totCALLSavgDATE[$d] = 0;
$totTIME_MS=' ';
}
$totTIME_M = MathZDC($totCALLSsecDATE[$d], 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
if ($totCALLSdate[$d] < 1)
{$totCALLSdate[$d]='';}
@@ -819,7 +812,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH_text.=" <tr>\n";
$GRAPH_text.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH_text.=" </tr>\n";
}
$GRAPH_text.=" <tr>\n";
@@ -854,8 +847,7 @@ else
while ($i < $TOTintervals)
{
if ($qrtCALLS[$i] > 0)
{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
$qrtCALLSavg[$i] = MathZDC($qrtCALLSsec[$i], $qrtCALLS[$i]);
if ($qrtCALLS[$i] > $hi_hour_count)
{$hi_hour_count = $qrtCALLS[$i];}
@@ -863,14 +855,8 @@ else
$i++;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{$hour_multiplier = (70 / $hi_hour_count);}
if ($hi_hold_count < 1)
{$hold_multiplier = 0;}
else
{$hold_multiplier = (70 / $hi_hold_count);}
$hour_multiplier = MathZDC(70, $hi_hour_count);
$hold_multiplier = MathZDC(70, $hi_hold_count);
@@ -894,15 +880,10 @@ else
$call_scale = '0';
while ($k <= 72)
{
if ( ($k < 1) or ($hour_multiplier <= 0) )
{$scale_num = 70;}
else
{
$TMPscale_num=(73 / $hour_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=($k / $hour_multiplier);
$scale_num = round($scale_num, 0);
}
$TMPscale_num=MathZDC(73, $hour_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$tmpscl = "$call_scale$TMPscale_num";
if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
@@ -923,15 +904,10 @@ else
$hold_scale = '0';
while ($k <= 72)
{
if ( ($k < 1) or ($hold_multiplier <= 0) )
{$scale_num = 70;}
else
{
$TMPscale_num=(73 / $hold_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=($k / $hold_multiplier);
$scale_num = round($scale_num, 0);
}
$TMPscale_num=MathZDC(73, $hold_multiplier);
$TMPscale_num = round($TMPscale_num, 0);
$scale_num=MathZDC($k, $hold_multiplier);
$scale_num = round($scale_num, 0);
$tmpscl = "$hold_scale$TMPscale_num";
if ( ($Mk >= 4) or (strlen($tmpscl)==73) )
@@ -1084,10 +1060,7 @@ else
}
if ($totQUEUEsec > 0)
{$totQUEUEavgRAW = ($totCALLS / $totQUEUEsec);}
else
{$totQUEUEavgRAW = 0;}
$totQUEUEavgRAW = MathZDC($totCALLS, $totQUEUEsec);
$totQUEUEavg = sprintf("%5s", $totQUEUEavg);
while (strlen($totQUEUEavg)>5) {$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);}
$totQUEUEmax = sprintf("%5s", $totQUEUEmax);
@@ -1105,9 +1078,9 @@ else
$graph_stats[$d][0]=preg_replace('/\s/', "", $graph_stats[$d][0]);
$GRAPH_text.=" <tr><td class='chart_td' width='50'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value' width='600' valign='bottom'>\n";
if ($graph_stats[$d][1]>0) {
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][1]/$max_calls)."px\">".$graph_stats[$d][1]."</li>";
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][1], $max_calls))."px\">".$graph_stats[$d][1]."</li>";
if ($graph_stats[$d][2]>0) {
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][2]/$max_calls)."px\">".$graph_stats[$d][2]."</li>";
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(MathZDC(600*$graph_stats[$d][2], $max_calls))."px\">".$graph_stats[$d][2]."</li>";
}
$GRAPH_text.="</ul>\n";
} else {
+21 -40
View File
@@ -15,6 +15,7 @@
# 130704-0939 - Fixed issue #675
# 130901-0820 - Changed to mysqli PHP functions
# 140108-0738 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -443,46 +444,36 @@ $Utotalsta=0;
$HTML_text.=sprintf("%20s", $queue_str)." | ";
$HTML_text.=sprintf("%20s", $Uqueue_str)." |";
if ( ($count_ary[$key][15] < 1) or ($count_ary[$key][1] < 1) )
{$UtotalPERCENT = '0';}
else
{$UtotalPERCENT = (($count_ary[$key][1] / $count_ary[$key][15]) * 100); $UtotalPERCENT = round($UtotalPERCENT, 2);}
$UtotalPERCENT = (MathZDC($count_ary[$key][1], $count_ary[$key][15]) * 100);
$UtotalPERCENT = round($UtotalPERCENT, 2);
$UtotalPERCENT = sprintf("%6s", $UtotalPERCENT);
$HTML_text.=$UtotalPERCENT." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][2])." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][3])." |";
if ( ($count_ary[$key][15] < 1) or ($count_ary[$key][3] < 1) )
{$UagentPERCENT = '0';}
else
{$UagentPERCENT = (($count_ary[$key][3] / $count_ary[$key][15]) * 100); $UagentPERCENT = round($UagentPERCENT, 2);}
$UagentPERCENT = (MathZDC($count_ary[$key][3], $count_ary[$key][15]) * 100);
$UagentPERCENT = round($UagentPERCENT, 2);
$UagentPERCENT = sprintf("%6s", $UagentPERCENT);
$HTML_text.=$UagentPERCENT." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][4])." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][5])." |";
if ( ($count_ary[$key][15] < 1) or ($count_ary[$key][5] < 1) )
{$UntfndPERCENT = '0';}
else
{$UntfndPERCENT = (($count_ary[$key][5] / $count_ary[$key][15]) * 100); $UntfndPERCENT = round($UntfndPERCENT, 2);}
$UntfndPERCENT = (MathZDC($count_ary[$key][5], $count_ary[$key][15]) * 100);
$UntfndPERCENT = round($UntfndPERCENT, 2);
$UntfndPERCENT = sprintf("%6s", $UntfndPERCENT);
$HTML_text.=$UntfndPERCENT." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][6])." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][7])." |";
if ( ($count_ary[$key][15] < 1) or ($count_ary[$key][7] < 1) )
{$UprdncPERCENT = '0';}
else
{$UprdncPERCENT = (($count_ary[$key][7] / $count_ary[$key][15]) * 100); $UprdncPERCENT = round($UprdncPERCENT, 2);}
$UprdncPERCENT = (MathZDC($count_ary[$key][7], $count_ary[$key][15]) * 100);
$UprdncPERCENT = round($UprdncPERCENT, 2);
$UprdncPERCENT = sprintf("%6s", $UprdncPERCENT);
$HTML_text.=$UprdncPERCENT." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][8])." | ";
$HTML_text.=sprintf("%6s", $count_ary[$key][9])." |";
if ( ($count_ary[$key][15] < 1) or ($count_ary[$key][9] < 1) )
{$UpsalePERCENT = '0';}
else
{$UpsalePERCENT = (($count_ary[$key][9] / $count_ary[$key][15]) * 100); $UpsalePERCENT = round($UpsalePERCENT, 2);}
$UpsalePERCENT = (MathZDC($count_ary[$key][9], $count_ary[$key][15]) * 100);
$UpsalePERCENT = round($UpsalePERCENT, 2);
$UpsalePERCENT = sprintf("%6s", $UpsalePERCENT);
$HTML_text.=$UpsalePERCENT." |\n";
@@ -507,46 +498,36 @@ $Utotalsta=0;
$HTML_text.=sprintf("%20s", $queue_str)." | ";
$HTML_text.=sprintf("%20s", $Uqueue_str)." |";
if ( ($Utotal < 1) or ($Utotalstq < 1) )
{$UtotalPERCENT = '0';}
else
{$UtotalPERCENT = (($Utotalstq / $Utotal) * 100); $UtotalPERCENT = round($UtotalPERCENT, 2);}
$UtotalPERCENT = (MathZDC($Utotalstq, $Utotal) * 100);
$UtotalPERCENT = round($UtotalPERCENT, 2);
$UtotalPERCENT = sprintf("%6s", $UtotalPERCENT);
$HTML_text.=$UtotalPERCENT." | ";
$HTML_text.=sprintf("%6s", $totalnocid)." | ";
$HTML_text.=sprintf("%6s", $Utotalnocid)." |";
if ( ($Utotal < 1) or ($Utotalnocid < 1) )
{$UnocidPERCENT = '0';}
else
{$UnocidPERCENT = (($Utotalnocid / $Utotal) * 100); $UnocidPERCENT = round($UnocidPERCENT, 2);}
$UnocidPERCENT = (MathZDC($Utotalnocid, $Utotal) * 100);
$UnocidPERCENT = round($UnocidPERCENT, 2);
$UnocidPERCENT = sprintf("%6s", $UnocidPERCENT);
$HTML_text.=$UnocidPERCENT." | ";
$HTML_text.=sprintf("%6s", $totaldnc)." | ";
$HTML_text.=sprintf("%6s", $Utotaldnc)." |";
if ( ($Utotal < 1) or ($Utotaldnc < 1) )
{$UprdncPERCENT = '0';}
else
{$UprdncPERCENT = (($Utotaldnc / $Utotal) * 100); $UprdncPERCENT = round($UprdncPERCENT, 2);}
$UprdncPERCENT = (MathZDC($Utotaldnc, $Utotal) * 100);
$UprdncPERCENT = round($UprdncPERCENT, 2);
$UprdncPERCENT = sprintf("%6s", $UprdncPERCENT);
$HTML_text.=$UprdncPERCENT." | ";
$HTML_text.=sprintf("%6s", $totalsale)." | ";
$HTML_text.=sprintf("%6s", $Utotalsale)." |";
if ( ($Utotal < 1) or ($Utotalsale < 1) )
{$UpsalePERCENT = '0';}
else
{$UpsalePERCENT = (($Utotalsale / $Utotal) * 100); $UpsalePERCENT = round($UpsalePERCENT, 2);}
$UpsalePERCENT = (MathZDC($Utotalsale, $Utotal) * 100);
$UpsalePERCENT = round($UpsalePERCENT, 2);
$UpsalePERCENT = sprintf("%6s", $UpsalePERCENT);
$HTML_text.=$UpsalePERCENT." | ";
$HTML_text.=sprintf("%6s", $totalarch)." | ";
$HTML_text.=sprintf("%6s", $Utotalarch)." |";
if ( ($Utotal < 1) or ($Utotalarch < 1) )
{$UarchPERCENT = '0';}
else
{$UarchPERCENT = (($Utotalarch / $Utotal) * 100); $UarchPERCENT = round($UarchPERCENT, 2);}
$UarchPERCENT = (MathZDC($Utotalarch, $Utotal) * 100);
$UarchPERCENT = round($UarchPERCENT, 2);
$UarchPERCENT = sprintf("%6s", $UarchPERCENT);
$HTML_text.=$UarchPERCENT." |\n";
+20 -38
View File
@@ -26,6 +26,7 @@
# 130704-0940 - Fixed issue #675
# 130901-0819 - Changed to mysqli PHP functions
# 140108-0737 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -758,11 +759,9 @@ else
$w++;
}
}
if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) )
{
$FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100);
$FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2);
}
$FLOWdropPCT[$s] = (MathZDC($FLOWdrop[$s], $FLOWtotal[$s]) * 100);
$FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2);
if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];}
if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];}
@@ -780,10 +779,10 @@ else
$FLOWsummary[1] = preg_replace('/\-\-\-\-\-\-\-\-\-\-/', ' / ', $FLOWsummary[1]);
$FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]);
$avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]);
$avgFLOWivr_time[$s] = MathZDC($FLOWivr_time[$s], $FLOWsummary[0]);
$avgFLOWivr_time[$s] = round($avgFLOWivr_time[$s], 0);
$avgFLOWivr_time[$s] = sprintf("%4s", $avgFLOWivr_time[$s]);
$avgFLOWtotal_time[$s] = ($FLOWtotal_time[$s] / $FLOWsummary[0]);
$avgFLOWtotal_time[$s] = MathZDC($FLOWtotal_time[$s], $FLOWsummary[0]);
$avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0);
$avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]);
@@ -807,21 +806,14 @@ else
$TOTALcalls = sprintf("%6s", $TOTALcalls);
$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
if ( ($totFLOWivr_time > 0) and ($TOTALcalls > 0) )
{$TavgFLOWivr_time = ($totFLOWivr_time / $TOTALcalls);}
$TavgFLOWivr_time = MathZDC($totFLOWivr_time, $TOTALcalls);
$TavgFLOWivr_time = round($TavgFLOWivr_time, 0);
$TavgFLOWivr_time = sprintf("%4s", $TavgFLOWivr_time);
if ( ($totFLOWtotal_time > 0) and ($TOTALcalls > 0) )
{$TavgFLOWtotal_time = ($totFLOWtotal_time / $TOTALcalls);}
$TavgFLOWtotal_time = MathZDC($totFLOWtotal_time, $TOTALcalls);
$TavgFLOWtotal_time = round($TavgFLOWtotal_time, 0);
$TavgFLOWtotal_time = sprintf("%4s", $TavgFLOWtotal_time);
if ( ($totFLOWtotal < 1) or ($totFLOWdrop < 1) )
{$totFLOWdropPCT = '0';}
else
{
$totFLOWdropPCT = (($totFLOWdrop / $totFLOWtotal) * 100);
$totFLOWdropPCT = round($totFLOWdropPCT, 0);
}
$totFLOWdropPCT = (MathZDC($totFLOWdrop, $totFLOWtotal) * 100);
$totFLOWdropPCT = round($totFLOWdropPCT, 0);
$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
@@ -832,12 +824,12 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$IVRCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_ivr_calls)."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUECALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_queue_calls)."' height='16' />".$graph_stats[$d][2]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUEDROPCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_queue_drops)."' height='16' />".$graph_stats[$d][3]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUEDROPPERCENT_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_queue_drops_percent)."' height='16' />".$graph_stats[$d][4]."%</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$IVRAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_ivr_avg)."' height='16' />".$graph_stats[$d][5]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$TOTALAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_total_avg)."' height='16' />".$graph_stats[$d][6]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$IVRCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_ivr_calls))."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUECALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_queue_calls))."' height='16' />".$graph_stats[$d][2]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUEDROPCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_queue_drops))."' height='16' />".$graph_stats[$d][3]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$QUEUEDROPPERCENT_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_queue_drops_percent))."' height='16' />".$graph_stats[$d][4]."%</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$IVRAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_ivr_avg))."' height='16' />".$graph_stats[$d][5]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
$TOTALAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_total_avg))."' height='16' />".$graph_stats[$d][6]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
}
$IVRCALLS_graph.="<tr><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
$QUEUECALLS_graph.="<tr><th class='thgraph' scope='col'>".trim($totFLOWtotal)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
@@ -955,13 +947,8 @@ else
$h++;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{
$hour_multiplier = (100 / $hi_hour_count);
#$hour_multiplier = round($hour_multiplier, 0);
}
$hour_multiplier = MathZDC(100, $hi_hour_count);
$MAIN.="<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
$MAIN.="GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS TAKEN INTO THIS IVR\n";
@@ -975,13 +962,8 @@ else
if ($Mk >= 5)
{
$Mk=0;
if ( ($k < 1) or ($hour_multiplier <= 0) )
{$scale_num = 100;}
else
{
$scale_num=($k / $hour_multiplier);
$scale_num = round($scale_num, 0);
}
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$LENscale_num = (strlen($scale_num));
$k = ($k + $LENscale_num);
$call_scale .= "$scale_num";
+47 -92
View File
@@ -19,6 +19,7 @@
# 130901-2025 - Changed to mysqli PHP functions
# 130926-0720 - Added link to lists view of report
# 140108-0715 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -273,7 +274,9 @@ else
# Get lists to query to avoid using a nested query
$lists_id_str="";
$list_stmt="SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand";
if ($DB) {echo "$list_stmt\n";}
$list_rslt=mysql_to_mysqli($list_stmt, $link);
$lists_id_str="'',";
while ($lrow=mysqli_fetch_row($list_rslt)) {
$lists_id_str.="'$lrow[0]',";
}
@@ -290,7 +293,7 @@ while ($i < $statcats_to_print)
$vsc_id[$i] = $row[0];
$vsc_name[$i] = $row[1];
$category_statuses="";
$category_statuses="'',";
$status_stmt="select distinct status from vicidial_statuses where category='$row[0]' UNION select distinct status from vicidial_campaign_statuses where category='$row[0]' $group_SQLand";
if ($DB) {echo "$status_stmt\n";}
$status_rslt=mysql_to_mysqli($status_stmt, $link);
@@ -538,7 +541,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -586,11 +589,8 @@ else
$row=mysqli_fetch_row($rslt);
$HA_count = $row[0];
$flag_count+=$row[0];
if ($HA_count > 0)
{
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
$HA_percent = ( ($HA_count / $TOTALleads) * 100);
}
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
$HA_percent = ( MathZDC($HA_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($sale_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -601,11 +601,8 @@ else
$row=mysqli_fetch_row($rslt);
$SALE_count = $row[0];
$flag_count+=$row[0];
if ($SALE_count > 0)
{
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
$SALE_percent = ( ($SALE_count / $TOTALleads) * 100);
}
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
$SALE_percent = ( MathZDC($SALE_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($dnc_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -616,11 +613,8 @@ else
$row=mysqli_fetch_row($rslt);
$DNC_count = $row[0];
$flag_count+=$row[0];
if ($DNC_count > 0)
{
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
$DNC_percent = ( ($DNC_count / $TOTALleads) * 100);
}
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
$DNC_percent = ( MathZDC($DNC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($customer_contact_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -631,11 +625,8 @@ else
$row=mysqli_fetch_row($rslt);
$CC_count = $row[0];
$flag_count+=$row[0];
if ($CC_count > 0)
{
if ($C_count>$max_calls) {$max_calls=$CC_count;}
$CC_percent = ( ($CC_count / $TOTALleads) * 100);
}
if ($C_count>$max_calls) {$max_calls=$CC_count;}
$CC_percent = ( MathZDC($CC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($not_interested_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -646,11 +637,8 @@ else
$row=mysqli_fetch_row($rslt);
$NI_count = $row[0];
$flag_count+=$row[0];
if ($NI_count > 0)
{
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
$NI_percent = ( ($NI_count / $TOTALleads) * 100);
}
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
$NI_percent = ( MathZDC($NI_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($unworkable_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -661,11 +649,8 @@ else
$row=mysqli_fetch_row($rslt);
$UW_count = $row[0];
$flag_count+=$row[0];
if ($UW_count > 0)
{
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
$UW_percent = ( ($UW_count / $TOTALleads) * 100);
}
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
$UW_percent = ( MathZDC($UW_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($scheduled_callback_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -676,11 +661,8 @@ else
$row=mysqli_fetch_row($rslt);
$SC_count = $row[0];
$flag_count+=$row[0];
if ($SC_count > 0)
{
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( ($SC_count / $TOTALleads) * 100);
}
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( MathZDC($SC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($completed_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -691,11 +673,8 @@ else
$row=mysqli_fetch_row($rslt);
$COMP_count = $row[0];
$flag_count+=$row[0];
if ($COMP_count > 0)
{
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( ($COMP_count / $TOTALleads) * 100);
}
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( MathZDC($COMP_count, $TOTALleads) * 100);
}
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
@@ -743,35 +722,35 @@ else
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td first\">Human Answer</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value first\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$HA_count/$max_calls)."\" height=\"16\"/>".$HA_count." ($HA_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value first\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$HA_count, $max_calls))."\" height=\"16\"/>".$HA_count." ($HA_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Sale</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$SALE_count/$max_calls)."\" height=\"16\" />".$SALE_count." ($SALE_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$SALE_count, $max_calls))."\" height=\"16\" />".$SALE_count." ($SALE_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">DNC</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$DNC_count/$max_calls)."\" height=\"16\" />".$DNC_count." ($DNC_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$DNC_count, $max_calls))."\" height=\"16\" />".$DNC_count." ($DNC_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Customer Contact</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$CC_count/$max_calls)."\" height=\"16\" />".$CC_count." ($CC_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$CC_count, $max_calls))."\" height=\"16\" />".$CC_count." ($CC_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Not Interested</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$NI_count/$max_calls)."\" height=\"16\" />".$NI_count." ($NI_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$NI_count, $max_calls))."\" height=\"16\" />".$NI_count." ($NI_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Unworkable</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$UW_count/$max_calls)."\" height=\"16\" />".$UW_count." ($UW_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$UW_count, $max_calls))."\" height=\"16\" />".$UW_count." ($UW_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Scheduled Callbacks</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$SC_count/$max_calls)."\" height=\"16\" />".$SC_count." ($SC_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$SC_count, $max_calls))."\" height=\"16\" />".$SC_count." ($SC_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td last\">Completed</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value last\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$COMP_count/$max_calls)."\" height=\"16\" />".$COMP_count." ($COMP_percent%)</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value last\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$COMP_count, $max_calls))."\" height=\"16\" />".$COMP_count." ($COMP_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
@@ -833,7 +812,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -908,10 +887,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$HA_count = $row[0];
if ($HA_count > 0)
{
$HA_percent = ( ($HA_count / $LISTIDcalls[$i]) * 100);
}
$HA_percent = ( MathZDC($HA_count, $LISTIDcalls[$i]) * 100);
}
if ($HA_count>$max_flags) {$max_flags=$HA_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($sale_statuses);";
@@ -922,10 +898,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$SALE_count = $row[0];
if ($SALE_count > 0)
{
$SALE_percent = ( ($SALE_count / $LISTIDcalls[$i]) * 100);
}
$SALE_percent = ( MathZDC($SALE_count, $LISTIDcalls[$i]) * 100);
}
if ($SALE_count>$max_flags) {$max_flags=$SALE_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($dnc_statuses);";
@@ -936,10 +909,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$DNC_count = $row[0];
if ($DNC_count > 0)
{
$DNC_percent = ( ($DNC_count / $LISTIDcalls[$i]) * 100);
}
$DNC_percent = ( MathZDC($DNC_count, $LISTIDcalls[$i]) * 100);
}
if ($DNC_count>$max_flags) {$max_flags=$DNC_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($customer_contact_statuses);";
@@ -950,10 +920,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$CC_count = $row[0];
if ($CC_count > 0)
{
$CC_percent = ( ($CC_count / $LISTIDcalls[$i]) * 100);
}
$CC_percent = ( MathZDC($CC_count, $LISTIDcalls[$i]) * 100);
}
if ($CC_count>$max_flags) {$max_flags=$CC_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($not_interested_statuses);";
@@ -964,10 +931,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$NI_count = $row[0];
if ($NI_count > 0)
{
$NI_percent = ( ($NI_count / $LISTIDcalls[$i]) * 100);
}
$NI_percent = ( MathZDC($NI_count, $LISTIDcalls[$i]) * 100);
}
if ($NI_count>$max_flags) {$max_flags=$NI_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($unworkable_statuses);";
@@ -978,10 +942,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$UW_count = $row[0];
if ($UW_count > 0)
{
$UW_percent = ( ($UW_count / $LISTIDcalls[$i]) * 100);
}
$UW_percent = ( MathZDC($UW_count, $LISTIDcalls[$i]) * 100);
}
if ($UW_count>$max_flags) {$max_flags=$UW_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($scheduled_callback_statuses);";
@@ -992,10 +953,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$SC_count = $row[0];
if ($SC_count > 0)
{
$SC_percent = ( ($SC_count / $LISTIDcalls[$i]) * 100);
}
$SC_percent = ( MathZDC($SC_count, $LISTIDcalls[$i]) * 100);
}
if ($SC_count>$max_flags) {$max_flags=$SC_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($completed_statuses);";
@@ -1006,10 +964,7 @@ else
{
$row=mysqli_fetch_row($rslt);
$COMP_count = $row[0];
if ($COMP_count > 0)
{
$COMP_percent = ( ($COMP_count / $LISTIDcalls[$i]) * 100);
}
$COMP_percent = ( MathZDC($COMP_count, $LISTIDcalls[$i]) * 100);
}
if ($COMP_count>$max_flags) {$max_flags=$COMP_count;}
@@ -1044,14 +999,14 @@ else
$OUToutput .= " | STATUS BREAKDOWN: | COUNT |\n";
$OUToutput .= " +--------+-----------------------------------+------------+\n";
$FLAGS_graph.=" <tr><td class='chart_td first'>HUMAN ANSWER</td><td nowrap class='chart_td value first'><img src='images/bar.png' alt='' width='".round(400*$HA_count/$max_flags)."' height='16' />$HA_count ($HA_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>SALE</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$SALE_count/$max_flags)."' height='16' />$SALE_count ($SALE_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>DNC</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$DNC_count/$max_flags)."' height='16' />$DNC_count ($DNC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>CUSTOMER CONTACT</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$CC_count/$max_flags)."' height='16' />$CC_count ($CC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>NOT INTERESTED</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$NI_count/$max_flags)."' height='16' />$NI_count ($NI_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>UNWORKABLE</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$UW_count/$max_flags)."' height='16' />$UW_count ($UW_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>SCHEDULED CALLBACKS</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$SC_count/$max_flags)."' height='16' />$SC_count ($SC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td last'>COMPLETED</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$COMP_count/$max_flags)."' height='16' />$COMP_count ($COMP_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td first'>HUMAN ANSWER</td><td nowrap class='chart_td value first'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$HA_count, $max_flags))."' height='16' />$HA_count ($HA_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>SALE</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SALE_count, $max_flags))."' height='16' />$SALE_count ($SALE_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>DNC</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$DNC_count, $max_flags))."' height='16' />$DNC_count ($DNC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>CUSTOMER CONTACT</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$CC_count, $max_flags))."' height='16' />$CC_count ($CC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>NOT INTERESTED</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$NI_count, $max_flags))."' height='16' />$NI_count ($NI_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>UNWORKABLE</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(MathZDC(400*$UW_count, $max_flags))."' height='16' />$UW_count ($UW_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>SCHEDULED CALLBACKS</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SC_count, $max_flags))."' height='16' />$SC_count ($SC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td last'>COMPLETED</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(MathZDC(400*$COMP_count, $max_flags))."' height='16' />$COMP_count ($COMP_percent%)</td></tr>";
$CSV_text4.="\"STATUS FLAGS BREAKDOWN:\",\"(and % of total leads in the list)\"\n";
$CSV_text4.="\"Human Answer:\",\"$HA_count\",\"$HA_percent%\"\n";
@@ -1106,7 +1061,7 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$STATUS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_status)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$STATUS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_status))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
}
$STATUS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALleads)."</th></tr></table>";
$JS_onload.="\tDraw".$LISTIDlists[$i]."Graph('FLAGS', '1');\n";
+741 -89
View File
@@ -9,7 +9,7 @@
# CHANGES
# 140116-0839 - First build based upon AST_LISTS_campaign_stats.php
# 140121-0707 - Fixed small issue in List select mode
# 140124-0650 - Changed column formats, made data collection more efficient
# 140331-2122 - Converted division calculations to use MathZDC function, added HTML view
#
$startMS = microtime();
@@ -571,7 +571,189 @@ else
$CSV_text1.=",\"COMPLETED RATE 1st PASS\",\"COMPLETED RATE 2nd PASS\",\"COMPLETED RATE 3rd PASS\",\"COMPLETED RATE 4th PASS\",\"COMPLETED RATE 5th PASS\",\"COMPLETED RATE LIFE\"";
$CSV_text1.="\n";
$max_calls=1; $graph_stats=array();
$graph_stats=array();
$graph_stats2=array();
$max_stats2=array();
$GRAPH="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"LIST ID Summary\" class=\"horizontalgraph\">\n";
$GRAPH.="<caption align='top'>LIST ID SUMMARY</caption>";
$GRAPH.="<tr>\n";
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LIST</th>\n";
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LEADS</th>\n";
$GRAPH.="</tr>\n";
$GRAPH2="<tr>
<th class='column_header grey_graph_cell' id='callstatsgraph1' ><a href='#' onClick=\"DrawGraph('CONTACTS1', '1'); return false;\">CONTACTS 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph2' ><a href='#' onClick=\"DrawGraph('CONTACTS2', '2'); return false;\">CONTACTS 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph3' ><a href='#' onClick=\"DrawGraph('CONTACTS3', '3'); return false;\">CONTACTS 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph4' ><a href='#' onClick=\"DrawGraph('CONTACTS4', '4'); return false;\">CONTACTS 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph5' ><a href='#' onClick=\"DrawGraph('CONTACTS5', '5'); return false;\">CONTACTS 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph6' ><a href='#' onClick=\"DrawGraph('CONTACTSALL', '6'); return false;\">CONTACTS LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph7' ><a href='#' onClick=\"DrawGraph('CNTRATE1', '7'); return false;\">CNT RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph8' ><a href='#' onClick=\"DrawGraph('CNTRATE2', '8'); return false;\">CNT RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph9' ><a href='#' onClick=\"DrawGraph('CNTRATE3', '9'); return false;\">CNT RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph10'><a href='#' onClick=\"DrawGraph('CNTRATE4', '10'); return false;\">CNT RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph11'><a href='#' onClick=\"DrawGraph('CNTRATE5', '11'); return false;\">CNT RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph12'><a href='#' onClick=\"DrawGraph('CNTRATEALL', '12'); return false;\">CNT RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph13'><a href='#' onClick=\"DrawGraph('SALES1', '13'); return false;\">SALES 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph14'><a href='#' onClick=\"DrawGraph('SALES2', '14'); return false;\">SALES 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph15'><a href='#' onClick=\"DrawGraph('SALES3', '15'); return false;\">SALES 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph16'><a href='#' onClick=\"DrawGraph('SALES4', '16'); return false;\">SALES 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph17'><a href='#' onClick=\"DrawGraph('SALES5', '17'); return false;\">SALES 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph18'><a href='#' onClick=\"DrawGraph('SALESALL', '18'); return false;\">SALES LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph19'><a href='#' onClick=\"DrawGraph('CONVRATE1', '19'); return false;\">CONV RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph20'><a href='#' onClick=\"DrawGraph('CONVRATE2', '20'); return false;\">CONV RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph21'><a href='#' onClick=\"DrawGraph('CONVRATE3', '21'); return false;\">CONV RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph22'><a href='#' onClick=\"DrawGraph('CONVRATE4', '22'); return false;\">CONV RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph23'><a href='#' onClick=\"DrawGraph('CONVRATE5', '23'); return false;\">CONV RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph24'><a href='#' onClick=\"DrawGraph('CONVRATEALL', '24'); return false;\">CONV RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph25'><a href='#' onClick=\"DrawGraph('DNC1', '25'); return false;\">DNC 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph26'><a href='#' onClick=\"DrawGraph('DNC2', '26'); return false;\">DNC 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph27'><a href='#' onClick=\"DrawGraph('DNC3', '27'); return false;\">DNC 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph28'><a href='#' onClick=\"DrawGraph('DNC4', '28'); return false;\">DNC 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph29'><a href='#' onClick=\"DrawGraph('DNC5', '29'); return false;\">DNC 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph30'><a href='#' onClick=\"DrawGraph('DNCALL', '30'); return false;\">DNC LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph31'><a href='#' onClick=\"DrawGraph('DNCRATE1', '31'); return false;\">DNC RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph32'><a href='#' onClick=\"DrawGraph('DNCRATE2', '32'); return false;\">DNC RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph33'><a href='#' onClick=\"DrawGraph('DNCRATE3', '33'); return false;\">DNC RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph34'><a href='#' onClick=\"DrawGraph('DNCRATE4', '34'); return false;\">DNC RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph35'><a href='#' onClick=\"DrawGraph('DNCRATE5', '35'); return false;\">DNC RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph36'><a href='#' onClick=\"DrawGraph('DNCRATEALL', '36'); return false;\">DNC RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph37'><a href='#' onClick=\"DrawGraph('CUSTCNT1', '37'); return false;\">CUST CNT 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph38'><a href='#' onClick=\"DrawGraph('CUSTCNT2', '38'); return false;\">CUST CNT 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph39'><a href='#' onClick=\"DrawGraph('CUSTCNT3', '39'); return false;\">CUST CNT 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph40'><a href='#' onClick=\"DrawGraph('CUSTCNT4', '40'); return false;\">CUST CNT 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph41'><a href='#' onClick=\"DrawGraph('CUSTCNT5', '41'); return false;\">CUST CNT 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph42'><a href='#' onClick=\"DrawGraph('CUSTCNTALL', '42'); return false;\">CUST CNT LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph43'><a href='#' onClick=\"DrawGraph('CUSTCNTRATE1', '43'); return false;\">CUST CUSTCNT RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph44'><a href='#' onClick=\"DrawGraph('CUSTCNTRATE2', '44'); return false;\">CUST CUSTCNT RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph45'><a href='#' onClick=\"DrawGraph('CUSTCNTRATE3', '45'); return false;\">CUST CUSTCNT RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph46'><a href='#' onClick=\"DrawGraph('CUSTCNTRATE4', '46'); return false;\">CUST CUSTCNT RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph47'><a href='#' onClick=\"DrawGraph('CUSTCNTRATE5', '47'); return false;\">CUST CUSTCNT RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph48'><a href='#' onClick=\"DrawGraph('CUSTCNTRATEALL', '48'); return false;\">CUST CUSTCNT RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph49'><a href='#' onClick=\"DrawGraph('UNWRK1', '49'); return false;\">UNWRK 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph50'><a href='#' onClick=\"DrawGraph('UNWRK2', '50'); return false;\">UNWRK 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph51'><a href='#' onClick=\"DrawGraph('UNWRK3', '51'); return false;\">UNWRK 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph52'><a href='#' onClick=\"DrawGraph('UNWRK4', '52'); return false;\">UNWRK 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph53'><a href='#' onClick=\"DrawGraph('UNWRK5', '53'); return false;\">UNWRK 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph54'><a href='#' onClick=\"DrawGraph('UNWRKALL', '54'); return false;\">UNWRK LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph55'><a href='#' onClick=\"DrawGraph('UNWRKRATE1', '55'); return false;\">UNWRK RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph56'><a href='#' onClick=\"DrawGraph('UNWRKRATE2', '56'); return false;\">UNWRK RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph57'><a href='#' onClick=\"DrawGraph('UNWRKRATE3', '57'); return false;\">UNWRK RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph58'><a href='#' onClick=\"DrawGraph('UNWRKRATE4', '58'); return false;\">UNWRK RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph59'><a href='#' onClick=\"DrawGraph('UNWRKRATE5', '59'); return false;\">UNWRK RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph60'><a href='#' onClick=\"DrawGraph('UNWRKRATEALL', '60'); return false;\">UNWRK RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph61'><a href='#' onClick=\"DrawGraph('SCHDCLBK1', '61'); return false;\">SCHD CLBK 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph62'><a href='#' onClick=\"DrawGraph('SCHDCLBK2', '62'); return false;\">SCHD CLBK 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph63'><a href='#' onClick=\"DrawGraph('SCHDCLBK3', '63'); return false;\">SCHD CLBK 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph64'><a href='#' onClick=\"DrawGraph('SCHDCLBK4', '64'); return false;\">SCHD CLBK 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph65'><a href='#' onClick=\"DrawGraph('SCHDCLBK5', '65'); return false;\">SCHD CLBK 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph66'><a href='#' onClick=\"DrawGraph('SCHDCLBKALL', '66'); return false;\">SCHD CLBK LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph67'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATE1', '67'); return false;\">SCHD CLBK RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph68'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATE2', '68'); return false;\">SCHD CLBK RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph69'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATE3', '69'); return false;\">SCHD CLBK RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph70'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATE4', '70'); return false;\">SCHD CLBK RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph71'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATE5', '71'); return false;\">SCHD CLBK RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph72'><a href='#' onClick=\"DrawGraph('SCHDCLBKRATEALL', '72'); return false;\">SCHD CLBK RATE LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph73'><a href='#' onClick=\"DrawGraph('COMPLTD1', '73'); return false;\">COMPLTD 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph74'><a href='#' onClick=\"DrawGraph('COMPLTD2', '74'); return false;\">COMPLTD 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph75'><a href='#' onClick=\"DrawGraph('COMPLTD3', '75'); return false;\">COMPLTD 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph76'><a href='#' onClick=\"DrawGraph('COMPLTD4', '76'); return false;\">COMPLTD 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph77'><a href='#' onClick=\"DrawGraph('COMPLTD5', '77'); return false;\">COMPLTD 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph78'><a href='#' onClick=\"DrawGraph('COMPLTDALL', '78'); return false;\">COMPLTD LIFE</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph79'><a href='#' onClick=\"DrawGraph('COMPLTDRATE1', '79'); return false;\">COMPLTD RATE 1st PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph80'><a href='#' onClick=\"DrawGraph('COMPLTDRATE2', '80'); return false;\">COMPLTD RATE 2nd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph81'><a href='#' onClick=\"DrawGraph('COMPLTDRATE3', '81'); return false;\">COMPLTD RATE 3rd PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph82'><a href='#' onClick=\"DrawGraph('COMPLTDRATE4', '82'); return false;\">COMPLTD RATE 4th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph83'><a href='#' onClick=\"DrawGraph('COMPLTDRATE5', '83'); return false;\">COMPLTD RATE 5th PASS</a></th>
<th class='column_header grey_graph_cell' id='callstatsgraph84'><a href='#' onClick=\"DrawGraph('COMPLTDRATEALL', '84'); return false;\">COMPLTD RATE LIFE</a></th>
";
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>LIST ID SUMMARY</caption><tr><th class='thgraph' scope='col'>LISTS</th>";
$CONTACTS1_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS 1st PASS</th></tr>";
$CONTACTS2_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS 2nd PASS</th></tr>";
$CONTACTS3_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS 3rd PASS</th></tr>";
$CONTACTS4_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS 4th PASS</th></tr>";
$CONTACTS5_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS 5th PASS</th></tr>";
$CONTACTSALL_graph=$graph_header."<th class='thgraph' scope='col'>CONTACTS LIFE</th></tr>";
$CNTRATE1_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE 1st PASS</th></tr>";
$CNTRATE2_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE 2nd PASS</th></tr>";
$CNTRATE3_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE 3rd PASS</th></tr>";
$CNTRATE4_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE 4th PASS</th></tr>";
$CNTRATE5_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE 5th PASS</th></tr>";
$CNTRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>CNT RATE LIFE</th></tr>";
$SALES1_graph=$graph_header."<th class='thgraph' scope='col'>SALES 1st PASS</th></tr>";
$SALES2_graph=$graph_header."<th class='thgraph' scope='col'>SALES 2nd PASS</th></tr>";
$SALES3_graph=$graph_header."<th class='thgraph' scope='col'>SALES 3rd PASS</th></tr>";
$SALES4_graph=$graph_header."<th class='thgraph' scope='col'>SALES 4th PASS</th></tr>";
$SALES5_graph=$graph_header."<th class='thgraph' scope='col'>SALES 5th PASS</th></tr>";
$SALESALL_graph=$graph_header."<th class='thgraph' scope='col'>SALES LIFE</th></tr>";
$CONVRATE1_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE 1st PASS</th></tr>";
$CONVRATE2_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE 2nd PASS</th></tr>";
$CONVRATE3_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE 3rd PASS</th></tr>";
$CONVRATE4_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE 4th PASS</th></tr>";
$CONVRATE5_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE 5th PASS</th></tr>";
$CONVRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>CONV RATE LIFE</th></tr>";
$DNC1_graph=$graph_header."<th class='thgraph' scope='col'>DNC 1st PASS</th></tr>";
$DNC2_graph=$graph_header."<th class='thgraph' scope='col'>DNC 2nd PASS</th></tr>";
$DNC3_graph=$graph_header."<th class='thgraph' scope='col'>DNC 3rd PASS</th></tr>";
$DNC4_graph=$graph_header."<th class='thgraph' scope='col'>DNC 4th PASS</th></tr>";
$DNC5_graph=$graph_header."<th class='thgraph' scope='col'>DNC 5th PASS</th></tr>";
$DNCALL_graph=$graph_header."<th class='thgraph' scope='col'>DNC LIFE</th></tr>";
$DNCRATE1_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE 1st PASS</th></tr>";
$DNCRATE2_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE 2nd PASS</th></tr>";
$DNCRATE3_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE 3rd PASS</th></tr>";
$DNCRATE4_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE 4th PASS</th></tr>";
$DNCRATE5_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE 5th PASS</th></tr>";
$DNCRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>DNC RATE LIFE</th></tr>";
$CUSTCNT1_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT 1st PASS</th></tr>";
$CUSTCNT2_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT 2nd PASS</th></tr>";
$CUSTCNT3_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT 3rd PASS</th></tr>";
$CUSTCNT4_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT 4th PASS</th></tr>";
$CUSTCNT5_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT 5th PASS</th></tr>";
$CUSTCNTALL_graph=$graph_header."<th class='thgraph' scope='col'>CUST CNT LIFE</th></tr>";
$CUSTCNTRATE1_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE 1st PASS</th></tr>";
$CUSTCNTRATE2_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE 2nd PASS</th></tr>";
$CUSTCNTRATE3_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE 3rd PASS</th></tr>";
$CUSTCNTRATE4_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE 4th PASS</th></tr>";
$CUSTCNTRATE5_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE 5th PASS</th></tr>";
$CUSTCNTRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>CUST CUSTCNT RATE LIFE</th></tr>";
$UNWRK1_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK 1st PASS</th></tr>";
$UNWRK2_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK 2nd PASS</th></tr>";
$UNWRK3_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK 3rd PASS</th></tr>";
$UNWRK4_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK 4th PASS</th></tr>";
$UNWRK5_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK 5th PASS</th></tr>";
$UNWRKALL_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK LIFE</th></tr>";
$UNWRKRATE1_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE 1st PASS</th></tr>";
$UNWRKRATE2_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE 2nd PASS</th></tr>";
$UNWRKRATE3_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE 3rd PASS</th></tr>";
$UNWRKRATE4_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE 4th PASS</th></tr>";
$UNWRKRATE5_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE 5th PASS</th></tr>";
$UNWRKRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>UNWRK RATE LIFE</th></tr>";
$SCHDCLBK1_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK 1st PASS</th></tr>";
$SCHDCLBK2_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK 2nd PASS</th></tr>";
$SCHDCLBK3_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK 3rd PASS</th></tr>";
$SCHDCLBK4_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK 4th PASS</th></tr>";
$SCHDCLBK5_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK 5th PASS</th></tr>";
$SCHDCLBKALL_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK LIFE</th></tr>";
$SCHDCLBKRATE1_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE 1st PASS</th></tr>";
$SCHDCLBKRATE2_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE 2nd PASS</th></tr>";
$SCHDCLBKRATE3_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE 3rd PASS</th></tr>";
$SCHDCLBKRATE4_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE 4th PASS</th></tr>";
$SCHDCLBKRATE5_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE 5th PASS</th></tr>";
$SCHDCLBKRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>SCHD CLBK RATE LIFE</th></tr>";
$COMPLTD1_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD 1st PASS</th></tr>";
$COMPLTD2_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD 2nd PASS</th></tr>";
$COMPLTD3_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD 3rd PASS</th></tr>";
$COMPLTD4_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD 4th PASS</th></tr>";
$COMPLTD5_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD 5th PASS</th></tr>";
$COMPLTDALL_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD LIFE</th></tr>";
$COMPLTDRATE1_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE 1st PASS</th></tr>";
$COMPLTDRATE2_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE 2nd PASS</th></tr>";
$COMPLTDRATE3_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE 3rd PASS</th></tr>";
$COMPLTDRATE4_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE 4th PASS</th></tr>";
$COMPLTDRATE5_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE 5th PASS</th></tr>";
$COMPLTDRATEALL_graph=$graph_header."<th class='thgraph' scope='col'>COMPLTD RATE LIFE</th></tr>";
$lists_id_str="";
$list_stmt="SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand";
@@ -597,6 +779,7 @@ else
if ($row[0]>$max_calls) {$max_calls=$row[0];}
$graph_stats[$i][0]=$row[0];
$graph_stats[$i][1]=$row[1];
$graph_stats2[$i][0]=$row[1];
$i++;
}
if (strlen($list_id_SQL)>2) {$list_id_SQL = substr("$list_id_SQL", 0, -1);}
@@ -615,10 +798,11 @@ else
$LISTIDlist_names[$i] = $row[0];
$LISTIDcampaign[$i] = $row[2];
$graph_stats[$i][1].=" - $row[0]";
$graph_stats2[$i][0].=" - $row[0]";
if ($row[1]=='Y')
{$LISTIDlist_active[$i] = 'ACTIVE '; $graph_stats[$i][1].=" (ACTIVE)";}
{$LISTIDlist_active[$i] = 'ACTIVE '; $graph_stats[$i][1].=" (ACTIVE)"; $graph_stats2[$i][0].=" (ACTIVE)";}
else
{$LISTIDlist_active[$i] = 'INACTIVE'; $graph_stats[$i][1].=" (INACTIVE)";}
{$LISTIDlist_active[$i] = 'INACTIVE'; $graph_stats[$i][1].=" (INACTIVE)"; $graph_stats2[$i][0].=" (INACTIVE)";}
}
$LISTIDentry_date[$i]='';
@@ -724,12 +908,12 @@ else
$HR_three_count_pct=0;
$HR_four_count_pct=0;
$HR_five_count_pct=0;
if ( ($HR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_count_pct = (($HR_count / $LISTIDcalls[$i]) * 100);}
if ( ($HR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_one_count_pct = (($HR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($HR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_two_count_pct = (($HR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($HR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_three_count_pct = (($HR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($HR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_four_count_pct = (($HR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($HR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$HR_five_count_pct = (($HR_five_count / $LISTIDcalls[$i]) * 100);}
$HR_count_pct = (MathZDC($HR_count, $LISTIDcalls[$i]) * 100);
$HR_one_count_pct = (MathZDC($HR_one_count, $LISTIDcalls[$i]) * 100);
$HR_two_count_pct = (MathZDC($HR_two_count, $LISTIDcalls[$i]) * 100);
$HR_three_count_pct = (MathZDC($HR_three_count, $LISTIDcalls[$i]) * 100);
$HR_four_count_pct = (MathZDC($HR_four_count, $LISTIDcalls[$i]) * 100);
$HR_five_count_pct = (MathZDC($HR_five_count, $LISTIDcalls[$i]) * 100);
$HR_countS = sprintf("%6.2f", $HR_count_pct); while(strlen($HR_countS)>7) {$HR_countS = substr("$HR_countS", 0, -1);}
$HR_one_countS = sprintf("%6.2f", $HR_one_count_pct); while(strlen($HR_one_countS)>7) {$HR_one_countS = substr("$HR_one_countS", 0, -1);}
@@ -833,12 +1017,12 @@ else
$SR_three_count_pct=0;
$SR_four_count_pct=0;
$SR_five_count_pct=0;
if ( ($SR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_count_pct = (($SR_count / $LISTIDcalls[$i]) * 100);}
if ( ($SR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_one_count_pct = (($SR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($SR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_two_count_pct = (($SR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($SR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_three_count_pct = (($SR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($SR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_four_count_pct = (($SR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($SR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$SR_five_count_pct = (($SR_five_count / $LISTIDcalls[$i]) * 100);}
$SR_count_pct = (MathZDC($SR_count, $LISTIDcalls[$i]) * 100);
$SR_one_count_pct = (MathZDC($SR_one_count, $LISTIDcalls[$i]) * 100);
$SR_two_count_pct = (MathZDC($SR_two_count, $LISTIDcalls[$i]) * 100);
$SR_three_count_pct = (MathZDC($SR_three_count, $LISTIDcalls[$i]) * 100);
$SR_four_count_pct = (MathZDC($SR_four_count, $LISTIDcalls[$i]) * 100);
$SR_five_count_pct = (MathZDC($SR_five_count, $LISTIDcalls[$i]) * 100);
$SR_countS = sprintf("%6.2f", $SR_count_pct); while(strlen($SR_countS)>7) {$SR_countS = substr("$SR_countS", 0, -1);}
$SR_one_countS = sprintf("%6.2f", $SR_one_count_pct); while(strlen($SR_one_countS)>7) {$SR_one_countS = substr("$SR_one_countS", 0, -1);}
@@ -942,12 +1126,12 @@ else
$DR_three_count_pct=0;
$DR_four_count_pct=0;
$DR_five_count_pct=0;
if ( ($DR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_count_pct = (($DR_count / $LISTIDcalls[$i]) * 100);}
if ( ($DR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_one_count_pct = (($DR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($DR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_two_count_pct = (($DR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($DR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_three_count_pct = (($DR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($DR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_four_count_pct = (($DR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($DR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$DR_five_count_pct = (($DR_five_count / $LISTIDcalls[$i]) * 100);}
$DR_count_pct = (MathZDC($DR_count, $LISTIDcalls[$i]) * 100);
$DR_one_count_pct = (MathZDC($DR_one_count, $LISTIDcalls[$i]) * 100);
$DR_two_count_pct = (MathZDC($DR_two_count, $LISTIDcalls[$i]) * 100);
$DR_three_count_pct = (MathZDC($DR_three_count, $LISTIDcalls[$i]) * 100);
$DR_four_count_pct = (MathZDC($DR_four_count, $LISTIDcalls[$i]) * 100);
$DR_five_count_pct = (MathZDC($DR_five_count, $LISTIDcalls[$i]) * 100);
$DR_countS = sprintf("%6.2f", $DR_count_pct); while(strlen($DR_countS)>7) {$DR_countS = substr("$DR_countS", 0, -1);}
$DR_one_countS = sprintf("%6.2f", $DR_one_count_pct); while(strlen($DR_one_countS)>7) {$DR_one_countS = substr("$DR_one_countS", 0, -1);}
@@ -1051,12 +1235,12 @@ else
$CR_three_count_pct=0;
$CR_four_count_pct=0;
$CR_five_count_pct=0;
if ( ($CR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_count_pct = (($CR_count / $LISTIDcalls[$i]) * 100);}
if ( ($CR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_one_count_pct = (($CR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($CR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_two_count_pct = (($CR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($CR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_three_count_pct = (($CR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($CR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_four_count_pct = (($CR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($CR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$CR_five_count_pct = (($CR_five_count / $LISTIDcalls[$i]) * 100);}
$CR_count_pct = (MathZDC($CR_count, $LISTIDcalls[$i]) * 100);
$CR_one_count_pct = (MathZDC($CR_one_count, $LISTIDcalls[$i]) * 100);
$CR_two_count_pct = (MathZDC($CR_two_count, $LISTIDcalls[$i]) * 100);
$CR_three_count_pct = (MathZDC($CR_three_count, $LISTIDcalls[$i]) * 100);
$CR_four_count_pct = (MathZDC($CR_four_count, $LISTIDcalls[$i]) * 100);
$CR_five_count_pct = (MathZDC($CR_five_count, $LISTIDcalls[$i]) * 100);
$CR_countS = sprintf("%6.2f", $CR_count_pct); while(strlen($CR_countS)>7) {$CR_countS = substr("$CR_countS", 0, -1);}
$CR_one_countS = sprintf("%6.2f", $CR_one_count_pct); while(strlen($CR_one_countS)>7) {$CR_one_countS = substr("$CR_one_countS", 0, -1);}
@@ -1160,12 +1344,12 @@ else
$UR_three_count_pct=0;
$UR_four_count_pct=0;
$UR_five_count_pct=0;
if ( ($UR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_count_pct = (($UR_count / $LISTIDcalls[$i]) * 100);}
if ( ($UR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_one_count_pct = (($UR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($UR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_two_count_pct = (($UR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($UR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_three_count_pct = (($UR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($UR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_four_count_pct = (($UR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($UR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$UR_five_count_pct = (($UR_five_count / $LISTIDcalls[$i]) * 100);}
$UR_count_pct = (MathZDC($UR_count, $LISTIDcalls[$i]) * 100);
$UR_one_count_pct = (MathZDC($UR_one_count, $LISTIDcalls[$i]) * 100);
$UR_two_count_pct = (MathZDC($UR_two_count, $LISTIDcalls[$i]) * 100);
$UR_three_count_pct = (MathZDC($UR_three_count, $LISTIDcalls[$i]) * 100);
$UR_four_count_pct = (MathZDC($UR_four_count, $LISTIDcalls[$i]) * 100);
$UR_five_count_pct = (MathZDC($UR_five_count, $LISTIDcalls[$i]) * 100);
$UR_countS = sprintf("%6.2f", $UR_count_pct); while(strlen($UR_countS)>7) {$UR_countS = substr("$UR_countS", 0, -1);}
$UR_one_countS = sprintf("%6.2f", $UR_one_count_pct); while(strlen($UR_one_countS)>7) {$UR_one_countS = substr("$UR_one_countS", 0, -1);}
@@ -1269,12 +1453,12 @@ else
$BR_three_count_pct=0;
$BR_four_count_pct=0;
$BR_five_count_pct=0;
if ( ($BR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_count_pct = (($BR_count / $LISTIDcalls[$i]) * 100);}
if ( ($BR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_one_count_pct = (($BR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($BR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_two_count_pct = (($BR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($BR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_three_count_pct = (($BR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($BR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_four_count_pct = (($BR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($BR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$BR_five_count_pct = (($BR_five_count / $LISTIDcalls[$i]) * 100);}
$BR_count_pct = (MathZDC($BR_count, $LISTIDcalls[$i]) * 100);
$BR_one_count_pct = (MathZDC($BR_one_count, $LISTIDcalls[$i]) * 100);
$BR_two_count_pct = (MathZDC($BR_two_count, $LISTIDcalls[$i]) * 100);
$BR_three_count_pct = (MathZDC($BR_three_count, $LISTIDcalls[$i]) * 100);
$BR_four_count_pct = (MathZDC($BR_four_count, $LISTIDcalls[$i]) * 100);
$BR_five_count_pct = (MathZDC($BR_five_count, $LISTIDcalls[$i]) * 100);
$BR_countS = sprintf("%6.2f", $BR_count_pct); while(strlen($BR_countS)>7) {$BR_countS = substr("$BR_countS", 0, -1);}
$BR_one_countS = sprintf("%6.2f", $BR_one_count_pct); while(strlen($BR_one_countS)>7) {$BR_one_countS = substr("$BR_one_countS", 0, -1);}
@@ -1378,12 +1562,12 @@ else
$MR_three_count_pct=0;
$MR_four_count_pct=0;
$MR_five_count_pct=0;
if ( ($MR_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_count_pct = (($MR_count / $LISTIDcalls[$i]) * 100);}
if ( ($MR_one_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_one_count_pct = (($MR_one_count / $LISTIDcalls[$i]) * 100);}
if ( ($MR_two_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_two_count_pct = (($MR_two_count / $LISTIDcalls[$i]) * 100);}
if ( ($MR_three_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_three_count_pct = (($MR_three_count / $LISTIDcalls[$i]) * 100);}
if ( ($MR_four_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_four_count_pct = (($MR_four_count / $LISTIDcalls[$i]) * 100);}
if ( ($MR_five_count > 0) and ($LISTIDcalls[$i] > 0) ) {$MR_five_count_pct = (($MR_five_count / $LISTIDcalls[$i]) * 100);}
$MR_count_pct = (MathZDC($MR_count, $LISTIDcalls[$i]) * 100);
$MR_one_count_pct = (MathZDC($MR_one_count, $LISTIDcalls[$i]) * 100);
$MR_two_count_pct = (MathZDC($MR_two_count, $LISTIDcalls[$i]) * 100);
$MR_three_count_pct = (MathZDC($MR_three_count, $LISTIDcalls[$i]) * 100);
$MR_four_count_pct = (MathZDC($MR_four_count, $LISTIDcalls[$i]) * 100);
$MR_five_count_pct = (MathZDC($MR_five_count, $LISTIDcalls[$i]) * 100);
$MR_countS = sprintf("%6.2f", $MR_count_pct); while(strlen($MR_countS)>7) {$MR_countS = substr("$MR_countS", 0, -1);}
$MR_one_countS = sprintf("%6.2f", $MR_one_count_pct); while(strlen($MR_one_countS)>7) {$MR_one_countS = substr("$MR_one_countS", 0, -1);}
@@ -1437,10 +1621,105 @@ else
$CSV_text1.=",\"$MP_one_countS\",\"$MP_two_countS\",\"$MP_three_countS\",\"$MP_four_countS\",\"$MP_five_countS\",\"$MP_countS\"";
$CSV_text1.=",\"$MR_one_countS%\",\"$MR_two_countS%\",\"$MR_three_countS%\",\"$MR_four_countS%\",\"$MR_five_countS%\",\"$MR_countS%\"";
$CSV_text1.="\n";
$graph_stats2[$i][1]=$HA_one_countS;
$graph_stats2[$i][2]=$HA_two_countS;
$graph_stats2[$i][3]=$HA_three_countS;
$graph_stats2[$i][4]=$HA_four_countS;
$graph_stats2[$i][5]=$HA_five_countS;
$graph_stats2[$i][6]=$HA_countS;
$graph_stats2[$i][7]=$HR_one_countS;
$graph_stats2[$i][8]=$HR_two_countS;
$graph_stats2[$i][9]=$HR_three_countS;
$graph_stats2[$i][10]=$HR_four_countS;
$graph_stats2[$i][11]=$HR_five_countS;
$graph_stats2[$i][12]=$HR_countS;
$graph_stats2[$i][13]=$SA_one_countS;
$graph_stats2[$i][14]=$SA_two_countS;
$graph_stats2[$i][15]=$SA_three_countS;
$graph_stats2[$i][16]=$SA_four_countS;
$graph_stats2[$i][17]=$SA_five_countS;
$graph_stats2[$i][18]=$SA_countS;
$graph_stats2[$i][19]=$SR_one_countS;
$graph_stats2[$i][20]=$SR_two_countS;
$graph_stats2[$i][21]=$SR_three_countS;
$graph_stats2[$i][22]=$SR_four_countS;
$graph_stats2[$i][23]=$SR_five_countS;
$graph_stats2[$i][24]=$SR_countS;
$graph_stats2[$i][25]=$DN_one_countS;
$graph_stats2[$i][26]=$DN_two_countS;
$graph_stats2[$i][27]=$DN_three_countS;
$graph_stats2[$i][28]=$DN_four_countS;
$graph_stats2[$i][29]=$DN_five_countS;
$graph_stats2[$i][30]=$DN_countS;
$graph_stats2[$i][31]=$DR_one_countS;
$graph_stats2[$i][32]=$DR_two_countS;
$graph_stats2[$i][33]=$DR_three_countS;
$graph_stats2[$i][34]=$DR_four_countS;
$graph_stats2[$i][35]=$DR_five_countS;
$graph_stats2[$i][36]=$DR_countS;
$graph_stats2[$i][37]=$CC_one_countS;
$graph_stats2[$i][38]=$CC_two_countS;
$graph_stats2[$i][39]=$CC_three_countS;
$graph_stats2[$i][40]=$CC_four_countS;
$graph_stats2[$i][41]=$CC_five_countS;
$graph_stats2[$i][42]=$CC_countS;
$graph_stats2[$i][43]=$CR_one_countS;
$graph_stats2[$i][44]=$CR_two_countS;
$graph_stats2[$i][45]=$CR_three_countS;
$graph_stats2[$i][46]=$CR_four_countS;
$graph_stats2[$i][47]=$CR_five_countS;
$graph_stats2[$i][48]=$CR_countS;
$graph_stats2[$i][49]=$UW_one_countS;
$graph_stats2[$i][50]=$UW_two_countS;
$graph_stats2[$i][51]=$UW_three_countS;
$graph_stats2[$i][52]=$UW_four_countS;
$graph_stats2[$i][53]=$UW_five_countS;
$graph_stats2[$i][54]=$UW_countS;
$graph_stats2[$i][55]=$UR_one_countS;
$graph_stats2[$i][56]=$UR_two_countS;
$graph_stats2[$i][57]=$UR_three_countS;
$graph_stats2[$i][58]=$UR_four_countS;
$graph_stats2[$i][59]=$UR_five_countS;
$graph_stats2[$i][60]=$UR_countS;
$graph_stats2[$i][61]=$BA_one_countS;
$graph_stats2[$i][62]=$BA_two_countS;
$graph_stats2[$i][63]=$BA_three_countS;
$graph_stats2[$i][64]=$BA_four_countS;
$graph_stats2[$i][65]=$BA_five_countS;
$graph_stats2[$i][66]=$BA_countS;
$graph_stats2[$i][67]=$BR_one_countS;
$graph_stats2[$i][68]=$BR_two_countS;
$graph_stats2[$i][69]=$BR_three_countS;
$graph_stats2[$i][70]=$BR_four_countS;
$graph_stats2[$i][71]=$BR_five_countS;
$graph_stats2[$i][72]=$BR_countS;
$graph_stats2[$i][73]=$MP_one_countS;
$graph_stats2[$i][74]=$MP_two_countS;
$graph_stats2[$i][75]=$MP_three_countS;
$graph_stats2[$i][76]=$MP_four_countS;
$graph_stats2[$i][77]=$MP_five_countS;
$graph_stats2[$i][78]=$MP_countS;
$graph_stats2[$i][79]=$MR_one_countS;
$graph_stats2[$i][80]=$MR_two_countS;
$graph_stats2[$i][81]=$MR_three_countS;
$graph_stats2[$i][82]=$MR_four_countS;
$graph_stats2[$i][83]=$MR_five_countS;
$graph_stats2[$i][84]=$MR_countS;
$i++;
}
// CYCLE THROUGH ARRAY TO SEE IF ANY NEW MAX VARS
for ($q=0; $q<count($graph_stats2); $q++) {
for ($x=1; $x<count($graph_stats2[$q]); $x++) {
$graph_stats2[$q][$x]=trim($graph_stats2[$q][$x]);
if ($graph_stats2[$q][$x]>$max_stats2[$x]) {$max_stats2[$x]=$graph_stats2[$q][$x];}
}
}
$HA_count_totS = sprintf("%7s", $HA_count_tot); while(strlen($HA_count_totS)>7) {$HA_count_totS = substr("$HA_count_totS", 0, -1);}
$HA_one_count_totS = sprintf("%7s", $HA_one_count_tot); while(strlen($HA_one_count_totS)>7) {$HA_one_count_totS = substr("$HA_one_count_totS", 0, -1);}
$HA_two_count_totS = sprintf("%7s", $HA_two_count_tot); while(strlen($HA_two_count_totS)>7) {$HA_two_count_totS = substr("$HA_two_count_totS", 0, -1);}
@@ -1496,12 +1775,12 @@ else
$HR_three_count_Tpc=0;
$HR_four_count_Tpc=0;
$HR_five_count_Tpc=0;
if ( ($HR_count_tot > 0) and ($TOTALleads > 0) ) {$HR_count_Tpc = (($HR_count_tot / $TOTALleads) * 100);}
if ( ($HR_one_count_tot > 0) and ($TOTALleads > 0) ) {$HR_one_count_Tpc = (($HR_one_count_tot / $TOTALleads) * 100);}
if ( ($HR_two_count_tot > 0) and ($TOTALleads > 0) ) {$HR_two_count_Tpc = (($HR_two_count_tot / $TOTALleads) * 100);}
if ( ($HR_three_count_tot > 0) and ($TOTALleads > 0) ) {$HR_three_count_Tpc = (($HR_three_count_tot / $TOTALleads) * 100);}
if ( ($HR_four_count_tot > 0) and ($TOTALleads > 0) ) {$HR_four_count_Tpc = (($HR_four_count_tot / $TOTALleads) * 100);}
if ( ($HR_five_count_tot > 0) and ($TOTALleads > 0) ) {$HR_five_count_Tpc = (($HR_five_count_tot / $TOTALleads) * 100);}
$HR_count_Tpc = (MathZDC($HR_count_tot, $TOTALleads) * 100);
$HR_one_count_Tpc = (MathZDC($HR_one_count_tot, $TOTALleads) * 100);
$HR_two_count_Tpc = (MathZDC($HR_two_count_tot, $TOTALleads) * 100);
$HR_three_count_Tpc = (MathZDC($HR_three_count_tot, $TOTALleads) * 100);
$HR_four_count_Tpc = (MathZDC($HR_four_count_tot, $TOTALleads) * 100);
$HR_five_count_Tpc = (MathZDC($HR_five_count_tot, $TOTALleads) * 100);
$HR_count_totS = sprintf("%6.2f", $HR_count_Tpc); while(strlen($HR_count_totS)>7) {$HR_count_totS = substr("$HR_count_totS", 0, -1);}
$HR_one_count_totS = sprintf("%6.2f", $HR_one_count_Tpc); while(strlen($HR_one_count_totS)>7) {$HR_one_count_totS = substr("$HR_one_count_totS", 0, -1);}
@@ -1516,12 +1795,12 @@ else
$SR_three_count_Tpc=0;
$SR_four_count_Tpc=0;
$SR_five_count_Tpc=0;
if ( ($SR_count_tot > 0) and ($TOTALleads > 0) ) {$SR_count_Tpc = (($SR_count_tot / $TOTALleads) * 100);}
if ( ($SR_one_count_tot > 0) and ($TOTALleads > 0) ) {$SR_one_count_Tpc = (($SR_one_count_tot / $TOTALleads) * 100);}
if ( ($SR_two_count_tot > 0) and ($TOTALleads > 0) ) {$SR_two_count_Tpc = (($SR_two_count_tot / $TOTALleads) * 100);}
if ( ($SR_three_count_tot > 0) and ($TOTALleads > 0) ) {$SR_three_count_Tpc = (($SR_three_count_tot / $TOTALleads) * 100);}
if ( ($SR_four_count_tot > 0) and ($TOTALleads > 0) ) {$SR_four_count_Tpc = (($SR_four_count_tot / $TOTALleads) * 100);}
if ( ($SR_five_count_tot > 0) and ($TOTALleads > 0) ) {$SR_five_count_Tpc = (($SR_five_count_tot / $TOTALleads) * 100);}
$SR_count_Tpc = (MathZDC($SR_count_tot, $TOTALleads) * 100);
$SR_one_count_Tpc = (MathZDC($SR_one_count_tot, $TOTALleads) * 100);
$SR_two_count_Tpc = (MathZDC($SR_two_count_tot, $TOTALleads) * 100);
$SR_three_count_Tpc = (MathZDC($SR_three_count_tot, $TOTALleads) * 100);
$SR_four_count_Tpc = (MathZDC($SR_four_count_tot, $TOTALleads) * 100);
$SR_five_count_Tpc = (MathZDC($SR_five_count_tot, $TOTALleads) * 100);
$SR_count_totS = sprintf("%6.2f", $SR_count_Tpc); while(strlen($SR_count_totS)>7) {$SR_count_totS = substr("$SR_count_totS", 0, -1);}
$SR_one_count_totS = sprintf("%6.2f", $SR_one_count_Tpc); while(strlen($SR_one_count_totS)>7) {$SR_one_count_totS = substr("$SR_one_count_totS", 0, -1);}
@@ -1536,12 +1815,12 @@ else
$DR_three_count_Tpc=0;
$DR_four_count_Tpc=0;
$DR_five_count_Tpc=0;
if ( ($DR_count_tot > 0) and ($TOTALleads > 0) ) {$DR_count_Tpc = (($DR_count_tot / $TOTALleads) * 100);}
if ( ($DR_one_count_tot > 0) and ($TOTALleads > 0) ) {$DR_one_count_Tpc = (($DR_one_count_tot / $TOTALleads) * 100);}
if ( ($DR_two_count_tot > 0) and ($TOTALleads > 0) ) {$DR_two_count_Tpc = (($DR_two_count_tot / $TOTALleads) * 100);}
if ( ($DR_three_count_tot > 0) and ($TOTALleads > 0) ) {$DR_three_count_Tpc = (($DR_three_count_tot / $TOTALleads) * 100);}
if ( ($DR_four_count_tot > 0) and ($TOTALleads > 0) ) {$DR_four_count_Tpc = (($DR_four_count_tot / $TOTALleads) * 100);}
if ( ($DR_five_count_tot > 0) and ($TOTALleads > 0) ) {$DR_five_count_Tpc = (($DR_five_count_tot / $TOTALleads) * 100);}
$DR_count_Tpc = (MathZDC($DR_count_tot, $TOTALleads) * 100);
$DR_one_count_Tpc = (MathZDC($DR_one_count_tot, $TOTALleads) * 100);
$DR_two_count_Tpc = (MathZDC($DR_two_count_tot, $TOTALleads) * 100);
$DR_three_count_Tpc = (MathZDC($DR_three_count_tot, $TOTALleads) * 100);
$DR_four_count_Tpc = (MathZDC($DR_four_count_tot, $TOTALleads) * 100);
$DR_five_count_Tpc = (MathZDC($DR_five_count_tot, $TOTALleads) * 100);
$DR_count_totS = sprintf("%6.2f", $DR_count_Tpc); while(strlen($DR_count_totS)>7) {$DR_count_totS = substr("$DR_count_totS", 0, -1);}
$DR_one_count_totS = sprintf("%6.2f", $DR_one_count_Tpc); while(strlen($DR_one_count_totS)>7) {$DR_one_count_totS = substr("$DR_one_count_totS", 0, -1);}
@@ -1556,12 +1835,12 @@ else
$CR_three_count_Tpc=0;
$CR_four_count_Tpc=0;
$CR_five_count_Tpc=0;
if ( ($CR_count_tot > 0) and ($TOTALleads > 0) ) {$CR_count_Tpc = (($CR_count_tot / $TOTALleads) * 100);}
if ( ($CR_one_count_tot > 0) and ($TOTALleads > 0) ) {$CR_one_count_Tpc = (($CR_one_count_tot / $TOTALleads) * 100);}
if ( ($CR_two_count_tot > 0) and ($TOTALleads > 0) ) {$CR_two_count_Tpc = (($CR_two_count_tot / $TOTALleads) * 100);}
if ( ($CR_three_count_tot > 0) and ($TOTALleads > 0) ) {$CR_three_count_Tpc = (($CR_three_count_tot / $TOTALleads) * 100);}
if ( ($CR_four_count_tot > 0) and ($TOTALleads > 0) ) {$CR_four_count_Tpc = (($CR_four_count_tot / $TOTALleads) * 100);}
if ( ($CR_five_count_tot > 0) and ($TOTALleads > 0) ) {$CR_five_count_Tpc = (($CR_five_count_tot / $TOTALleads) * 100);}
$CR_count_Tpc = (MathZDC($CR_count_tot, $TOTALleads) * 100);
$CR_one_count_Tpc = (MathZDC($CR_one_count_tot, $TOTALleads) * 100);
$CR_two_count_Tpc = (MathZDC($CR_two_count_tot, $TOTALleads) * 100);
$CR_three_count_Tpc = (MathZDC($CR_three_count_tot, $TOTALleads) * 100);
$CR_four_count_Tpc = (MathZDC($CR_four_count_tot, $TOTALleads) * 100);
$CR_five_count_Tpc = (MathZDC($CR_five_count_tot, $TOTALleads) * 100);
$CR_count_totS = sprintf("%6.2f", $CR_count_Tpc); while(strlen($CR_count_totS)>7) {$CR_count_totS = substr("$CR_count_totS", 0, -1);}
$CR_one_count_totS = sprintf("%6.2f", $CR_one_count_Tpc); while(strlen($CR_one_count_totS)>7) {$CR_one_count_totS = substr("$CR_one_count_totS", 0, -1);}
@@ -1576,12 +1855,12 @@ else
$UR_three_count_Tpc=0;
$UR_four_count_Tpc=0;
$UR_five_count_Tpc=0;
if ( ($UR_count_tot > 0) and ($TOTALleads > 0) ) {$UR_count_Tpc = (($UR_count_tot / $TOTALleads) * 100);}
if ( ($UR_one_count_tot > 0) and ($TOTALleads > 0) ) {$UR_one_count_Tpc = (($UR_one_count_tot / $TOTALleads) * 100);}
if ( ($UR_two_count_tot > 0) and ($TOTALleads > 0) ) {$UR_two_count_Tpc = (($UR_two_count_tot / $TOTALleads) * 100);}
if ( ($UR_three_count_tot > 0) and ($TOTALleads > 0) ) {$UR_three_count_Tpc = (($UR_three_count_tot / $TOTALleads) * 100);}
if ( ($UR_four_count_tot > 0) and ($TOTALleads > 0) ) {$UR_four_count_Tpc = (($UR_four_count_tot / $TOTALleads) * 100);}
if ( ($UR_five_count_tot > 0) and ($TOTALleads > 0) ) {$UR_five_count_Tpc = (($UR_five_count_tot / $TOTALleads) * 100);}
$UR_count_Tpc = (MathZDC($UR_count_tot, $TOTALleads) * 100);
$UR_one_count_Tpc = (MathZDC($UR_one_count_tot, $TOTALleads) * 100);
$UR_two_count_Tpc = (MathZDC($UR_two_count_tot, $TOTALleads) * 100);
$UR_three_count_Tpc = (MathZDC($UR_three_count_tot, $TOTALleads) * 100);
$UR_four_count_Tpc = (MathZDC($UR_four_count_tot, $TOTALleads) * 100);
$UR_five_count_Tpc = (MathZDC($UR_five_count_tot, $TOTALleads) * 100);
$UR_count_totS = sprintf("%6.2f", $UR_count_Tpc); while(strlen($UR_count_totS)>7) {$UR_count_totS = substr("$UR_count_totS", 0, -1);}
$UR_one_count_totS = sprintf("%6.2f", $UR_one_count_Tpc); while(strlen($UR_one_count_totS)>7) {$UR_one_count_totS = substr("$UR_one_count_totS", 0, -1);}
@@ -1596,12 +1875,12 @@ else
$BR_three_count_Tpc=0;
$BR_four_count_Tpc=0;
$BR_five_count_Tpc=0;
if ( ($BR_count_tot > 0) and ($TOTALleads > 0) ) {$BR_count_Tpc = (($BR_count_tot / $TOTALleads) * 100);}
if ( ($BR_one_count_tot > 0) and ($TOTALleads > 0) ) {$BR_one_count_Tpc = (($BR_one_count_tot / $TOTALleads) * 100);}
if ( ($BR_two_count_tot > 0) and ($TOTALleads > 0) ) {$BR_two_count_Tpc = (($BR_two_count_tot / $TOTALleads) * 100);}
if ( ($BR_three_count_tot > 0) and ($TOTALleads > 0) ) {$BR_three_count_Tpc = (($BR_three_count_tot / $TOTALleads) * 100);}
if ( ($BR_four_count_tot > 0) and ($TOTALleads > 0) ) {$BR_four_count_Tpc = (($BR_four_count_tot / $TOTALleads) * 100);}
if ( ($BR_five_count_tot > 0) and ($TOTALleads > 0) ) {$BR_five_count_Tpc = (($BR_five_count_tot / $TOTALleads) * 100);}
$BR_count_Tpc = (MathZDC($BR_count_tot, $TOTALleads) * 100);
$BR_one_count_Tpc = (MathZDC($BR_one_count_tot, $TOTALleads) * 100);
$BR_two_count_Tpc = (MathZDC($BR_two_count_tot, $TOTALleads) * 100);
$BR_three_count_Tpc = (MathZDC($BR_three_count_tot, $TOTALleads) * 100);
$BR_four_count_Tpc = (MathZDC($BR_four_count_tot, $TOTALleads) * 100);
$BR_five_count_Tpc = (MathZDC($BR_five_count_tot, $TOTALleads) * 100);
$BR_count_totS = sprintf("%6.2f", $BR_count_Tpc); while(strlen($BR_count_totS)>7) {$BR_count_totS = substr("$BR_count_totS", 0, -1);}
$BR_one_count_totS = sprintf("%6.2f", $BR_one_count_Tpc); while(strlen($BR_one_count_totS)>7) {$BR_one_count_totS = substr("$BR_one_count_totS", 0, -1);}
@@ -1616,12 +1895,12 @@ else
$MR_three_count_Tpc=0;
$MR_four_count_Tpc=0;
$MR_five_count_Tpc=0;
if ( ($MR_count_tot > 0) and ($TOTALleads > 0) ) {$MR_count_Tpc = (($MR_count_tot / $TOTALleads) * 100);}
if ( ($MR_one_count_tot > 0) and ($TOTALleads > 0) ) {$MR_one_count_Tpc = (($MR_one_count_tot / $TOTALleads) * 100);}
if ( ($MR_two_count_tot > 0) and ($TOTALleads > 0) ) {$MR_two_count_Tpc = (($MR_two_count_tot / $TOTALleads) * 100);}
if ( ($MR_three_count_tot > 0) and ($TOTALleads > 0) ) {$MR_three_count_Tpc = (($MR_three_count_tot / $TOTALleads) * 100);}
if ( ($MR_four_count_tot > 0) and ($TOTALleads > 0) ) {$MR_four_count_Tpc = (($MR_four_count_tot / $TOTALleads) * 100);}
if ( ($MR_five_count_tot > 0) and ($TOTALleads > 0) ) {$MR_five_count_Tpc = (($MR_five_count_tot / $TOTALleads) * 100);}
$MR_count_Tpc = (MathZDC($MR_count_tot, $TOTALleads) * 100);
$MR_one_count_Tpc = (MathZDC($MR_one_count_tot, $TOTALleads) * 100);
$MR_two_count_Tpc = (MathZDC($MR_two_count_tot, $TOTALleads) * 100);
$MR_three_count_Tpc = (MathZDC($MR_three_count_tot, $TOTALleads) * 100);
$MR_four_count_Tpc = (MathZDC($MR_four_count_tot, $TOTALleads) * 100);
$MR_five_count_Tpc = (MathZDC($MR_five_count_tot, $TOTALleads) * 100);
$MR_count_totS = sprintf("%6.2f", $MR_count_Tpc); while(strlen($MR_count_totS)>7) {$MR_count_totS = substr("$MR_count_totS", 0, -1);}
$MR_one_count_totS = sprintf("%6.2f", $MR_one_count_Tpc); while(strlen($MR_one_count_totS)>7) {$MR_one_count_totS = substr("$MR_one_count_totS", 0, -1);}
@@ -1701,11 +1980,384 @@ else
$CSV_text1.=",\"$MR_one_count_totS%\",\"$MR_two_count_totS%\",\"$MR_three_count_totS%\",\"$MR_four_count_totS%\",\"$MR_five_count_totS%\",\"$MR_count_totS%\"";
$CSV_text1.="\n";
$totals2[1]=$HA_one_count_totS;
$totals2[2]=$HA_two_count_totS;
$totals2[3]=$HA_three_count_totS;
$totals2[4]=$HA_four_count_totS;
$totals2[5]=$HA_five_count_totS;
$totals2[6]=$HA_count_totS;
$totals2[7]=$HR_one_count_totS;
$totals2[8]=$HR_two_count_totS;
$totals2[9]=$HR_three_count_totS;
$totals2[10]=$HR_four_count_totS;
$totals2[11]=$HR_five_count_totS;
$totals2[12]=$HR_count_totS;
$totals2[13]=$SA_one_count_totS;
$totals2[14]=$SA_two_count_totS;
$totals2[15]=$SA_three_count_totS;
$totals2[16]=$SA_four_count_totS;
$totals2[17]=$SA_five_count_totS;
$totals2[18]=$SA_count_totS;
$totals2[19]=$SR_one_count_totS;
$totals2[20]=$SR_two_count_totS;
$totals2[21]=$SR_three_count_totS;
$totals2[22]=$SR_four_count_totS;
$totals2[23]=$SR_five_count_totS;
$totals2[24]=$SR_count_totS;
$totals2[25]=$DN_one_count_totS;
$totals2[26]=$DN_two_count_totS;
$totals2[27]=$DN_three_count_totS;
$totals2[28]=$DN_four_count_totS;
$totals2[29]=$DN_five_count_totS;
$totals2[30]=$DN_count_totS;
$totals2[31]=$DR_one_count_totS;
$totals2[32]=$DR_two_count_totS;
$totals2[33]=$DR_three_count_totS;
$totals2[34]=$DR_four_count_totS;
$totals2[35]=$DR_five_count_totS;
$totals2[36]=$DR_count_totS;
$totals2[37]=$CC_one_count_totS;
$totals2[38]=$CC_two_count_totS;
$totals2[39]=$CC_three_count_totS;
$totals2[40]=$CC_four_count_totS;
$totals2[41]=$CC_five_count_totS;
$totals2[42]=$CC_count_totS;
$totals2[43]=$CR_one_count_totS;
$totals2[44]=$CR_two_count_totS;
$totals2[45]=$CR_three_count_totS;
$totals2[46]=$CR_four_count_totS;
$totals2[47]=$CR_five_count_totS;
$totals2[48]=$CR_count_totS;
$totals2[49]=$UW_one_count_totS;
$totals2[50]=$UW_two_count_totS;
$totals2[51]=$UW_three_count_totS;
$totals2[52]=$UW_four_count_totS;
$totals2[53]=$UW_five_count_totS;
$totals2[54]=$UW_count_totS;
$totals2[55]=$UR_one_count_totS;
$totals2[56]=$UR_two_count_totS;
$totals2[57]=$UR_three_count_totS;
$totals2[58]=$UR_four_count_totS;
$totals2[59]=$UR_five_count_totS;
$totals2[60]=$UR_count_totS;
$totals2[61]=$BA_one_count_totS;
$totals2[62]=$BA_two_count_totS;
$totals2[63]=$BA_three_count_totS;
$totals2[64]=$BA_four_count_totS;
$totals2[65]=$BA_five_count_totS;
$totals2[66]=$BA_count_totS;
$totals2[67]=$BR_one_count_totS;
$totals2[68]=$BR_two_count_totS;
$totals2[69]=$BR_three_count_totS;
$totals2[70]=$BR_four_count_totS;
$totals2[71]=$BR_five_count_totS;
$totals2[72]=$BR_count_totS;
$totals2[73]=$MP_one_count_totS;
$totals2[74]=$MP_two_count_totS;
$totals2[75]=$MP_three_count_totS;
$totals2[76]=$MP_four_count_totS;
$totals2[77]=$MP_five_count_totS;
$totals2[78]=$MP_count_totS;
$totals2[79]=$MR_one_count_totS;
$totals2[80]=$MR_two_count_totS;
$totals2[81]=$MR_three_count_totS;
$totals2[82]=$MR_four_count_totS;
$totals2[83]=$MR_five_count_totS;
$totals2[84]=$MR_count_totS;
for ($d=0; $d<count($graph_stats2); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats2)) {$class=" last";} else {$class="";}
$CONTACTS1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='MathZDC(800*".$graph_stats2[$d][1].", $max_stats2[$d])' width='".round(MathZDC(800*$graph_stats2[$d][1], $max_stats2[1]))."' height='16' />".$graph_stats2[$d][1]."</td></tr>";
$CONTACTS2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][2], $max_stats2[2]))."' height='16' />".$graph_stats2[$d][2]."</td></tr>";
$CONTACTS3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][3], $max_stats2[3]))."' height='16' />".$graph_stats2[$d][3]."</td></tr>";
$CONTACTS4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][4], $max_stats2[4]))."' height='16' />".$graph_stats2[$d][4]."</td></tr>";
$CONTACTS5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][5], $max_stats2[5]))."' height='16' />".$graph_stats2[$d][5]."</td></tr>";
$CONTACTSALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][6], $max_stats2[6]))."' height='16' />".$graph_stats2[$d][6]."</td></tr>";
$CNTRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][7], $max_stats2[7]))."' height='16' />".$graph_stats2[$d][7]."</td></tr>";
$CNTRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][8], $max_stats2[8]))."' height='16' />".$graph_stats2[$d][8]."</td></tr>";
$CNTRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][9], $max_stats2[9]))."' height='16' />".$graph_stats2[$d][9]."</td></tr>";
$CNTRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][10], $max_stats2[10]))."' height='16' />".$graph_stats2[$d][10]."</td></tr>";
$CNTRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][11], $max_stats2[11]))."' height='16' />".$graph_stats2[$d][11]."</td></tr>";
$CNTRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][12], $max_stats2[12]))."' height='16' />".$graph_stats2[$d][12]."</td></tr>";
$SALES1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][13], $max_stats2[13]))."' height='16' />".$graph_stats2[$d][13]."</td></tr>";
$SALES2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][14], $max_stats2[14]))."' height='16' />".$graph_stats2[$d][14]."</td></tr>";
$SALES3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][15], $max_stats2[15]))."' height='16' />".$graph_stats2[$d][15]."</td></tr>";
$SALES4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][16], $max_stats2[16]))."' height='16' />".$graph_stats2[$d][16]."</td></tr>";
$SALES5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][17], $max_stats2[17]))."' height='16' />".$graph_stats2[$d][17]."</td></tr>";
$SALESALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][18], $max_stats2[18]))."' height='16' />".$graph_stats2[$d][18]."</td></tr>";
$CONVRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][19], $max_stats2[19]))."' height='16' />".$graph_stats2[$d][19]."</td></tr>";
$CONVRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][20], $max_stats2[20]))."' height='16' />".$graph_stats2[$d][20]."</td></tr>";
$CONVRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][21], $max_stats2[21]))."' height='16' />".$graph_stats2[$d][21]."</td></tr>";
$CONVRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][22], $max_stats2[22]))."' height='16' />".$graph_stats2[$d][22]."</td></tr>";
$CONVRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][23], $max_stats2[23]))."' height='16' />".$graph_stats2[$d][23]."</td></tr>";
$CONVRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][24], $max_stats2[24]))."' height='16' />".$graph_stats2[$d][24]."</td></tr>";
$DNC1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][25], $max_stats2[25]))."' height='16' />".$graph_stats2[$d][25]."</td></tr>";
$DNC2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][26], $max_stats2[26]))."' height='16' />".$graph_stats2[$d][26]."</td></tr>";
$DNC3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][27], $max_stats2[27]))."' height='16' />".$graph_stats2[$d][27]."</td></tr>";
$DNC4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][28], $max_stats2[28]))."' height='16' />".$graph_stats2[$d][28]."</td></tr>";
$DNC5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][29], $max_stats2[29]))."' height='16' />".$graph_stats2[$d][29]."</td></tr>";
$DNCALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][30], $max_stats2[30]))."' height='16' />".$graph_stats2[$d][30]."</td></tr>";
$DNCRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][31], $max_stats2[31]))."' height='16' />".$graph_stats2[$d][31]."</td></tr>";
$DNCRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][32], $max_stats2[32]))."' height='16' />".$graph_stats2[$d][32]."</td></tr>";
$DNCRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][33], $max_stats2[33]))."' height='16' />".$graph_stats2[$d][33]."</td></tr>";
$DNCRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][34], $max_stats2[34]))."' height='16' />".$graph_stats2[$d][34]."</td></tr>";
$DNCRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][35], $max_stats2[35]))."' height='16' />".$graph_stats2[$d][35]."</td></tr>";
$DNCRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][36], $max_stats2[36]))."' height='16' />".$graph_stats2[$d][36]."</td></tr>";
$CUSTCNT1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][37], $max_stats2[37]))."' height='16' />".$graph_stats2[$d][37]."</td></tr>";
$CUSTCNT2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][38], $max_stats2[38]))."' height='16' />".$graph_stats2[$d][38]."</td></tr>";
$CUSTCNT3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][39], $max_stats2[39]))."' height='16' />".$graph_stats2[$d][39]."</td></tr>";
$CUSTCNT4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][40], $max_stats2[40]))."' height='16' />".$graph_stats2[$d][40]."</td></tr>";
$CUSTCNT5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][41], $max_stats2[41]))."' height='16' />".$graph_stats2[$d][41]."</td></tr>";
$CUSTCNTALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][42], $max_stats2[42]))."' height='16' />".$graph_stats2[$d][42]."</td></tr>";
$CUSTCNTRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][43], $max_stats2[43]))."' height='16' />".$graph_stats2[$d][43]."</td></tr>";
$CUSTCNTRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][44], $max_stats2[44]))."' height='16' />".$graph_stats2[$d][44]."</td></tr>";
$CUSTCNTRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][45], $max_stats2[45]))."' height='16' />".$graph_stats2[$d][45]."</td></tr>";
$CUSTCNTRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][46], $max_stats2[46]))."' height='16' />".$graph_stats2[$d][46]."</td></tr>";
$CUSTCNTRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][47], $max_stats2[47]))."' height='16' />".$graph_stats2[$d][47]."</td></tr>";
$CUSTCNTRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][48], $max_stats2[48]))."' height='16' />".$graph_stats2[$d][48]."</td></tr>";
$UNWRK1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][49], $max_stats2[49]))."' height='16' />".$graph_stats2[$d][49]."</td></tr>";
$UNWRK2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][50], $max_stats2[50]))."' height='16' />".$graph_stats2[$d][50]."</td></tr>";
$UNWRK3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][51], $max_stats2[51]))."' height='16' />".$graph_stats2[$d][51]."</td></tr>";
$UNWRK4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][52], $max_stats2[52]))."' height='16' />".$graph_stats2[$d][52]."</td></tr>";
$UNWRK5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][53], $max_stats2[53]))."' height='16' />".$graph_stats2[$d][53]."</td></tr>";
$UNWRKALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][54], $max_stats2[54]))."' height='16' />".$graph_stats2[$d][54]."</td></tr>";
$UNWRKRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][55], $max_stats2[55]))."' height='16' />".$graph_stats2[$d][55]."</td></tr>";
$UNWRKRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][56], $max_stats2[56]))."' height='16' />".$graph_stats2[$d][56]."</td></tr>";
$UNWRKRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][57], $max_stats2[57]))."' height='16' />".$graph_stats2[$d][57]."</td></tr>";
$UNWRKRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][58], $max_stats2[58]))."' height='16' />".$graph_stats2[$d][58]."</td></tr>";
$UNWRKRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][59], $max_stats2[59]))."' height='16' />".$graph_stats2[$d][59]."</td></tr>";
$UNWRKRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][60], $max_stats2[60]))."' height='16' />".$graph_stats2[$d][60]."</td></tr>";
$SCHDCLBK1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][61], $max_stats2[61]))."' height='16' />".$graph_stats2[$d][61]."</td></tr>";
$SCHDCLBK2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][62], $max_stats2[62]))."' height='16' />".$graph_stats2[$d][62]."</td></tr>";
$SCHDCLBK3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][63], $max_stats2[63]))."' height='16' />".$graph_stats2[$d][63]."</td></tr>";
$SCHDCLBK4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][64], $max_stats2[64]))."' height='16' />".$graph_stats2[$d][64]."</td></tr>";
$SCHDCLBK5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][65], $max_stats2[65]))."' height='16' />".$graph_stats2[$d][65]."</td></tr>";
$SCHDCLBKALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][66], $max_stats2[66]))."' height='16' />".$graph_stats2[$d][66]."</td></tr>";
$SCHDCLBKRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][67], $max_stats2[67]))."' height='16' />".$graph_stats2[$d][67]."</td></tr>";
$SCHDCLBKRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][68], $max_stats2[68]))."' height='16' />".$graph_stats2[$d][68]."</td></tr>";
$SCHDCLBKRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][69], $max_stats2[69]))."' height='16' />".$graph_stats2[$d][69]."</td></tr>";
$SCHDCLBKRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][70], $max_stats2[70]))."' height='16' />".$graph_stats2[$d][70]."</td></tr>";
$SCHDCLBKRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][71], $max_stats2[71]))."' height='16' />".$graph_stats2[$d][71]."</td></tr>";
$SCHDCLBKRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][72], $max_stats2[72]))."' height='16' />".$graph_stats2[$d][72]."</td></tr>";
$COMPLTD1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][73], $max_stats2[73]))."' height='16' />".$graph_stats2[$d][73]."</td></tr>";
$COMPLTD2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][74], $max_stats2[74]))."' height='16' />".$graph_stats2[$d][74]."</td></tr>";
$COMPLTD3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][75], $max_stats2[75]))."' height='16' />".$graph_stats2[$d][75]."</td></tr>";
$COMPLTD4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][76], $max_stats2[76]))."' height='16' />".$graph_stats2[$d][76]."</td></tr>";
$COMPLTD5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][77], $max_stats2[77]))."' height='16' />".$graph_stats2[$d][77]."</td></tr>";
$COMPLTDALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][78], $max_stats2[78]))."' height='16' />".$graph_stats2[$d][78]."</td></tr>";
$COMPLTDRATE1_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][79], $max_stats2[79]))."' height='16' />".$graph_stats2[$d][79]."</td></tr>";
$COMPLTDRATE2_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][80], $max_stats2[80]))."' height='16' />".$graph_stats2[$d][80]."</td></tr>";
$COMPLTDRATE3_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][81], $max_stats2[81]))."' height='16' />".$graph_stats2[$d][81]."</td></tr>";
$COMPLTDRATE4_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][82], $max_stats2[82]))."' height='16' />".$graph_stats2[$d][82]."</td></tr>";
$COMPLTDRATE5_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][83], $max_stats2[83]))."' height='16' />".$graph_stats2[$d][83]."</td></tr>";
$COMPLTDRATEALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats2[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(800*$graph_stats2[$d][84], $max_stats2[84]))."' height='16' />".$graph_stats2[$d][84]."</td></tr>";
}
$CONTACTS1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[1]."</th></tr>";
$CONTACTS2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[2]."</th></tr>";
$CONTACTS3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[3]."</th></tr>";
$CONTACTS4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[4]."</th></tr>";
$CONTACTS5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[5]."</th></tr>";
$CONTACTSALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[6]."</th></tr>";
$CNTRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[7]."</th></tr>";
$CNTRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[8]."</th></tr>";
$CNTRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[9]."</th></tr>";
$CNTRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[10]."</th></tr>";
$CNTRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[11]."</th></tr>";
$CNTRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[12]."</th></tr>";
$SALES1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[13]."</th></tr>";
$SALES2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[14]."</th></tr>";
$SALES3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[15]."</th></tr>";
$SALES4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[16]."</th></tr>";
$SALES5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[17]."</th></tr>";
$SALESALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[18]."</th></tr>";
$CONVRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[19]."</th></tr>";
$CONVRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[20]."</th></tr>";
$CONVRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[21]."</th></tr>";
$CONVRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[22]."</th></tr>";
$CONVRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[23]."</th></tr>";
$CONVRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[24]."</th></tr>";
$DNC1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[25]."</th></tr>";
$DNC2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[26]."</th></tr>";
$DNC3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[27]."</th></tr>";
$DNC4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[28]."</th></tr>";
$DNC5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[29]."</th></tr>";
$DNCALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[30]."</th></tr>";
$DNCRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[31]."</th></tr>";
$DNCRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[32]."</th></tr>";
$DNCRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[33]."</th></tr>";
$DNCRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[34]."</th></tr>";
$DNCRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[35]."</th></tr>";
$DNCRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[36]."</th></tr>";
$CUSTCNT1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[37]."</th></tr>";
$CUSTCNT2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[38]."</th></tr>";
$CUSTCNT3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[39]."</th></tr>";
$CUSTCNT4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[40]."</th></tr>";
$CUSTCNT5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[41]."</th></tr>";
$CUSTCNTALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[42]."</th></tr>";
$CUSTCNTRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[43]."</th></tr>";
$CUSTCNTRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[44]."</th></tr>";
$CUSTCNTRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[45]."</th></tr>";
$CUSTCNTRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[46]."</th></tr>";
$CUSTCNTRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[47]."</th></tr>";
$CUSTCNTRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[48]."</th></tr>";
$UNWRK1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[49]."</th></tr>";
$UNWRK2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[50]."</th></tr>";
$UNWRK3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[51]."</th></tr>";
$UNWRK4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[52]."</th></tr>";
$UNWRK5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[53]."</th></tr>";
$UNWRKALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[54]."</th></tr>";
$UNWRKRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[55]."</th></tr>";
$UNWRKRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[56]."</th></tr>";
$UNWRKRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[57]."</th></tr>";
$UNWRKRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[58]."</th></tr>";
$UNWRKRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[59]."</th></tr>";
$UNWRKRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[60]."</th></tr>";
$SCHDCLBK1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[61]."</th></tr>";
$SCHDCLBK2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[62]."</th></tr>";
$SCHDCLBK3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[63]."</th></tr>";
$SCHDCLBK4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[64]."</th></tr>";
$SCHDCLBK5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[65]."</th></tr>";
$SCHDCLBKALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[66]."</th></tr>";
$SCHDCLBKRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[67]."</th></tr>";
$SCHDCLBKRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[68]."</th></tr>";
$SCHDCLBKRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[69]."</th></tr>";
$SCHDCLBKRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[70]."</th></tr>";
$SCHDCLBKRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[71]."</th></tr>";
$SCHDCLBKRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[72]."</th></tr>";
$COMPLTD1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[73]."</th></tr>";
$COMPLTD2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[74]."</th></tr>";
$COMPLTD3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[75]."</th></tr>";
$COMPLTD4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[76]."</th></tr>";
$COMPLTD5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[77]."</th></tr>";
$COMPLTDALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[78]."</th></tr>";
$COMPLTDRATE1_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[79]."</th></tr>";
$COMPLTDRATE2_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[80]."</th></tr>";
$COMPLTDRATE3_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[81]."</th></tr>";
$COMPLTDRATE4_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[82]."</th></tr>";
$COMPLTDRATE5_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[83]."</th></tr>";
$COMPLTDRATEALL_graph.=" <tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".$totals2[84]."</th></tr>";
$JS_onload.="\tDrawGraph('CONTACTS1', '1');\n";
$JS_text.="function DrawGraph(graph, th_id) {\n";
$JS_text.=" var graph_CONTACTS1=\"$CONTACTS1_graph\";\n";
$JS_text.=" var graph_CONTACTS2=\"$CONTACTS2_graph\";\n";
$JS_text.=" var graph_CONTACTS3=\"$CONTACTS3_graph\";\n";
$JS_text.=" var graph_CONTACTS4=\"$CONTACTS4_graph\";\n";
$JS_text.=" var graph_CONTACTS5=\"$CONTACTS5_graph\";\n";
$JS_text.=" var graph_CONTACTSALL=\"$CONTACTSALL_graph\";\n";
$JS_text.=" var graph_CNTRATE1=\"$CNTRATE1_graph\";\n";
$JS_text.=" var graph_CNTRATE2=\"$CNTRATE2_graph\";\n";
$JS_text.=" var graph_CNTRATE3=\"$CNTRATE3_graph\";\n";
$JS_text.=" var graph_CNTRATE4=\"$CNTRATE4_graph\";\n";
$JS_text.=" var graph_CNTRATE5=\"$CNTRATE5_graph\";\n";
$JS_text.=" var graph_CNTRATEALL=\"$CNTRATEALL_graph\";\n";
$JS_text.=" var graph_SALES1=\"$SALES1_graph\";\n";
$JS_text.=" var graph_SALES2=\"$SALES2_graph\";\n";
$JS_text.=" var graph_SALES3=\"$SALES3_graph\";\n";
$JS_text.=" var graph_SALES4=\"$SALES4_graph\";\n";
$JS_text.=" var graph_SALES5=\"$SALES5_graph\";\n";
$JS_text.=" var graph_SALESALL=\"$SALESALL_graph\";\n";
$JS_text.=" var graph_CONVRATE1=\"$CONVRATE1_graph\";\n";
$JS_text.=" var graph_CONVRATE2=\"$CONVRATE2_graph\";\n";
$JS_text.=" var graph_CONVRATE3=\"$CONVRATE3_graph\";\n";
$JS_text.=" var graph_CONVRATE4=\"$CONVRATE4_graph\";\n";
$JS_text.=" var graph_CONVRATE5=\"$CONVRATE5_graph\";\n";
$JS_text.=" var graph_CONVRATEALL=\"$CONVRATEALL_graph\";\n";
$JS_text.=" var graph_DNC1=\"$DNC1_graph\";\n";
$JS_text.=" var graph_DNC2=\"$DNC2_graph\";\n";
$JS_text.=" var graph_DNC3=\"$DNC3_graph\";\n";
$JS_text.=" var graph_DNC4=\"$DNC4_graph\";\n";
$JS_text.=" var graph_DNC5=\"$DNC5_graph\";\n";
$JS_text.=" var graph_DNCALL=\"$DNCALL_graph\";\n";
$JS_text.=" var graph_DNCRATE1=\"$DNCRATE1_graph\";\n";
$JS_text.=" var graph_DNCRATE2=\"$DNCRATE2_graph\";\n";
$JS_text.=" var graph_DNCRATE3=\"$DNCRATE3_graph\";\n";
$JS_text.=" var graph_DNCRATE4=\"$DNCRATE4_graph\";\n";
$JS_text.=" var graph_DNCRATE5=\"$DNCRATE5_graph\";\n";
$JS_text.=" var graph_DNCRATEALL=\"$DNCRATEALL_graph\";\n";
$JS_text.=" var graph_CUSTCNT1=\"$CUSTCNT1_graph\";\n";
$JS_text.=" var graph_CUSTCNT2=\"$CUSTCNT2_graph\";\n";
$JS_text.=" var graph_CUSTCNT3=\"$CUSTCNT3_graph\";\n";
$JS_text.=" var graph_CUSTCNT4=\"$CUSTCNT4_graph\";\n";
$JS_text.=" var graph_CUSTCNT5=\"$CUSTCNT5_graph\";\n";
$JS_text.=" var graph_CUSTCNTALL=\"$CUSTCNTALL_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATE1=\"$CUSTCNTRATE1_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATE2=\"$CUSTCNTRATE2_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATE3=\"$CUSTCNTRATE3_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATE4=\"$CUSTCNTRATE4_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATE5=\"$CUSTCNTRATE5_graph\";\n";
$JS_text.=" var graph_CUSTCNTRATEALL=\"$CUSTCNTRATEALL_graph\";\n";
$JS_text.=" var graph_UNWRK1=\"$UNWRK1_graph\";\n";
$JS_text.=" var graph_UNWRK2=\"$UNWRK2_graph\";\n";
$JS_text.=" var graph_UNWRK3=\"$UNWRK3_graph\";\n";
$JS_text.=" var graph_UNWRK4=\"$UNWRK4_graph\";\n";
$JS_text.=" var graph_UNWRK5=\"$UNWRK5_graph\";\n";
$JS_text.=" var graph_UNWRKALL=\"$UNWRKALL_graph\";\n";
$JS_text.=" var graph_UNWRKRATE1=\"$UNWRKRATE1_graph\";\n";
$JS_text.=" var graph_UNWRKRATE2=\"$UNWRKRATE2_graph\";\n";
$JS_text.=" var graph_UNWRKRATE3=\"$UNWRKRATE3_graph\";\n";
$JS_text.=" var graph_UNWRKRATE4=\"$UNWRKRATE4_graph\";\n";
$JS_text.=" var graph_UNWRKRATE5=\"$UNWRKRATE5_graph\";\n";
$JS_text.=" var graph_UNWRKRATEALL=\"$UNWRKRATEALL_graph\";\n";
$JS_text.=" var graph_SCHDCLBK1=\"$SCHDCLBK1_graph\";\n";
$JS_text.=" var graph_SCHDCLBK2=\"$SCHDCLBK2_graph\";\n";
$JS_text.=" var graph_SCHDCLBK3=\"$SCHDCLBK3_graph\";\n";
$JS_text.=" var graph_SCHDCLBK4=\"$SCHDCLBK4_graph\";\n";
$JS_text.=" var graph_SCHDCLBK5=\"$SCHDCLBK5_graph\";\n";
$JS_text.=" var graph_SCHDCLBKALL=\"$SCHDCLBKALL_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATE1=\"$SCHDCLBKRATE1_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATE2=\"$SCHDCLBKRATE2_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATE3=\"$SCHDCLBKRATE3_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATE4=\"$SCHDCLBKRATE4_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATE5=\"$SCHDCLBKRATE5_graph\";\n";
$JS_text.=" var graph_SCHDCLBKRATEALL=\"$SCHDCLBKRATEALL_graph\";\n";
$JS_text.=" var graph_COMPLTD1=\"$COMPLTD1_graph\";\n";
$JS_text.=" var graph_COMPLTD2=\"$COMPLTD2_graph\";\n";
$JS_text.=" var graph_COMPLTD3=\"$COMPLTD3_graph\";\n";
$JS_text.=" var graph_COMPLTD4=\"$COMPLTD4_graph\";\n";
$JS_text.=" var graph_COMPLTD5=\"$COMPLTD5_graph\";\n";
$JS_text.=" var graph_COMPLTDALL=\"$COMPLTDALL_graph\";\n";
$JS_text.=" var graph_COMPLTDRATE1=\"$COMPLTDRATE1_graph\";\n";
$JS_text.=" var graph_COMPLTDRATE2=\"$COMPLTDRATE2_graph\";\n";
$JS_text.=" var graph_COMPLTDRATE3=\"$COMPLTDRATE3_graph\";\n";
$JS_text.=" var graph_COMPLTDRATE4=\"$COMPLTDRATE4_graph\";\n";
$JS_text.=" var graph_COMPLTDRATE5=\"$COMPLTDRATE5_graph\";\n";
$JS_text.=" var graph_COMPLTDRATEALL=\"$COMPLTDRATEALL_graph\";\n";
$JS_text.=" for (var i=1; i<=84; i++) {\n";
$JS_text.=" var cellID=\"callstatsgraph\"+i;\n";
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
$JS_text.=" }\n";
$JS_text.=" var cellID=\"callstatsgraph\"+th_id;\n";
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
$JS_text.="\n";
$JS_text.=" var graph_to_display=eval(\"graph_\"+graph);\n";
$JS_text.=" document.getElementById('call_stats_graph').innerHTML=graph_to_display;\n";
$JS_text.="}\n";
$GRAPH3="<tr><td colspan='84' class='graph_span_cell'><span id='call_stats_graph'><BR>&nbsp;<BR></span></td></tr></table><BR><BR>";
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTALleads)."</th>\n";
$GRAPH.=" </tr>\n";
$GRAPH.="</table><PRE>\n";
$GRAPH.="<BR><BR><a name='callsgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
if ($report_display_type=="HTML")
{
$MAIN.=$GRAPH;
$MAIN.=$GRAPH.$GRAPH2.$GRAPH3;
}
else
{
+28 -51
View File
@@ -10,6 +10,7 @@
# 130926-0721 - First build based upon LISTS campaign report
# 130927-2154 - Added summary and full download options
# 140108-0714 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -525,11 +526,8 @@ else
$HA_count = $row[0];
$flag_count+=$row[0];
$category_totals["HA"]+=$HA_count;
if ($HA_count > 0)
{
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
$HA_percent = ( ($HA_count / $TOTALleads) * 100);
}
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
$HA_percent = ( MathZDC($HA_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($sale_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -541,11 +539,8 @@ else
$SALE_count = $row[0];
$flag_count+=$row[0];
$category_totals["SALE"]+=$SALE_count;
if ($SALE_count > 0)
{
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
$SALE_percent = ( ($SALE_count / $TOTALleads) * 100);
}
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
$SALE_percent = ( MathZDC($SALE_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($dnc_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -557,11 +552,8 @@ else
$DNC_count = $row[0];
$flag_count+=$row[0];
$category_totals["DNC"]+=$DNC_count;
if ($DNC_count > 0)
{
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
$DNC_percent = ( ($DNC_count / $TOTALleads) * 100);
}
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
$DNC_percent = ( MathZDC($DNC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($customer_contact_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -573,11 +565,8 @@ else
$CC_count = $row[0];
$flag_count+=$row[0];
$category_totals["CC"]+=$CC_count;
if ($CC_count > 0)
{
if ($C_count>$max_calls) {$max_calls=$CC_count;}
$CC_percent = ( ($CC_count / $TOTALleads) * 100);
}
if ($C_count>$max_calls) {$max_calls=$CC_count;}
$CC_percent = ( MathZDC($CC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($not_interested_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -589,11 +578,8 @@ else
$NI_count = $row[0];
$flag_count+=$row[0];
$category_totals["NI"]+=$NI_count;
if ($NI_count > 0)
{
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
$NI_percent = ( ($NI_count / $TOTALleads) * 100);
}
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
$NI_percent = ( MathZDC($NI_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($unworkable_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -605,11 +591,8 @@ else
$UW_count = $row[0];
$flag_count+=$row[0];
$category_totals["UW"]+=$UW_count;
if ($UW_count > 0)
{
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
$UW_percent = ( ($UW_count / $TOTALleads) * 100);
}
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
$UW_percent = ( MathZDC($UW_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($scheduled_callback_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -621,11 +604,8 @@ else
$SC_count = $row[0];
$flag_count+=$row[0];
$category_totals["SC"]+=$SC_count;
if ($SC_count > 0)
{
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( ($SC_count / $TOTALleads) * 100);
}
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( MathZDC($SC_count, $TOTALleads) * 100);
}
$stmt="select count(*) from vicidial_list where status IN($completed_statuses) and list_id='$list_id';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -637,11 +617,8 @@ else
$COMP_count = $row[0];
$flag_count+=$row[0];
$category_totals["COMP"]+=$COMP_count;
if ($COMP_count > 0)
{
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( ($COMP_count / $TOTALleads) * 100);
}
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( MathZDC($COMP_count, $TOTALleads) * 100);
}
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
@@ -705,9 +682,9 @@ else
while ($row=mysqli_fetch_row($rslt))
{
$OUToutput .= "| ".sprintf("%6s", $row[0])." | ".sprintf("%30s", $statname_list["$row[0]"])." | ".sprintf("%8s", $row[1])." | ".sprintf("%6.2f", ( ($row[1] / $TOTALleads) * 100))."% |\n";
$CSV_text3.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( ($row[1] / $TOTALleads) * 100))."%\"\n";
$CSV_textALL.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( ($row[1] / $TOTALleads) * 100))."%\"\n";
$OUToutput .= "| ".sprintf("%6s", $row[0])." | ".sprintf("%30s", $statname_list["$row[0]"])." | ".sprintf("%8s", $row[1])." | ".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."% |\n";
$CSV_text3.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."%\"\n";
$CSV_textALL.="\"$row[0]\",\"".$statname_list["$row[0]"]."\",\"$row[1]\",\"".sprintf("%6.2f", ( MathZDC($row[1], $TOTALleads) * 100))."%\"\n";
}
$OUToutput .= "+-----------------------------------------+----------+---------+\n";
$OUToutput .= "| | ".sprintf("%8s", $TOTALleads)." | 100.00% |\n";
@@ -719,14 +696,14 @@ else
$OUToutput .= "\n";
}
$total_HA_percent = sprintf("%6.2f", ( ($category_totals["HA"] / $totalTOTALleads) * 100)); while(strlen($total_HA_percent)>6) {$total_HA_percent = substr("$total_HA_percent", 0, -1);}
$total_SALE_percent = sprintf("%6.2f", ( ($category_totals["SALE"] / $totalTOTALleads) * 100)); while(strlen($total_SALE_percent)>6) {$total_SALE_percent = substr("$total_SALE_percent", 0, -1);}
$total_DNC_percent = sprintf("%6.2f", ( ($category_totals["DNC"] / $totalTOTALleads) * 100)); while(strlen($total_DNC_percent)>6) {$total_DNC_percent = substr("$total_DNC_percent", 0, -1);}
$total_CC_percent = sprintf("%6.2f", ( ($category_totals["CC"] / $totalTOTALleads) * 100)); while(strlen($total_CC_percent)>6) {$total_CC_percent = substr("$total_CC_percent", 0, -1);}
$total_NI_percent = sprintf("%6.2f", ( ($category_totals["NI"] / $totalTOTALleads) * 100)); while(strlen($total_NI_percent)>6) {$total_NI_percent = substr("$total_NI_percent", 0, -1);}
$total_UW_percent = sprintf("%6.2f", ( ($category_totals["UW"] / $totalTOTALleads) * 100)); while(strlen($total_UW_percent)>6) {$total_UW_percent = substr("$total_UW_percent", 0, -1);}
$total_SC_percent = sprintf("%6.2f", ( ($category_totals["SC"] / $totalTOTALleads) * 100)); while(strlen($total_SC_percent)>6) {$total_SC_percent = substr("$total_SC_percent", 0, -1);}
$total_COMP_percent = sprintf("%6.2f", ( ($category_totals["COMP"] / $totalTOTALleads) * 100)); while(strlen($total_COMP_percent)>6) {$total_COMP_percent = substr("$total_COMP_percent", 0, -1);}
$total_HA_percent = sprintf("%6.2f", ( MathZDC($category_totals["HA"], $totalTOTALleads) * 100)); while(strlen($total_HA_percent)>6) {$total_HA_percent = substr("$total_HA_percent", 0, -1);}
$total_SALE_percent = sprintf("%6.2f", ( MathZDC($category_totals["SALE"], $totalTOTALleads) * 100)); while(strlen($total_SALE_percent)>6) {$total_SALE_percent = substr("$total_SALE_percent", 0, -1);}
$total_DNC_percent = sprintf("%6.2f", ( MathZDC($category_totals["DNC"], $totalTOTALleads) * 100)); while(strlen($total_DNC_percent)>6) {$total_DNC_percent = substr("$total_DNC_percent", 0, -1);}
$total_CC_percent = sprintf("%6.2f", ( MathZDC($category_totals["CC"], $totalTOTALleads) * 100)); while(strlen($total_CC_percent)>6) {$total_CC_percent = substr("$total_CC_percent", 0, -1);}
$total_NI_percent = sprintf("%6.2f", ( MathZDC($category_totals["NI"], $totalTOTALleads) * 100)); while(strlen($total_NI_percent)>6) {$total_NI_percent = substr("$total_NI_percent", 0, -1);}
$total_UW_percent = sprintf("%6.2f", ( MathZDC($category_totals["UW"], $totalTOTALleads) * 100)); while(strlen($total_UW_percent)>6) {$total_UW_percent = substr("$total_UW_percent", 0, -1);}
$total_SC_percent = sprintf("%6.2f", ( MathZDC($category_totals["SC"], $totalTOTALleads) * 100)); while(strlen($total_SC_percent)>6) {$total_SC_percent = substr("$total_SC_percent", 0, -1);}
$total_COMP_percent = sprintf("%6.2f", ( MathZDC($category_totals["COMP"], $totalTOTALleads) * 100)); while(strlen($total_COMP_percent)>6) {$total_COMP_percent = substr("$total_COMP_percent", 0, -1);}
$total_HA_count = sprintf("%10s", $category_totals["HA"]); while(strlen($total_HA_count)>10) {$total_HA_count = substr("$total_HA_count", 0, -1);}
$total_SALE_count = sprintf("%10s", $category_totals["SALE"]); while(strlen($total_SALE_count)>10) {$total_SALE_count = substr("$total_SALE_count", 0, -1);}
+38 -85
View File
@@ -20,6 +20,7 @@
# 130621-0730 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2024 - Changed to mysqli PHP functions
# 140108-0734 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -841,7 +842,7 @@ else
$queue_secondsZ = $row[2];
$agent_alert_delayZ = $row[3];
$TOTALdelay = round($agent_alert_delayZ / 1000);
$TOTALdelay = round(MathZDC($agent_alert_delayZ, 1000));
$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $TOTALdelay);
if ($thiscallsec < 0)
{$thiscallsec = 0;}
@@ -1131,18 +1132,12 @@ else
}
if ( ($answer_count[$i] > 0) and ($talk_sec[$i] > 0) )
{$talk_avg[$i] = ($talk_sec[$i] / $answer_count[$i]);}
else
{$talk_avg[$i] = 0;}
if ( ($calls_count[$i] > 0) and ($queue_seconds[$i] > 0) )
{$queue_avg[$i] = ($queue_seconds[$i] / $calls_count[$i]);}
else
{$queue_avg[$i] = 0;}
$talk_avg[$i] = MathZDC($talk_sec[$i], $answer_count[$i]);
$queue_avg[$i] = MathZDC($queue_seconds[$i], $calls_count[$i]);
if ($print_calls > 0)
{
$PCtemptalkmin = ($PCtemptalk / 60);
$PCtemptalkmin = MathZDC($PCtemptalk, 60);
$ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
}
@@ -1200,10 +1195,7 @@ else
$gAGENTcalls = sprintf("%6s", $agent_count[$i]);
$gPTPcalls = sprintf("%6s", $ptp_count[$i]);
$gRTPcalls = sprintf("%6s", $rtp_count[$i]);
if ( ($calls_count[$i] < 1) or ($na_count[$i] < 1) )
{$gNApercent=0;}
else
{$gNApercent = ( ($na_count[$i] / $calls_count[$i]) * 100);}
$gNApercent = ( MathZDC($na_count[$i], $calls_count[$i]) * 100);
$gNApercent = sprintf("%6.2f",$gNApercent);
$gNAcalls = sprintf("%6s", $na_count[$i]);
$gANSWERcalls = sprintf("%6s", $answer_count[$i]);
@@ -1214,10 +1206,7 @@ else
$gSUMqueue = sprintf("%9s", $queue_seconds[$i]);
$gAVGqueue = sprintf("%7s", $queue_avg[$i]);
$gMAXqueue = sprintf("%7s", $max_queue_seconds[$i]);
if ( ($calls_count[$i] < 1) or ($drop_count[$i] < 1) )
{$gDROPpercent=0;}
else
{$gDROPpercent = ( ($drop_count[$i] / $calls_count[$i]) * 100);}
$gDROPpercent = ( MathZDC($drop_count[$i], $calls_count[$i]) * 100);
$gDROPpercent = sprintf("%6.2f",$gDROPpercent);
$gDROPcalls = sprintf("%6s", $drop_count[$i]);
@@ -1315,14 +1304,8 @@ else
if ($Hmax_queue_seconds[$h] > $hTOTmax_queue_seconds)
{$hTOTmax_queue_seconds = $Hmax_queue_seconds[$h];}
if ( ($Hanswer_count[$h] > 0) and ($Htalk_sec[$h] > 0) )
{$Htalk_avg[$h] = ($Htalk_sec[$h] / $Hanswer_count[$h]);}
else
{$Htalk_avg[$h] = 0;}
if ( ($Hcalls_count[$h] > 0) and ($Hqueue_seconds[$h] > 0) )
{$Hqueue_avg[$h] = ($Hqueue_seconds[$h] / $Hcalls_count[$h]);}
else
{$Hqueue_avg[$h] = 0;}
$Htalk_avg[$h] = MathZDC($Htalk_sec[$h], $Hanswer_count[$h]);
$Hqueue_avg[$h] = MathZDC($Hqueue_seconds[$h], $Hcalls_count[$h]);
if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];}
if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];}
@@ -1355,10 +1338,7 @@ else
$hAGENTcalls = sprintf("%6s", $Hagent_count[$h]);
$hPTPcalls = sprintf("%6s", $Hptp_count[$h]);
$hRTPcalls = sprintf("%6s", $Hrtp_count[$h]);
if ( ($Hcalls_count[$h] < 1) or ($Hna_count[$h] < 1) )
{$hNApercent=0;}
else
{$hNApercent = ( ($Hna_count[$h] / $Hcalls_count[$h]) * 100);}
$hNApercent = ( MathZDC($Hna_count[$h], $Hcalls_count[$h]) * 100);
$hNApercent = sprintf("%6.2f",$hNApercent);
$hNAcalls = sprintf("%6s", $Hna_count[$h]);
$hANSWERcalls = sprintf("%6s", $Hanswer_count[$h]);
@@ -1369,10 +1349,7 @@ else
$hSUMqueue = sprintf("%9s", $Hqueue_seconds[$h]);
$hAVGqueue = sprintf("%7s", $Hqueue_avg[$h]);
$hMAXqueue = sprintf("%7s", $Hmax_queue_seconds[$h]);
if ( ($Hcalls_count[$h] < 1) or ($Hdrop_count[$h] < 1) )
{$hDROPpercent=0;}
else
{$hDROPpercent = ( ($Hdrop_count[$h] / $Hcalls_count[$h]) * 100);}
$hDROPpercent = ( MathZDC($Hdrop_count[$h], $Hcalls_count[$h]) * 100);
$hDROPpercent = sprintf("%6.2f",$hDROPpercent);
$hDROPcalls = sprintf("%6s", $Hdrop_count[$h]);
$hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]);
@@ -1389,14 +1366,8 @@ else
$h++;
}
if ( ($hTOTanswer_count > 0) and ($hTOTtalk_sec > 0) )
{$hTOTtalk_avg = ($hTOTtalk_sec / $hTOTanswer_count);}
else
{$hTOTtalk_avg = 0;}
if ( ($hTOTcalls_count > 0) and ($hTOTqueue_seconds > 0) )
{$hTOTqueue_avg = ($hTOTqueue_seconds / $hTOTcalls_count);}
else
{$hTOTqueue_avg = 0;}
$hTOTtalk_avg = MathZDC($hTOTtalk_sec, $hTOTanswer_count);
$hTOTqueue_avg = MathZDC($hTOTqueue_seconds, $hTOTcalls_count);
$hTOTagent_sec = sec_convert($hTOTagent_sec,'H');
$hTOTpause_sec = sec_convert($hTOTpause_sec,'H');
@@ -1411,10 +1382,7 @@ else
$hTOTagent_count = sprintf("%6s", $hTOTagent_count);
$hTOTptp_count = sprintf("%6s", $hTOTptp_count);
$hTOTrtp_count = sprintf("%6s", $hTOTrtp_count);
if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) )
{$hTOTna_percent=0;}
else
{$hTOTna_percent = ( ($hTOTna_count / $hTOTcalls_count) * 100);}
$hTOTna_percent = ( MathZDC($hTOTna_count, $hTOTcalls_count) * 100);
$hTOTna_percent = sprintf("%6.2f",$hTOTna_percent);
$hTOTna_count = sprintf("%6s", $hTOTna_count);
$hTOTanswer_count = sprintf("%6s", $hTOTanswer_count);
@@ -1425,10 +1393,7 @@ else
$hTOTqueue_seconds = sprintf("%9s", $hTOTqueue_seconds);
$hTOTqueue_avg = sprintf("%7s", $hTOTqueue_avg);
$hTOTmax_queue_seconds = sprintf("%7s", $hTOTmax_queue_seconds);
if ( ($hTOTcalls_count < 1) or ($hTOTdrop_count < 1) )
{$hTOTdrop_percent=0;}
else
{$hTOTdrop_percent = ( ($hTOTdrop_count / $hTOTcalls_count) * 100);}
$hTOTdrop_percent = ( MathZDC($hTOTdrop_count, $hTOTcalls_count) * 100);
$hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent);
$hTOTdrop_count = sprintf("%6s", $hTOTdrop_count);
@@ -1440,15 +1405,15 @@ else
for ($d=0; $d<count($SUBgraph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($SUBgraph_stats)) {$class=" last";} else {$class="";}
$SUBCALLS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][1]/$SUBmax_calls)."' height='16' />".$SUBgraph_stats[$d][1]."</td></tr>";
$SUBSYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][2]/$SUBmax_system_release)."' height='16' />".$SUBgraph_stats[$d][2]."</td></tr>";
$SUBAGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][3]/$SUBmax_agent_release)."' height='16' />".$SUBgraph_stats[$d][3]."</td></tr>";
$SUBSALES_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][4]/$SUBmax_sales)."' height='16' />".$SUBgraph_stats[$d][4]."</td></tr>";
$SUBDNCS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][5]/$SUBmax_dncs)."' height='16' />".$SUBgraph_stats[$d][5]."</td></tr>";
$SUBNAS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][6]/$SUBmax_nas)."' height='16' />".$SUBgraph_stats[$d][6]."%</td></tr>";
$SUBDROPS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][7]/$SUBmax_drops)."' height='16' />".$SUBgraph_stats[$d][7]."%</td></tr>";
$SUBLOGINTIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][8]/$SUBmax_login_time)."' height='16' />".sec_convert($SUBgraph_stats[$d][8], 'H')."</td></tr>";
$SUBPAUSETIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][9]/$SUBmax_pause_time)."' height='16' />".sec_convert($SUBgraph_stats[$d][9], 'H')."</td></tr>";
$SUBCALLS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][1], $SUBmax_calls))."' height='16' />".$SUBgraph_stats[$d][1]."</td></tr>";
$SUBSYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][2], $SUBmax_system_release))."' height='16' />".$SUBgraph_stats[$d][2]."</td></tr>";
$SUBAGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][3], $SUBmax_agent_release))."' height='16' />".$SUBgraph_stats[$d][3]."</td></tr>";
$SUBSALES_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][4], $SUBmax_sales))."' height='16' />".$SUBgraph_stats[$d][4]."</td></tr>";
$SUBDNCS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][5], $SUBmax_dncs))."' height='16' />".$SUBgraph_stats[$d][5]."</td></tr>";
$SUBNAS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][6], $SUBmax_nas))."' height='16' />".$SUBgraph_stats[$d][6]."%</td></tr>";
$SUBDROPS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][7], $SUBmax_drops))."' height='16' />".$SUBgraph_stats[$d][7]."%</td></tr>";
$SUBLOGINTIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][8], $SUBmax_login_time))."' height='16' />".sec_convert($SUBgraph_stats[$d][8], 'H')."</td></tr>";
$SUBPAUSETIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$SUBgraph_stats[$d][9], $SUBmax_pause_time))."' height='16' />".sec_convert($SUBgraph_stats[$d][9], 'H')."</td></tr>";
}
$SUBCALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
$SUBSYSTEMRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTsystem_count)."</th></tr></table>";
@@ -1484,16 +1449,10 @@ else
}
$rawTOTtalk_sec = $TOTtalk_sec;
$rawTOTtalk_min = round($rawTOTtalk_sec / 60);
$rawTOTtalk_min = round(MathZDC($rawTOTtalk_sec, 60));
if ( ($TOTanswer_count > 0) and ($TOTtalk_sec > 0) )
{$TOTtalk_avg = ($TOTtalk_sec / $TOTanswer_count);}
else
{$TOTtalk_avg = 0;}
if ( ($TOTcalls_count > 0) and ($TOTqueue_seconds > 0) )
{$TOTqueue_avg = ($TOTqueue_seconds / $TOTcalls_count);}
else
{$TOTqueue_avg = 0;}
$TOTtalk_avg = MathZDC($TOTtalk_sec, $TOTanswer_count);
$TOTqueue_avg = MathZDC($TOTqueue_seconds, $TOTcalls_count);
$TOTagent_sec = sec_convert($TOTagent_sec,'H');
$TOTpause_sec = sec_convert($TOTpause_sec,'H');
@@ -1509,10 +1468,7 @@ else
$TOTagent_count = sprintf("%6s", $TOTagent_count);
$TOTptp_count = sprintf("%6s", $TOTptp_count);
$TOTrtp_count = sprintf("%6s", $TOTrtp_count);
if ( ($TOTcalls_count < 1) or ($TOTna_count < 1) )
{$TOTna_percent=0;}
else
{$TOTna_percent = ( ($TOTna_count / $TOTcalls_count) * 100);}
$TOTna_percent = ( MathZDC($TOTna_count, $TOTcalls_count) * 100);
$TOTna_percent = sprintf("%6.2f",$TOTna_percent);
$TOTna_count = sprintf("%6s", $TOTna_count);
$TOTanswer_count = sprintf("%6s", $TOTanswer_count);
@@ -1523,10 +1479,7 @@ else
$TOTqueue_seconds = sprintf("%9s", $TOTqueue_seconds);
$TOTqueue_avg = sprintf("%7s", $TOTqueue_avg);
$TOTmax_queue_seconds = sprintf("%7s", $TOTmax_queue_seconds);
if ( ($TOTcalls_count < 1) or ($TOTdrop_count < 1) )
{$TOTdrop_percent=0;}
else
{$TOTdrop_percent = ( ($TOTdrop_count / $TOTcalls_count) * 100);}
$TOTdrop_percent = ( MathZDC($TOTdrop_count, $TOTcalls_count) * 100);
$TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent);
$TOTdrop_count = sprintf("%6s", $TOTdrop_count);
@@ -1568,15 +1521,15 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$SYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_system_release)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$AGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_agent_release)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_sales)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$DNCS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_dncs)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$NAS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_nas)."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_drops)."' height='16' />".$graph_stats[$d][7]."%</td></tr>";
$LOGINTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_login_time)."' height='16' />".sec_convert($graph_stats[$d][8], 'H')."</td></tr>";
$PAUSETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_pause_time)."' height='16' />".sec_convert($graph_stats[$d][9], 'H')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$SYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_system_release))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$AGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_agent_release))."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_sales))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$DNCS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_dncs))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$NAS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_nas))."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][7], $max_drops))."' height='16' />".$graph_stats[$d][7]."%</td></tr>";
$LOGINTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][8], $max_login_time))."' height='16' />".sec_convert($graph_stats[$d][8], 'H')."</td></tr>";
$PAUSETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][9], $max_pause_time))."' height='16' />".sec_convert($graph_stats[$d][9], 'H')."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls_count)."</th></tr></table>";
$SYSTEMRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTsystem_count)."</th></tr></table>";
+60 -122
View File
@@ -40,6 +40,7 @@
# 140108-0730 - Added webserver and hostname to report logging
# 140208-2033 - Added List select option
# 140215-0704 - Bug fixes related to Lists selection
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -702,7 +703,7 @@ else
$queue_secondsZ = $row[1];
$agent_alert_delayZ = $row[2];
$TOTALdelay = round($agent_alert_delayZ / 1000);
$TOTALdelay = round(MathZDC($agent_alert_delayZ, 1000));
$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $TOTALdelay);
if ($thiscallsec < 0)
{$thiscallsec = 0;}
@@ -717,14 +718,9 @@ else
}
$TOTALcalls = sprintf("%10s", $TOTALcallsRAW);
if ( ($row[0] < 1) or ($TOTALsec < 1) )
{$average_call_seconds = ' 0';}
else
{
$average_call_seconds = ($TOTALsec / $TOTALcallsRAW);
$average_call_seconds = round($average_call_seconds, 2);
$average_call_seconds = sprintf("%10s", $average_call_seconds);
}
$average_call_seconds = MathZDC($TOTALsec, $TOTALcallsRAW);
$average_call_seconds = round($average_call_seconds, 2);
$average_call_seconds = sprintf("%10s", $average_call_seconds);
$OUToutput .= "Total Calls placed from this Campaign: $TOTALcalls\n";
$OUToutput .= "Average Call Length for all Calls in seconds: $average_call_seconds\n";
@@ -760,7 +756,7 @@ else
$queue_secondsZ = $row[1];
$agent_alert_delayZ = $row[2];
$CIdelay = round($agent_alert_delayZ / 1000);
$CIdelay = round(MathZDC($agent_alert_delayZ, 1000));
$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $CIdelay);
if ($thiscallsec < 0)
{$thiscallsec = 0;}
@@ -775,14 +771,9 @@ else
}
$CIcalls = sprintf("%10s", $CIcallsRAW);
if ( ($CIcallsRAW < 1) or ($CIsec < 1) )
{$average_ci_seconds = ' 0';}
else
{
$average_ci_seconds = ($CIsec / $CIcallsRAW);
$average_ci_seconds = round($average_ci_seconds, 2);
$average_ci_seconds = sprintf("%10s", $average_ci_seconds);
}
$average_ci_seconds = MathZDC($CIsec, $CIcallsRAW);
$average_ci_seconds = round($average_ci_seconds, 2);
$average_ci_seconds = sprintf("%10s", $average_ci_seconds);
$CIsec = sec_convert($CIsec,'H');
@@ -852,43 +843,23 @@ else
$row=mysqli_fetch_row($rslt);
$ANSWERcalls = $row[0];
if ( ($DROPcalls < 1) or ($TOTALcalls < 1) )
{$DROPpercent = '0';}
else
{
$DROPpercent = (($DROPcallsRAW / $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 2);
}
$DROPpercent = (MathZDC($DROPcallsRAW, $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 2);
if ( ($DROPcalls < 1) or ($ANSWERcalls < 1) )
{$DROPANSWERpercent = '0';}
else
{
$DROPANSWERpercent = (($DROPcallsRAW / $ANSWERcalls) * 100);
$DROPANSWERpercent = round($DROPANSWERpercent, 2);
}
$DROPANSWERpercent = (MathZDC($DROPcallsRAW, $ANSWERcalls) * 100);
$DROPANSWERpercent = round($DROPANSWERpercent, 2);
if ( ($DROPseconds < 1) or ($DROPcallsRAW < 1) )
{$average_hold_seconds = ' 0';}
else
{
$average_hold_seconds = ($DROPseconds / $DROPcallsRAW);
$average_hold_seconds = round($average_hold_seconds, 2);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
}
$average_hold_seconds = MathZDC($DROPseconds, $DROPcallsRAW);
$average_hold_seconds = round($average_hold_seconds, 2);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
$OUToutput .= "Total Outbound DROP Calls: $DROPcalls $DROPpercent%\n";
$OUToutput .= "Percent of DROP Calls taken out of Answers: $DROPcalls / $ANSWERcalls $DROPANSWERpercent%\n";
if (preg_match("/YES/i",$include_rollover))
{
if ( ($DROPcalls < 1) or ($CIcallsRAW < 1) )
{$inDROPANSWERpercent = '0';}
else
{
$inDROPANSWERpercent = (($DROPcallsRAW / $CIcallsRAW) * 100);
$inDROPANSWERpercent = round($inDROPANSWERpercent, 2);
}
$inDROPANSWERpercent = (MathZDC($DROPcallsRAW, $CIcallsRAW) * 100);
$inDROPANSWERpercent = round($inDROPANSWERpercent, 2);
$OUToutput .= "Percent of DROP/Answer Calls with Rollover: $DROPcalls / $CIcallsRAW $inDROPANSWERpercent%\n";
}
@@ -923,13 +894,8 @@ else
$row=mysqli_fetch_row($rslt);
$agent_non_pause_sec = $row[0];
if ($agent_non_pause_sec > 0)
{
$AVG_ANSWERagent_non_pause_sec = (($TOTALanswers / $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
}
else
{$AVG_ANSWERagent_non_pause_sec=0;}
$AVG_ANSWERagent_non_pause_sec = (MathZDC($TOTALanswers, $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%10s", $AVG_ANSWERagent_non_pause_sec);
if ($skip_productivity_calc) {
@@ -959,22 +925,13 @@ else
$totalNAcalls = ($autoNAcalls + $manualNAcalls);
$totalNAcalls = sprintf("%10s", $totalNAcalls);
if ( ($totalNAcalls < 1) or ($TOTALcalls < 1) )
{$NApercent = '0';}
else
{
$NApercent = (($totalNAcalls / $TOTALcalls) * 100);
$NApercent = round($NApercent, 2);
}
if ( ($row[0] < 1) or ($row[1] < 1) )
{$average_na_seconds = ' 0';}
else
{
$average_na_seconds = ($row[1] / $row[0]);
$average_na_seconds = round($average_na_seconds, 2);
$average_na_seconds = sprintf("%10s", $average_na_seconds);
}
$NApercent = (MathZDC($totalNAcalls, $TOTALcalls) * 100);
$NApercent = round($NApercent, 2);
$average_na_seconds = MathZDC($row[1], $row[0]);
$average_na_seconds = round($average_na_seconds, 2);
$average_na_seconds = sprintf("%10s", $average_na_seconds);
$OUToutput .= "Total NA calls -Busy,Disconnect,RingNoAnswer: $totalNAcalls $NApercent%\n";
$OUToutput .= "Total auto NA calls -system-set: $autoNAcalls\n";
@@ -1035,7 +992,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -1174,9 +1131,9 @@ else
if ($AGENTsec < 1) {$AGENTsec=1;}
$TOTALcalls = ($TOTALcalls + $STATUScount);
$TOTALtimeS = ($TOTALtimeS + $RAWhours);
$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );
$STATUSrate = MathZDC($STATUScount, MathZDC($TOTALsec, 3600) );
$STATUSrate = sprintf("%.2f", $STATUSrate);
$AGENTrate = ($STATUScount / ($AGENTsec / 3600) );
$AGENTrate = MathZDC($STATUScount, MathZDC($AGENTsec, 3600) );
$AGENTrate = sprintf("%.2f", $AGENTrate);
if ($STATUScount>$max_calls) {$max_calls=$STATUScount;}
@@ -1186,12 +1143,12 @@ else
if ($AGENTrate>$max_agentcallshr) {$max_agentcallshr=$AGENTrate;}
$graph_stats[$i][1]=$STATUScount;
$graph_stats[$i][2]=$RAWhours;
$graph_stats[$i][3]=($RAWhours / $STATUScount);
$graph_stats[$i][3]=MathZDC($RAWhours, $STATUScount);
$graph_stats[$i][4]=$STATUSrate;
$graph_stats[$i][5]=$AGENTrate;
$STATUShours = sec_convert($RAWhours,'H');
$STATUSavg_sec = ($RAWhours / $STATUScount);
$STATUSavg_sec = MathZDC($RAWhours, $STATUScount);
$STATUSavg = sec_convert($STATUSavg_sec,'H');
$STATUScount = sprintf("%10s", $STATUScount);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
@@ -1222,24 +1179,16 @@ else
$i++;
}
if ($TOTALcalls < 1)
{
$TOTALhours = '0:00:00';
$TOTALavg = '0:00:00';
$TOTALrate = '0.00';
}
else
{
$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );
$TOTALrate = sprintf("%.2f", $TOTALrate);
$aTOTALrate = ($TOTALcalls / ($AGENTsec / 3600) );
$aTOTALrate = sprintf("%.2f", $aTOTALrate);
$TOTALrate = MathZDC($TOTALcalls, MathZDC($TOTALsec, 3600) );
$TOTALrate = sprintf("%.2f", $TOTALrate);
$aTOTALrate = MathZDC($TOTALcalls, MathZDC($AGENTsec, 3600) );
$aTOTALrate = sprintf("%.2f", $aTOTALrate);
$aTOTALhours = sec_convert($AGENTsec,'H');
$TOTALhours = sec_convert($TOTALtimeS,'H');
$TOTALavg_sec = MathZDC($TOTALtimeS, $TOTALcalls);
$TOTALavg = sec_convert($TOTALavg_sec,'H');
$aTOTALhours = sec_convert($AGENTsec,'H');
$TOTALhours = sec_convert($TOTALtimeS,'H');
$TOTALavg_sec = ($TOTALtimeS / $TOTALcalls);
$TOTALavg = sec_convert($TOTALavg_sec,'H');
}
$TOTALcalls = sprintf("%10s", $TOTALcalls);
$TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
$aTOTALhours = sprintf("%10s", $aTOTALhours);while(strlen($aTOTALhours)>10) {$aTOTALhours = substr("$aTOTALhours", 0, -1);}
@@ -1254,11 +1203,11 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_total_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avg_time)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLSHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_callshr)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$CALLSHOUR_agent_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*($graph_stats[$d][5]/$max_agentcallshr))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_total_time))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_avg_time))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLSHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_callshr))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$CALLSHOUR_agent_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_agentcallshr))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th></tr></table>";
$TOTALTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALhours)."</th></tr></table>";
@@ -1356,7 +1305,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -1463,7 +1412,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -1530,7 +1479,7 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$graph_stats[$d][0], $max_calls))."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
$GRAPH.=" </tr>\n";
}
$GRAPH.=" <tr>\n";
@@ -1621,7 +1570,7 @@ else
$queue_secondsZ = $row[1];
$agent_alert_delayZ = $row[2];
$CIdelay = round($agent_alert_delayZ / 1000);
$CIdelay = round(MathZDC($agent_alert_delayZ, 1000));
$thiscallsec = (($length_in_secZ - $queue_secondsZ) - $CIdelay);
if ($thiscallsec < 0)
{$thiscallsec = 0;}
@@ -1640,7 +1589,7 @@ else
$USERcalls = sprintf("%10s", $RAWuser_calls[$i]);
$USERtotTALK = $RAWuser_talk[$i];
$USERavgTALK = round($RAWuser_talk[$i] / $RAWuser_calls[$i]);
$USERavgTALK = round(MathZDC($RAWuser_talk[$i], $RAWuser_calls[$i]));
#######
if ($RAWuser_calls[$i]>$max_calls) {$max_calls=$RAWuser_calls[$i];}
@@ -1667,7 +1616,7 @@ else
$rawTOTtime = $TOTtime;
if (!$TOTcalls) {$TOTcalls = 1;}
$TOTavg = ($TOTtime / $TOTcalls);
$TOTavg = MathZDC($TOTtime, $TOTcalls);
$TOTavg_MS = sec_convert($TOTavg,'H');
$TOTtime_MS = sec_convert($TOTtime,'H');
@@ -1697,9 +1646,9 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_total_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avg_time)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_total_time))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_avg_time))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
$TOTALTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtime)."</th></tr></table>";
@@ -1751,18 +1700,18 @@ else
if ($print_calls > 0)
{ echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\n";}
$newTALK = ($row[2] - $row[3] - ($row[4] / 1000) );
$newTALK = ($row[2] - $row[3] - MathZDC($row[4], 1000) );
if ($newTALK < 0) {$newTALK = 0;}
$tempTALK = ($tempTALK + $newTALK);
$w++;
}
}
$tempTALKmin = ($tempTALK / 60);
$tempTALKmin = MathZDC($tempTALK, 60);
if ($print_calls > 0)
{echo "$w\t$tempTALK\t$tempTALKmin\n";}
echo "</PRE>\n<B>";
$rawTOTtalk_min = round($tempTALK / 60);
$rawTOTtalk_min = round(MathZDC($tempTALK, 60));
$outbound_cost = ($rawTOTtalk_min * $outbound_rate);
$outbound_cost = sprintf("%8.2f", $outbound_cost);
@@ -1879,13 +1828,7 @@ else
$h++;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{
$hour_multiplier = (100 / $hi_hour_count);
#$hour_multiplier = round($hour_multiplier, 0);
}
$hour_multiplier = MathZDC(100, $hi_hour_count);
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS PLACED FROM THIS CAMPAIGN\n";
@@ -1898,13 +1841,8 @@ else
if ($Mk >= 5)
{
$Mk=0;
if ( ($k < 1) or ($hour_multiplier <= 0) )
{$scale_num = 100;}
else
{
$scale_num=($k / $hour_multiplier);
$scale_num = round($scale_num, 0);
}
$scale_num=MathZDC($k, $hour_multiplier, 100);
$scale_num = round($scale_num, 0);
$LENscale_num = (strlen($scale_num));
$k = ($k + $LENscale_num);
$call_scale .= "$scale_num";
+8 -17
View File
@@ -22,6 +22,7 @@
# 130704-0942 - Fixed issue #675
# 130831-0928 - Changed to mysqli PHP functions
# 140108-0751 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -560,12 +561,7 @@ else
$Sdate = sprintf("%-10s", $Sdate);
while(strlen($Suser)>10) {$Suser = substr("$Sdate", 0, -1);}
if ( ($DNCcount < 1) or ($CIScount < 1) )
{$DNCcountPCTs=0;}
else
{
$DNCcountPCTs = ( ($DNCcount / $CIScount) * 100);
}
$DNCcountPCTs = ( MathZDC($DNCcount, $CIScount) * 100);
$RAWdncPCT = $DNCcountPCTs;
# $DNCcountPCTs = round($DNCcountPCTs,2);
$DNCcountPCTs = round($DNCcountPCTs);
@@ -700,12 +696,7 @@ else
$TOTcalls = sprintf("%7s", $TOTcalls);
$CIScountTOT = sprintf("%7s", $CIScountTOT);
if ( ($DNCcountTOT < 1) or ($CIScountTOT < 1) )
{$DNCcountPCT=0;}
else
{
$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
}
$DNCcountPCT = ( MathZDC($DNCcountTOT, $CIScountTOT) * 100);
#$DNCcountPCT = round($DNCcountPCT,2);
$DNCcountPCT = round($DNCcountPCT);
#$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
@@ -730,16 +721,16 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_cicalls)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_dncci)."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_cicalls))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_dncci))."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
for ($e=0; $e<count($statusesARY); $e++) {
$Sstatus=$statusesARY[$e];
$varname=$Sstatus."_graph";
$max_varname="max_".$Sstatus;
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+4)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][($e+4)], $$max_varname))."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
}
}
@@ -939,7 +930,7 @@ if ($report_display_type=="TEXT" || !$report_display_type)
else
{
echo " <SPAN class=\"yellow\">";
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
$TOPsortPLOT = ( MathZDC($TOPsortTALLY[$i], $TOPsortMAX) * 120 );
$h=0;
while ($h <= $TOPsortPLOT)
{
+46 -51
View File
@@ -41,6 +41,7 @@
# 131019-1111 - Added user select
# 140108-0713 - Added webserver and hostname to report logging
# 140319-1913 - Added option to show percentages for various fields
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -790,7 +791,7 @@ while ($m < $k)
$CSVstatuses.=",\"$calls[$i]\"";
if ($show_percentages) {
$SstatusTXT_pct=sprintf("%8s", sprintf("%0.2f", ZeroDivisionCheck(100*$calls[$i], $userTOTcalls[$Suser])));
$SstatusTXT_pct=sprintf("%8s", sprintf("%0.2f", MathZDC(100*$calls[$i], $userTOTcalls[$Suser])));
$SstatusesHTML .= " $SstatusTXT_pct % |";
$CSVstatuses.=",\"$SstatusTXT_pct %\"";
}
@@ -824,12 +825,12 @@ while ($m < $k)
$TOTtotCUSTOMER=($TOTtotCUSTOMER + $Scustomer_sec);
$Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
$Stalk_avg = ZeroDivisionCheck($Stalk_sec, $Scalls);
$Spause_avg = ZeroDivisionCheck($Spause_sec, $Scalls);
$Swait_avg = ZeroDivisionCheck($Swait_sec, $Scalls);
$Sdispo_avg = ZeroDivisionCheck($Sdispo_sec, $Scalls);
$Sdead_avg = ZeroDivisionCheck($Sdead_sec, $Scalls);
$Scustomer_avg = ZeroDivisionCheck($Scustomer_sec, $Scalls);
$Stalk_avg = MathZDC($Stalk_sec, $Scalls);
$Spause_avg = MathZDC($Spause_sec, $Scalls);
$Swait_avg = MathZDC($Swait_sec, $Scalls);
$Sdispo_avg = MathZDC($Sdispo_sec, $Scalls);
$Sdead_avg = MathZDC($Sdead_sec, $Scalls);
$Scustomer_avg = MathZDC($Scustomer_sec, $Scalls);
$RAWuser = $Suser;
$RAWcalls = $Scalls;
@@ -891,22 +892,22 @@ while ($m < $k)
$pfUSERtime_MS = sec_convert($Stime,'H');
$pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H');
$pfUSERtotTALK_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Stalk_sec, $Stime));
$pfUSERtotTALK_MS_pct = sprintf("%0.2f", MathZDC(100*$Stalk_sec, $Stime));
$pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M');
$USERtotPAUSE_MS = sec_convert($Spause_sec,'H');
$pfUSERtotPAUSE_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Spause_sec, $Stime));
$pfUSERtotPAUSE_MS_pct = sprintf("%0.2f", MathZDC(100*$Spause_sec, $Stime));
$USERavgPAUSE_MS = sec_convert($Spause_avg,'M');
$USERtotWAIT_MS = sec_convert($Swait_sec,'H');
$pfUSERtotWAIT_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Swait_sec, $Stime));
$pfUSERtotWAIT_MS_pct = sprintf("%0.2f", MathZDC(100*$Swait_sec, $Stime));
$USERavgWAIT_MS = sec_convert($Swait_avg,'M');
$USERtotDISPO_MS = sec_convert($Sdispo_sec,'H');
$pfUSERtotDISPO_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Sdispo_sec, $Stime));
$pfUSERtotDISPO_MS_pct = sprintf("%0.2f", MathZDC(100*$Sdispo_sec, $Stime));
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
$USERtotDEAD_MS = sec_convert($Sdead_sec,'H');
$pfUSERtotDEAD_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Sdead_sec, $Stime));
$pfUSERtotDEAD_MS_pct = sprintf("%0.2f", MathZDC(100*$Sdead_sec, $Stime));
$USERavgDEAD_MS = sec_convert($Sdead_avg,'M');
$USERtotCUSTOMER_MS = sec_convert($Scustomer_sec,'H');
$pfUSERtotCUSTOMER_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$Scustomer_sec, $Stime));
$pfUSERtotCUSTOMER_MS_pct = sprintf("%0.2f", MathZDC(100*$Scustomer_sec, $Stime));
$USERavgCUSTOMER_MS = sec_convert($Scustomer_avg,'M');
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
@@ -1022,7 +1023,7 @@ while ($n < $j)
$SUMstatusesHTML .= " $SUMstatusTXT |";
$CSVSUMstatuses.=",\"$Scalls\"";
if ($show_percentages) {
$SstatusTXT_pct=sprintf("%8s", sprintf("%0.2f", ZeroDivisionCheck(100*$Scalls,$TOTcalls)));
$SstatusTXT_pct=sprintf("%8s", sprintf("%0.2f", MathZDC(100*$Scalls,$TOTcalls)));
$SUMstatusesHTML .= " $SstatusTXT_pct % |";
$CSVSUMstatuses.=",\"$SstatusTXT_pct %\"";
}
@@ -1035,18 +1036,12 @@ while ($n < $j)
$TOTcalls = sprintf("%7s", $TOTcalls);
$TOT_AGENTS = sprintf("%-4s", $m);
if ($TOTtotTALK < 1) {$TOTavgTALK = '0';}
else {$TOTavgTALK = ($TOTtotTALK / $TOTcalls);}
if ($TOTtotDISPO < 1) {$TOTavgDISPO = '0';}
else {$TOTavgDISPO = ($TOTtotDISPO / $TOTcalls);}
if ($TOTtotDEAD < 1) {$TOTavgDEAD = '0';}
else {$TOTavgDEAD = ($TOTtotDEAD / $TOTcalls);}
if ($TOTtotPAUSE < 1) {$TOTavgPAUSE = '0';}
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
if ($TOTtotCUSTOMER < 1) {$TOTavgCUSTOMER = '0';}
else {$TOTavgCUSTOMER = ($TOTtotCUSTOMER / $TOTcalls);}
$TOTavgTALK = MathZDC($TOTtotTALK, $TOTcalls);
$TOTavgDISPO = MathZDC($TOTtotDISPO, $TOTcalls);
$TOTavgDEAD = MathZDC($TOTtotDEAD, $TOTcalls);
$TOTavgPAUSE = MathZDC($TOTtotPAUSE, $TOTcalls);
$TOTavgWAIT = MathZDC($TOTtotWAIT, $TOTcalls);
$TOTavgCUSTOMER = MathZDC($TOTtotCUSTOMER, $TOTcalls);
$TOTtime_MS = sec_convert($TOTtime,'H');
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
@@ -1055,12 +1050,12 @@ $TOTtotDEAD_MS = sec_convert($TOTtotDEAD,'H');
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
$TOTtotCUSTOMER_MS = sec_convert($TOTtotCUSTOMER,'H');
$TOTtotTALK_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotTALK, $TOTtime));
$TOTtotDISPO_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotDISPO, $TOTtime));
$TOTtotDEAD_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotDEAD, $TOTtime));
$TOTtotPAUSE_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotPAUSE, $TOTtime));
$TOTtotWAIT_MS_pct = sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotWAIT, $TOTtime));
$TOTtotCUSTOMER_MS_pct =sprintf("%0.2f", ZeroDivisionCheck(100*$TOTtotCUSTOMER, $TOTtime));
$TOTtotTALK_MS_pct = sprintf("%0.2f", MathZDC(100*$TOTtotTALK, $TOTtime));
$TOTtotDISPO_MS_pct = sprintf("%0.2f", MathZDC(100*$TOTtotDISPO, $TOTtime));
$TOTtotDEAD_MS_pct = sprintf("%0.2f", MathZDC(100*$TOTtotDEAD, $TOTtime));
$TOTtotPAUSE_MS_pct = sprintf("%0.2f", MathZDC(100*$TOTtotPAUSE, $TOTtime));
$TOTtotWAIT_MS_pct = sprintf("%0.2f", MathZDC(100*$TOTtotWAIT, $TOTtime));
$TOTtotCUSTOMER_MS_pct =sprintf("%0.2f", MathZDC(100*$TOTtotCUSTOMER, $TOTtime));
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
$TOTavgDEAD_MS = sec_convert($TOTavgDEAD,'H');
@@ -1121,20 +1116,20 @@ for ($e=0; $e<count($statusesARY); $e++) {
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][2], $max_time))."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][3], $max_pause))."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
$PAUSEAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][4], $max_pauseavg))."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][5], $max_wait))."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
$WAITAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][6], $max_waitavg))."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][7], $max_talk))."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
$TALKAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][8], $max_talkavg))."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][9], $max_dispo))."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
$DISPOAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][10], $max_dispoavg))."' height='16' />".sec_convert($graph_stats[$d][10], 'HF')."</td></tr>";
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][11], $max_dead))."' height='16' />".sec_convert($graph_stats[$d][11], 'HF')."</td></tr>";
$DEADAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][12], $max_deadavg))."' height='16' />".sec_convert($graph_stats[$d][12], 'HF')."</td></tr>";
$CUST_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][13], $max_customer))."' height='16' />".sec_convert($graph_stats[$d][13], 'HF')."</td></tr>";
$CUSTAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][14], $max_customeravg))."' height='16' />".sec_convert($graph_stats[$d][14], 'HF')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$TIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_time))."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_pause))."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
$PAUSEAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_pauseavg))."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_wait))."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
$WAITAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_waitavg))."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][7], $max_talk))."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
$TALKAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][8], $max_talkavg))."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][9], $max_dispo))."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
$DISPOAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][10], $max_dispoavg))."' height='16' />".sec_convert($graph_stats[$d][10], 'HF')."</td></tr>";
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][11], $max_dead))."' height='16' />".sec_convert($graph_stats[$d][11], 'HF')."</td></tr>";
$DEADAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][12], $max_deadavg))."' height='16' />".sec_convert($graph_stats[$d][12], 'HF')."</td></tr>";
$CUST_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][13], $max_customer))."' height='16' />".sec_convert($graph_stats[$d][13], 'HF')."</td></tr>";
$CUSTAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][14], $max_customeravg))."' height='16' />".sec_convert($graph_stats[$d][14], 'HF')."</td></tr>";
for ($e=0; $e<count($statusesARY); $e++) {
$Sstatus=$statusesARY[$e];
@@ -1142,7 +1137,7 @@ for ($d=0; $d<count($graph_stats); $d++) {
$max_varname="max_".$Sstatus;
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][($e+15)], $$max_varname))."' height='16' />".$graph_stats[$d][($e+15)]."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][($e+15)], $$max_varname))."' height='16' />".$graph_stats[$d][($e+15)]."</td></tr>";
}
}
@@ -1552,16 +1547,16 @@ for ($e=0; $e<count($sub_statusesARY); $e++) {
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$TOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][1], $max_total))."' height='16' />".sec_convert($graph_stats[$d][1], 'H')."</td></tr>";
$NONPAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][2], $max_nonpause))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][3], $max_pause))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$TOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_total))."' height='16' />".sec_convert($graph_stats[$d][1], 'H')."</td></tr>";
$NONPAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_nonpause))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_pause))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
for ($e=0; $e<count($sub_statusesARY); $e++) {
$Sstatus=$sub_statusesARY[$e];
$varname=$Sstatus."_graph";
$max_varname="max_".$Sstatus;
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(ZeroDivisionCheck(400*$graph_stats[$d][($e+4)], $$max_varname))."' height='16' />".sec_convert($graph_stats[$d][($e+4)], 'H')."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][($e+4)], $$max_varname))."' height='16' />".sec_convert($graph_stats[$d][($e+4)], 'H')."</td></tr>";
}
}
+9 -18
View File
@@ -24,6 +24,7 @@
# 130704-0944 - Fixed issue #675
# 130901-0827 - Changed to mysqli PHP functions
# 140108-0711 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -636,12 +637,7 @@ else
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
}
if ( ($DNCcount < 1) or ($CIScount < 1) )
{$DNCcountPCTs=0;}
else
{
$DNCcountPCTs = ( ($DNCcount / $CIScount) * 100);
}
$DNCcountPCTs = ( MathZDC($DNCcount, $CIScount) * 100);
$RAWdncPCT = $DNCcountPCTs;
# $DNCcountPCTs = round($DNCcountPCTs,2);
$DNCcountPCTs = round($DNCcountPCTs);
@@ -774,15 +770,10 @@ else
$TOTcalls = sprintf("%7s", $TOTcalls);
$CIScountTOT = sprintf("%7s", $CIScountTOT);
$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
$DNCcountPCT = ( MathZDC($DNCcountTOT, $CIScountTOT) * 100);
$DNCcountPCT = round($DNCcountPCT,2);
$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
if ( ($DNCcountTOT < 1) or ($CIScountTOT < 1) )
{$DNCcountPCT=0;}
else
{
$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
}
$DNCcountPCT = ( MathZDC($DNCcountTOT, $CIScountTOT) * 100);
#$DNCcountPCT = round($DNCcountPCT,2);
$DNCcountPCT = round($DNCcountPCT);
#$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
@@ -805,9 +796,9 @@ else
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_cicalls)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_dncci)."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_cicalls))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_dncci))."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
for ($e=0; $e<count($sub_statusesARY); $e++) {
$Sstatus=$sub_statusesARY[$e];
@@ -815,7 +806,7 @@ else
$max_varname="max_".$Sstatus;
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+4)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][($e+4)], $$max_varname))."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
}
}
@@ -1026,7 +1017,7 @@ if (!$report_display_type || $report_display_type=="TEXT")
else
{
echo " <SPAN class=\"yellow\">";
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
$TOPsortPLOT = ( MathZDC($TOPsortTALLY[$i], $TOPsortMAX) * 110 );
$h=0;
while ($h <= $TOPsortPLOT)
{
+38 -107
View File
@@ -34,6 +34,7 @@
# 131129-1020 - Fixed division by zero bug in HTML mode
# 140108-0708 - Added webserver and hostname to report logging
# 140314-0852 - Fixed several division by zero bugs
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -733,22 +734,11 @@ else
$SstatusesHTML='';
$SstatusesFILE='';
$Stime[$m] = ($Swait[$m] + $Stalk[$m] + $Sdispo[$m] + $Spause[$m]);
if ($Stime[$m] > 0)
{
$Swaitpct[$m]=(100*$Swait[$m]/$Stime[$m]);
$Stalkpct[$m]=(100*$Stalk[$m]/$Stime[$m]);
$Sdispopct[$m]=(100*$Sdispo[$m]/$Stime[$m]);
$Spausepct[$m]=(100*$Spause[$m]/$Stime[$m]);
$Sdeadpct[$m]=(100*$Sdead[$m]/$Stime[$m]);
}
else
{
$Swaitpct[$m]=0;
$Stalkpct[$m]=0;
$Sdispopct[$m]=0;
$Spausepct[$m]=0;
$Sdeadpct[$m]=0;
}
$Swaitpct[$m]=MathZDC(100*$Swait[$m], $Stime[$m]);
$Stalkpct[$m]=MathZDC(100*$Stalk[$m], $Stime[$m]);
$Sdispopct[$m]=MathZDC(100*$Sdispo[$m], $Stime[$m]);
$Spausepct[$m]=MathZDC(100*$Spause[$m], $Stime[$m]);
$Sdeadpct[$m]=MathZDC(100*$Sdead[$m], $Stime[$m]);
$RAWuser = $Suser[$m];
$RAWcalls = $Scalls[$m];
$RAWtimeSEC = $Stime[$m];
@@ -942,19 +932,8 @@ else
$TOTuser_holds+=$park_array[$Suser[$m]][0];
$TOTtotal_hold_time+=$park_array[$Suser[$m]][1];
if ($user_holds > 0)
{
$avg_hold_time=round($total_hold_time/$user_holds);
if ($Scalls[$m] > 0)
{$user_hpc=sprintf("%.2f", ($user_holds/$Scalls[$m]));}
else
{$user_hpc=0;}
}
else
{
$avg_hold_time=0;
$user_hpc=0;
}
$avg_hold_time=round(MathZDC($total_hold_time, $user_holds));
$user_hpc=sprintf("%.2f", MathZDC($user_holds, $Scalls[$m]));
$total_hold_time=sec_convert($total_hold_time,$TIME_agenttimedetail);
$avg_hold_time=sec_convert($avg_hold_time,$TIME_agenttimedetail);
@@ -969,26 +948,11 @@ else
if (trim($user_holds)>$max_user_holds) {$max_user_holds=trim($user_holds);}
if (trim($park_array[$Suser[$m]][1]+0)>$max_total_hold_time) {$max_total_hold_time=trim($park_array[$Suser[$m]][1]+0);}
if ($user_holds>0)
{
if (trim(round(($park_array[$Suser[$m]][1]+0)/$user_holds))>$max_avg_hold_time)
{$max_avg_hold_time=trim(round(($park_array[$Suser[$m]][1]+0)/$user_holds));}
}
else
{
$max_avg_hold_time=0;
}
if (trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds)))>$max_avg_hold_time) {$max_avg_hold_time=trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds)));}
if (trim($user_hpc)>$max_user_hpc) {$max_user_hpc=trim($user_hpc);}
$graph_stats[$m][15]=trim($user_holds);
$graph_stats[$m][16]=trim($park_array[$Suser[$m]][1]+0);
if ($user_holds>0)
{
$graph_stats[$m][17]=trim(round(($park_array[$Suser[$m]][1]+0)/$user_holds));
}
else
{
$graph_stats[$m][17]=0;
}
$graph_stats[$m][17]=trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds)));
$graph_stats[$m][18]=trim($user_hpc);
@@ -1172,22 +1136,11 @@ else
### END loop through each status ###
### call function to calculate and print dialable leads
if ($TOTALtime>0)
{
$TOTwaitpct=sprintf("%01.2f", (100*$TOTwait/$TOTALtime));
$TOTtalkpct=sprintf("%01.2f", (100*$TOTtalk/$TOTALtime));
$TOTdispopct=sprintf("%01.2f", (100*$TOTdispo/$TOTALtime));
$TOTpausepct=sprintf("%01.2f", (100*$TOTpause/$TOTALtime));
$TOTdeadpct=sprintf("%01.2f", (100*$TOTdead/$TOTALtime));
}
else
{
$TOTwaitpct=sprintf("%01.2f", 0);
$TOTtalkpct=sprintf("%01.2f", 0);
$TOTdispopct=sprintf("%01.2f", 0);
$TOTpausepct=sprintf("%01.2f", 0);
$TOTdeadpct=sprintf("%01.2f", 0);
}
$TOTwaitpct=sprintf("%01.2f", MathZDC(100*$TOTwait, $TOTALtime));
$TOTtalkpct=sprintf("%01.2f", MathZDC(100*$TOTtalk, $TOTALtime));
$TOTdispopct=sprintf("%01.2f", MathZDC(100*$TOTdispo, $TOTALtime));
$TOTpausepct=sprintf("%01.2f", MathZDC(100*$TOTpause, $TOTALtime));
$TOTdeadpct=sprintf("%01.2f", MathZDC(100*$TOTdead, $TOTALtime));
$TOTwait = sec_convert($TOTwait,$TIME_agenttimedetail);
$TOTtalk = sec_convert($TOTtalk,$TIME_agenttimedetail);
@@ -1200,22 +1153,8 @@ else
if ($show_parks)
{
if ($TOTuser_holds>0)
{
$TOTavg_hold_time=round($TOTtotal_hold_time/$TOTuser_holds);
}
else
{
$TOTavg_hold_time=0;
}
if ($TOTcalls>0)
{
$TOTuser_hpc=sprintf("%.2f", ($TOTuser_holds/$TOTcalls));
}
else
{
$TOTuser_hpc=0;
}
$TOTavg_hold_time=round(MathZDC($TOTtotal_hold_time, $TOTuser_holds));
$TOTuser_hpc=sprintf("%.2f", MathZDC($TOTuser_holds, $TOTcalls));
$TOTtotal_hold_time=sec_convert($TOTtotal_hold_time,$TIME_agenttimedetail);
$TOTavg_hold_time=sec_convert($TOTavg_hold_time,$TIME_agenttimedetail);
$hTOTuser_holds= sprintf("%8s", $TOTuser_holds);
@@ -1269,30 +1208,29 @@ else
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
if ($atdr_login_logout_user_link > 0)
{
$CALLS_graph.=" <tr><td class='chart_td$class'><a href=\'./user_stats.php?pause_code_rpt=1&begin_date=$query_date&end_date=$end_date&user=".$user_IDs[$d]."\'>".$graph_stats[$d][0]."</a></td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_calls>0 ? round(1000*$graph_stats[$d][1]/$max_calls) : 0)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'><a href=\'./user_stats.php?pause_code_rpt=1&begin_date=$query_date&end_date=$end_date&user=".$user_IDs[$d]."\'>".$graph_stats[$d][0]."</a></td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
}
else
{
$CALLS_graph.=" <tr><td class='chart_td$class'><a href=\'./user_stats.php?user=".$user_IDs[$d]."&begin_date=$query_date&end_date\'>".$graph_stats[$d][0]."</a></td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_calls>0 ? round(1000*$graph_stats[$d][1]/$max_calls) : 0)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'><a href=\'./user_stats.php?user=".$user_IDs[$d]."&begin_date=$query_date&end_date\'>".$graph_stats[$d][0]."</a></td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
}
$TIMECLOCK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_timeclock>0 ? round(1000*$graph_stats[$d][2]/$max_timeclock) : 0)."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
$AGENTTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_agenttime>0 ? round(1000*$graph_stats[$d][3]/$max_agenttime) : 0)."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_wait>0 ? round(1000*$graph_stats[$d][4]/$max_wait) : 0)."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_talk>0 ? round(1000*$graph_stats[$d][5]/$max_talk) : 0)."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_dispo>0 ? round(1000*$graph_stats[$d][6]/$max_dispo) : 0)."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_pause>0 ? round(1000*$graph_stats[$d][7]/$max_pause) : 0)."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_dead>0 ? round(1000*$graph_stats[$d][8]/$max_dead) : 0)."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
$CUSTOMER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_customer>0 ? round(1000*$graph_stats[$d][9]/$max_customer) : 0)."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
$TALKPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_talkpct>0 ? round(1000*$graph_stats[$d][10]/$max_talkpct) : 0)."' height='16' />".$graph_stats[$d][10]." %</td></tr>";
$DISPOPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_dispopct>0 ? round(1000*$graph_stats[$d][11]/$max_dispopct) : 0)."' height='16' />".$graph_stats[$d][11]." %</td></tr>";
$PAUSEPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_pausepct>0 ? round(1000*$graph_stats[$d][12]/$max_pausepct) : 0)."' height='16' />".$graph_stats[$d][12]." %</td></tr>";
$DEADPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_deadpct>0 ? round(1000*$graph_stats[$d][13]/$max_deadpct) : 0)."' height='16' />".$graph_stats[$d][13]." %</td></tr>";
$WAITPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_waitpct>0 ? round(1000*$graph_stats[$d][14]/$max_waitpct) : 0)."' height='16' />".$graph_stats[$d][14]." %</td></tr>";
$PARKS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_user_holds>0 ? round(1000*$graph_stats[$d][15]/$max_user_holds) : 0)."' height='16' />".$graph_stats[$d][15]."</td></tr>";
$PARKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_total_hold_time>0 ? round(1000*$graph_stats[$d][16]/$max_total_hold_time) : 0)."' height='16' />".sec_convert($graph_stats[$d][16],'HF')."</td></tr>";
$AVGPARK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_avg_hold_time>0 ? round(1000*$graph_stats[$d][17]/$max_avg_hold_time) : 0)."' height='17' />".sec_convert($graph_stats[$d][17],'HF')."</td></tr>";
$PARKSCALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".($max_user_hpc>0 ? round(1000*$graph_stats[$d][18]/$max_user_hpc) : 0)."' height='16' />".$graph_stats[$d][18]."</td></tr>";
$TIMECLOCK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][2], $max_timeclock))."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
$AGENTTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][3], $max_agenttime))."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][4], $max_wait))."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][5], $max_talk))."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][6], $max_dispo))."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][7], $max_pause))."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][8], $max_dead))."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
$CUSTOMER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][9], $max_customer))."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
$TALKPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][10], $max_talkpct))."' height='16' />".$graph_stats[$d][10]." %</td></tr>";
$DISPOPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][11], $max_dispopct))."' height='16' />".$graph_stats[$d][11]." %</td></tr>";
$PAUSEPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][12], $max_pausepct))."' height='16' />".$graph_stats[$d][12]." %</td></tr>";
$DEADPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][13], $max_deadpct))."' height='16' />".$graph_stats[$d][13]." %</td></tr>";
$WAITPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][14], $max_waitpct))."' height='16' />".$graph_stats[$d][14]." %</td></tr>";
$PARKS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][15], $max_user_holds))."' height='16' />".$graph_stats[$d][15]."</td></tr>";
$PARKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][16], $max_total_hold_time))."' height='16' />".sec_convert($graph_stats[$d][16],'HF')."</td></tr>";
$AVGPARK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][17], $max_avg_hold_time))."' height='17' />".sec_convert($graph_stats[$d][17],'HF')."</td></tr>";
$PARKSCALL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats[$d][18], $max_user_hpc))."' height='16' />".$graph_stats[$d][18]."</td></tr>";
for ($e=0; $e<count($sub_statusesARY); $e++)
{
$Sstatus=$sub_statusesARY[$e];
@@ -1300,14 +1238,7 @@ else
$max_varname="max_".$Sstatus;
#$max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
if ($$max_varname > 0)
{
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(1000*$graph_stats_sub[$d][$e]/$$max_varname)."' height='16' />".sec_convert($graph_stats_sub[$d][$e], 'HF')."</td></tr>";
}
else
{
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='1' height='16' />".sec_convert($graph_stats_sub[$d][$e], 'HF')."</td></tr>";
}
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(1000*$graph_stats_sub[$d][$e], $$max_varname))."' height='16' />".sec_convert($graph_stats_sub[$d][$e], 'HF')."</td></tr>";
}
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls)."</th></tr></table>";
@@ -1573,7 +1504,7 @@ while ($m < $k)
else
{
echo " <SPAN class=\"yellow\">";
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
$TOPsortPLOT = ( MathZDC($TOPsortTALLY[$i], $TOPsortMAX) * 110 );
$h=0;
while ($h <= $TOPsortPLOT)
{
+11 -10
View File
@@ -13,6 +13,7 @@
# 130621-0812 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0744 - Changed to mysqli PHP functions
# 140108-0717 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -228,7 +229,7 @@ if ($calls_summary)
$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
$TOTAL_TIME_H = MathZDC($TOTAL_TIME, 3600);
$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
@@ -243,7 +244,7 @@ if ($calls_summary)
$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
$pfTOTAL_TIME_HMS = sprintf("%8s", $TOTAL_TIME_HMS);
$TALK_TIME_H = ($row[1] / 3600);
$TALK_TIME_H = MathZDC($row[1], 3600);
$TALK_TIME_H = round($TALK_TIME_H, 2);
$TALK_TIME_H_int = intval("$TALK_TIME_H");
$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
@@ -258,7 +259,7 @@ if ($calls_summary)
$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
$pfTALK_TIME_HMS = sprintf("%8s", $TALK_TIME_HMS);
$PAUSE_TIME_H = ($row[3] / 3600);
$PAUSE_TIME_H = MathZDC($row[3], 3600);
$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
@@ -273,7 +274,7 @@ if ($calls_summary)
$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
$pfPAUSE_TIME_HMS = sprintf("%8s", $PAUSE_TIME_HMS);
$WAIT_TIME_H = ($row[5] / 3600);
$WAIT_TIME_H = MathZDC($row[5], 3600);
$WAIT_TIME_H = round($WAIT_TIME_H, 2);
$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
@@ -288,7 +289,7 @@ if ($calls_summary)
$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
$pfWAIT_TIME_HMS = sprintf("%8s", $WAIT_TIME_HMS);
$WRAPUP_TIME_H = ($row[7] / 3600);
$WRAPUP_TIME_H = MathZDC($row[7], 3600);
$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
@@ -303,7 +304,7 @@ if ($calls_summary)
$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
$pfWRAPUP_TIME_HMS = sprintf("%8s", $WRAPUP_TIME_HMS);
$TALK_AVG_M = ($row[2] / 60);
$TALK_AVG_M = MathZDC($row[2], 60);
$TALK_AVG_M = round($TALK_AVG_M, 2);
$TALK_AVG_M_int = intval("$TALK_AVG_M");
$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
@@ -313,7 +314,7 @@ if ($calls_summary)
$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
$pfTALK_AVG_MS = sprintf("%6s", $TALK_AVG_MS);
$PAUSE_AVG_M = ($row[4] / 60);
$PAUSE_AVG_M = MathZDC($row[4], 60);
$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
@@ -323,7 +324,7 @@ if ($calls_summary)
$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
$pfPAUSE_AVG_MS = sprintf("%6s", $PAUSE_AVG_MS);
$WAIT_AVG_M = ($row[6] / 60);
$WAIT_AVG_M = MathZDC($row[6], 60);
$WAIT_AVG_M = round($WAIT_AVG_M, 2);
$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
@@ -333,7 +334,7 @@ if ($calls_summary)
$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
$pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS);
$WRAPUP_AVG_M = ($row[8] / 60);
$WRAPUP_AVG_M = MathZDC($row[8], 60);
$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
@@ -376,7 +377,7 @@ echo "LAST LOG ACTIVITY: $row[0]\n";
$end = $row[1];
$login_time = ($end - $start);
$LOGIN_TIME_H = ($login_time / 3600);
$LOGIN_TIME_H = MathZDC($login_time, 3600);
$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
+2 -1
View File
@@ -19,6 +19,7 @@
# 130704-0946 - Fixed issue #675
# 130901-0826 - Changed to mysqli PHP functions
# 140108-0750 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -661,7 +662,7 @@ else
if ($i==0) {$class=" first";} else if (($i+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$GRAPH.=" <tr>\n";
$GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][0]."</th>\n";
$GRAPH.=" <th class=\"thgraph value$class\" scope=\"col\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(200*$graph_stats[$i][1]/$max_time)."\" height=\"16\" />".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."</th>\n";
$GRAPH.=" <th class=\"thgraph value$class\" scope=\"col\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(200*$graph_stats[$i][1], $max_time))."\" height=\"16\" />".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."</th>\n";
$GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][3]."</th>\n";
$GRAPH.=" </tr>\n";
}
@@ -16,6 +16,7 @@
# 130621-2016 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0743 - Changed to mysqli PHP functions
# 140108-0749 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -496,14 +497,14 @@ while($i < $group_ct)
$CSV_text.="\"TOTALS:\",\"$total_calls\",\"".sec_convert($total_duration, 'H')."\",\"".sec_convert($total_handle_time, 'H')."\"\n\n";
$HA_percent = sprintf("%6.2f", 100*($HA_count/$total_calls)); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
$SALE_percent = sprintf("%6.2f", 100*($SALE_count/$total_calls)); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
$DNC_percent = sprintf("%6.2f", 100*($DNC_count/$total_calls)); while(strlen($DNC_percent)>6) {$DNC_percent = substr("$DNC_percent", 0, -1);}
$CC_percent = sprintf("%6.2f", 100*($CC_count/$total_calls)); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);}
$NI_percent = sprintf("%6.2f", 100*($NI_count/$total_calls)); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);}
$UW_percent = sprintf("%6.2f", 100*($UW_count/$total_calls)); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);}
$SC_percent = sprintf("%6.2f", 100*($SC_count/$total_calls)); while(strlen($SC_percent)>6) {$SC_percent = substr("$SC_percent", 0, -1);}
$COMP_percent = sprintf("%6.2f", 100*($COMP_count/$total_calls)); while(strlen($COMP_percent)>6) {$COMP_percent = substr("$COMP_percent", 0, -1);}
$HA_percent = sprintf("%6.2f", MathZDC(100*$HA_count, $total_calls)); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
$SALE_percent = sprintf("%6.2f", MathZDC(100*$SALE_count, $total_calls)); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
$DNC_percent = sprintf("%6.2f", MathZDC(100*$DNC_count, $total_calls)); while(strlen($DNC_percent)>6) {$DNC_percent = substr("$DNC_percent", 0, -1);}
$CC_percent = sprintf("%6.2f", MathZDC(100*$CC_count, $total_calls)); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);}
$NI_percent = sprintf("%6.2f", MathZDC(100*$NI_count, $total_calls)); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);}
$UW_percent = sprintf("%6.2f", MathZDC(100*$UW_count, $total_calls)); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);}
$SC_percent = sprintf("%6.2f", MathZDC(100*$SC_count, $total_calls)); while(strlen($SC_percent)>6) {$SC_percent = substr("$SC_percent", 0, -1);}
$COMP_percent = sprintf("%6.2f", MathZDC(100*$COMP_count, $total_calls)); while(strlen($COMP_percent)>6) {$COMP_percent = substr("$COMP_percent", 0, -1);}
$HA_count = sprintf("%9s", "$HA_count"); while(strlen($HA_count)>9) {$HA_count = substr("$HA_count", 0, -1);}
$SALE_count = sprintf("%9s", "$SALE_count"); while(strlen($SALE_count)>9) {$SALE_count = substr("$SALE_count", 0, -1);}
@@ -538,9 +539,9 @@ while($i < $group_ct)
for ($d=0; $d<count($graph_stats); $d++)
{
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$DURATION_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_duration)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$HANDLETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_handletime)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$DURATION_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_duration))."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
$HANDLETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_handletime))."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($total_calls)."</th></tr></table>";
$DURATION_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".sec_convert($total_duration, 'H')."</th></tr></table>";
+7 -6
View File
@@ -19,6 +19,7 @@
# 130621-0800 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0735 - Changed to mysqli PHP functions
# 140108-0743 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -574,7 +575,7 @@ if ($SUBMIT)
$list_start_inv=0;
GetListCount($list_id, $inventory_ptnstr);
if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";}
$average_calls=sprintf("%.1f", MathZDC($total_calls, $list_start_inv));
$Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"");
if (strlen($inactive_dial_statuses)>1)
{
@@ -591,7 +592,7 @@ if ($SUBMIT)
$full_dialable_SQL="";
$Xdialable_count = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$list_id,$drop_lockout_time,$call_count_limit,$single_status,"$filter_SQL");
if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";}
$penetration=sprintf("%.2f", (MathZDC(100*($list_start_inv-$Xdialable_count), $list_start_inv)));
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
$CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
@@ -735,7 +736,7 @@ if ($SUBMIT)
if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;}
$list_call_inv=0;
GetListCount($list_id, $inventory_ptnstr);
if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";}
$average_calls=sprintf("%.1f", MathZDC($total_calls, $list_start_inv));
### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report
$total_total_calls+=$total_calls;
@@ -758,7 +759,7 @@ if ($SUBMIT)
if ($DB > 0) {echo "FULL DIALABLE SQL: |$full_dialable_SQL|";}
}
if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";}
$penetration=sprintf("%.2f", (MathZDC(100*($list_start_inv-$Xdialable_count), $list_start_inv)));
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
$CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
@@ -864,8 +865,8 @@ if ($SUBMIT)
$rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n";
#### PRINT TOTALS ####
if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";}
if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";}
$total_average_call_count=sprintf("%.1f", MathZDC($total_total_calls, $total_list_start_inv));
$total_penetration=sprintf("%.2f", (MathZDC(100*($total_list_start_inv-$total_dialable_count), $total_list_start_inv)));
$rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |";
$CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\"";
$b=0;
+8 -7
View File
@@ -1,7 +1,7 @@
<?php
# AST_inboundEXTstats.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
@@ -11,6 +11,7 @@
# 130610-1134 - Finalized changing of all ereg instances to preg
# 130621-0745 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0729 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
require("dbconnect_mysqli.php");
@@ -184,7 +185,7 @@ if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt);
$TOTALcalls = sprintf("%10s", $row[0]);
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
@@ -200,12 +201,12 @@ if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt);
$DROPcalls = sprintf("%10s", $row[0]);
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
$DROPpercent = (MathZDC($DROPcalls, $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 0);
if ($row[0])
{
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
}
@@ -237,7 +238,7 @@ while ($i < $users_to_print)
$datetime = sprintf("%-19s", $row[3]);
$USERavgTALK = $row[2];
$USERavgTALK_M = ($USERavgTALK / 60);
$USERavgTALK_M = MathZDC($USERavgTALK, 60);
$USERavgTALK_M = round($USERavgTALK_M, 2);
$USERavgTALK_M_int = intval("$USERavgTALK_M");
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
@@ -330,7 +331,7 @@ if ($output == 'FULL')
$h++;
}
$hour_multiplier = (100 / $hi_hour_count);
$hour_multiplier = MathZDC(100, $hi_hour_count);
#$hour_multiplier = round($hour_multiplier, 0);
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
@@ -344,7 +345,7 @@ if ($output == 'FULL')
if ($Mk >= 5)
{
$Mk=0;
$scale_num=($k / $hour_multiplier);
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$LENscale_num = (strlen($scale_num));
$k = ($k + $LENscale_num);
@@ -1,7 +1,7 @@
<?php
# AST_inboundEXTstats_department.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 70201-1710 - First Build
@@ -9,6 +9,7 @@
# 130610-1134 - Finalized changing of all ereg instances to preg
# 130621-0743 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2028 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
require("dbconnect_mysqli.php");
@@ -211,7 +212,7 @@ else
}
else
{
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
}
@@ -224,7 +225,7 @@ else
}
$calls = sprintf("%10s", $calls);
$seconds = ($seconds / $calls);
$seconds = MathZDC($seconds, $calls);
$seconds = round($seconds, 0);
$seconds = sprintf("%5s", $seconds);
echo "+----------------------+------------+------------+\n";
+270 -517
View File
@@ -19,6 +19,7 @@
# 130902-0730 - Changed to mysqli PHP functions
# 131217-1348 - Fixed several empty variable and array issues
# 140108-0706 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -644,7 +645,7 @@ else
$s++;
}
$dispo_str=substr($dispo_str,0,-1);
asort($status_array);
if ($status_array) {asort($status_array);}
#print_r($status_array);
# if (strlen($dispo_str)>0) {
# }
@@ -1104,139 +1105,69 @@ else
if ($totQUEUEdate[$d] < 1) {$totQUEUEdate[$d]=0;}
if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;}
if ($totDROPSdate[$d] > 0)
{$totDROPSpctDATE[$d] = ( ($totDROPSdate[$d] / $totCALLSdate[$d]) * 100);}
else {$totDROPSpctDATE[$d] = 0;}
$totDROPSpctDATE[$d] = ( MathZDC($totDROPSdate[$d], $totCALLSdate[$d]) * 100);
$totDROPSpctDATE[$d] = round($totDROPSpctDATE[$d], 2);
if ($totQUEUEdate[$d] > 0)
{$totQUEUEpctDATE[$d] = ( ($totQUEUEdate[$d] / $totCALLSdate[$d]) * 100);}
else {$totQUEUEpctDATE[$d] = 0;}
$totQUEUEpctDATE[$d] = ( MathZDC($totQUEUEdate[$d], $totCALLSdate[$d]) * 100);
$totQUEUEpctDATE[$d] = round($totQUEUEpctDATE[$d], 2);
if ($totDROPSsecDATE[$d] > 0)
{$totDROPSavgDATE[$d] = ($totDROPSsecDATE[$d] / $totDROPSdate[$d]);}
else {$totDROPSavgDATE[$d] = 0;}
if ($totQUEUEsecDATE[$d] > 0)
{$totQUEUEavgDATE[$d] = ($totQUEUEsecDATE[$d] / $totQUEUEdate[$d]);}
else {$totQUEUEavgDATE[$d] = 0;}
if ($totQUEUEsecDATE[$d] > 0)
{$totQUEUEtotDATE[$d] = ($totQUEUEsecDATE[$d] / $totCALLSdate[$d]);}
else {$totQUEUEtotDATE[$d] = 0;}
$totDROPSavgDATE[$d] = MathZDC($totDROPSsecDATE[$d], $totDROPSdate[$d]);
$totQUEUEavgDATE[$d] = MathZDC($totQUEUEsecDATE[$d], $totQUEUEdate[$d]);
$totQUEUEtotDATE[$d] = MathZDC($totQUEUEsecDATE[$d], $totCALLSdate[$d]);
if ($totCALLSsecDATE[$d] > 0)
{
$totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]);
$totTIME_M = ($totCALLSsecDATE[$d] / 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
}
else
{
$totCALLSavgDATE[$d] = 0;
$totTIME_MS=' ';
}
$totCALLSavgDATE[$d] = MathZDC($totCALLSsecDATE[$d], $totCALLSdate[$d]);
$totTIME_M = MathZDC($totCALLSsecDATE[$d], 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%8s", $totTIME_MS);
$totCALLSdate[$d] = sprintf("%7s", $totCALLSdate[$d]);
if ($totCALLSdate[$d]>0)
{
$totABANDONSpctDATE[$d] = sprintf("%7.2f", (100*$totABANDONSdate[$d]/$totCALLSdate[$d]));
}
else
{
$totCALLSdate[$d]=" 0";
$totABANDONSpctDATE[$d] = " 0.0";
}
if ($totABANDONSdate[$d]>0)
{
$totABANDONSavgTIME[$d] = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]))));
if (round($totABANDONSsecdate[$d]/$totABANDONSdate[$d])>$max_avgabandontime) {$max_avgabandontime=round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]);}
$graph_stats[$d][11]=round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]);
}
else
{
$totABANDONSdate[$d]="0";
$totABANDONSavgTIME[$d] = " 00:00";
$graph_stats[$d][11]=0;
}
if ($totANSWERSdate[$d]>0)
{
$totANSWERSavgspeedTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]))));
$totANSWERSavgTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]))));
if (round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d])>$max_avganswerspeed) {$max_avganswerspeed=round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]);}
$graph_stats[$d][12]=round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]);
$graph_stats[$d][16]=round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]);
}
else
{
$totANSWERSdate[$d]="0";
$totANSWERSavgspeedTIME[$d] = " 00:00";
$totANSWERSavgTIME[$d] = " 00:00";
$graph_stats[$d][12]=0;
$graph_stats[$d][16]=0;
}
$totANSWERStalkTIME[$d] = sprintf("%10s", floor($totANSWERSsecdate[$d]/3600).date(":i:s", mktime(0, 0, $totANSWERSsecdate[$d])));
$totANSWERSwrapTIME[$d] = sprintf("%10s", floor(($totANSWERSdate[$d]*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSdate[$d]*15))));
$totABANDONSpctDATE[$d] = sprintf("%7.2f", (MathZDC(100*$totABANDONSdate[$d], $totCALLSdate[$d])));
$totABANDONSavgTIME[$d] = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecdate[$d], $totABANDONSdate[$d])))));
if (round(MathZDC($totABANDONSsecdate[$d], $totABANDONSdate[$d]))>$max_avgabandontime) {$max_avgabandontime=round(MathZDC($totABANDONSsecdate[$d], $totABANDONSdate[$d]));}
$graph_stats[$d][11]=round(MathZDC($totABANDONSsecdate[$d], $totABANDONSdate[$d]));
$totANSWERSavgspeedTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeeddate[$d], $totANSWERSdate[$d])))));
$totANSWERSavgTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecdate[$d], $totANSWERSdate[$d])))));
if (round(MathZDC($totANSWERSspeeddate[$d], $totANSWERSdate[$d]))>$max_avganswerspeed) {$max_avganswerspeed=round(MathZDC($totANSWERSspeeddate[$d], $totANSWERSdate[$d]));}
$graph_stats[$d][12]=round(MathZDC($totANSWERSspeeddate[$d], $totANSWERSdate[$d]));
$graph_stats[$d][16]=round(MathZDC($totANSWERSsecdate[$d], $totANSWERSdate[$d]));
$totANSWERStalkTIME[$d] = sprintf("%10s", floor(MathZDC($totANSWERSsecdate[$d], 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecdate[$d])));
$totANSWERSwrapTIME[$d] = sprintf("%10s", floor(MathZDC(($totANSWERSdate[$d]*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSdate[$d]*15))));
if (($totANSWERSdate[$d]*15)>$max_totalwraptime) {$max_totalwraptime=($totANSWERSdate[$d]*15);}
$graph_stats[$d][13]=($totANSWERSdate[$d]*15);
$graph_stats[$d][14]=($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15));
$graph_stats[$d][15]=$totANSWERSsecdate[$d];
$totANSWERStotTIME[$d] = sprintf("%10s", floor(($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15)))));
$totANSWERStotTIME[$d] = sprintf("%10s", floor(MathZDC(($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15)))));
$totANSWERSdate[$d] = sprintf("%8s", $totANSWERSdate[$d]);
$totABANDONSdate[$d] = sprintf("%9s", $totABANDONSdate[$d]);
if (date("w", strtotime($daySTART[$d]))==0 && date("w", strtotime($daySTART[$d-1]))!=0 && $d>0)
{ # 2nd date/"w" check is for DST
$totAGENTSwtd=count(array_count_values($AGENTS_wtd_array));
if ($totCALLSwtd>0)
{
$totABANDONSpctwtd = sprintf("%7.2f", (100*$totABANDONSwtd/$totCALLSwtd));
}
else
{
$totABANDONSpctwtd = " 0.0";
}
if ($totABANDONSwtd>0)
{
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecwtd/$totABANDONSwtd))));
if (round($totABANDONSsecwtd/$totABANDONSwtd)>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round($totABANDONSsecwtd/$totABANDONSwtd);}
$wtd_graph_stats[$wa][11]=round($totABANDONSsecwtd/$totABANDONSwtd);
}
else
{
$totABANDONSavgTIMEwtd = " 00:00";
$wtd_graph_stats[$wa][11]=0;
}
if ($totANSWERSwtd>0)
{
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedwtd/$totANSWERSwtd))));
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecwtd/$totANSWERSwtd))));
if (round($totANSWERSspeedwtd/$totANSWERSwtd)>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round($totANSWERSspeedwtd/$totANSWERSwtd);}
$wtd_graph_stats[$wa][12]=round($totANSWERSspeedwtd/$totANSWERSwtd);
$wtd_graph_stats[$wa][16]=round($totANSWERSsecwtd/$totANSWERSwtd);
}
else
{
$totANSWERSavgspeedTIMEwtd = " 00:00";
$totANSWERSavgTIMEwtd = " 00:00";
$wtd_graph_stats[$wa][12]=0;
$wtd_graph_stats[$wa][16]=0;
}
$totANSWERStalkTIMEwtd = sprintf("%10s", floor($totANSWERSsecwtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(($totANSWERSwtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
$totABANDONSpctwtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSwtd, $totCALLSwtd)));
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd)))));
if (round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd))>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd));}
$wtd_graph_stats[$wa][11]=round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd));
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd)))));
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd)))));
if (round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd))>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd));}
$wtd_graph_stats[$wa][12]=round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd));
$wtd_graph_stats[$wa][16]=round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd));
$totANSWERStalkTIMEwtd = sprintf("%10s", floor(MathZDC($totANSWERSsecwtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(MathZDC(($totANSWERSwtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
if (($totANSWERSwtd*15)>$max_wtd_totalwraptime) {$max_wtd_totalwraptime=($totANSWERSwtd*15);}
$wtd_graph_stats[$wa][13]=($totANSWERSwtd*15);
$wtd_graph_stats[$wa][14]=($totANSWERSsecwtd+($totANSWERSwtd*15));
$wtd_graph_stats[$wa][15]=$totANSWERSsecwtd;
$totANSWERStotTIMEwtd = sprintf("%10s", floor(($totANSWERSsecwtd+($totANSWERSwtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
$totANSWERStotTIMEwtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecwtd+($totANSWERSwtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
# $totAGENTSwtd = sprintf("%8s", $totAGENTSwtd);
$totAGENTSwtd=count(array_count_values($AGENTS_wtd_array));
$totAGENTSwtd = sprintf("%8s", $totAGENTSwtd);
@@ -1250,7 +1181,7 @@ else
if (trim($totABANDONSwtd)>$max_wtd_abandoned) {$max_wtd_abandoned=trim($totABANDONSwtd);}
if (trim($totABANDONSpctwtd)>$max_wtd_abandonpct) {$max_wtd_abandonpct=trim($totABANDONSpctwtd);}
if (round($totANSWERSsecwtd/$totANSWERSwtd)>$max_wtd_avgtalktime) {$max_wtd_avgtalktime=round($totANSWERSsecwtd/$totANSWERSwtd);}
if (round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd))>$max_wtd_avgtalktime) {$max_wtd_avgtalktime=round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd));}
if (trim($totANSWERSsecwtd)>$max_wtd_totaltalktime) {$max_wtd_totaltalktime=trim($totANSWERSsecwtd);}
if (trim($totANSWERSsecwtd+($totANSWERSwtd*15))>$max_wtd_totalcalltime) {$max_wtd_totalcalltime=trim($totANSWERSsecwtd+($totANSWERSwtd*15));}
$week=date("W", strtotime($dayEND[$d-1]));
@@ -1293,47 +1224,22 @@ else
if (date("d", strtotime($daySTART[$d]))==1 && $d>0 && date("d", strtotime($daySTART[$d-1]))!=1)
{
$totAGENTSmtd=count(array_count_values($AGENTS_mtd_array));
if ($totCALLSmtd>0)
{
$totABANDONSpctmtd = sprintf("%7.2f", (100*$totABANDONSmtd/$totCALLSmtd));
}
else
{
$totABANDONSpctmtd = " 0.0";
}
if ($totABANDONSmtd>0)
{
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecmtd/$totABANDONSmtd))));
if (round($totABANDONSsecmtd/$totABANDONSmtd)>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round($totABANDONSsecmtd/$totABANDONSmtd);}
$mtd_graph_stats[$ma][11]=round($totABANDONSsecmtd/$totABANDONSmtd);
}
else
{
$totABANDONSavgTIMEmtd = " 00:00";
$mtd_graph_stats[$ma][11]=0;
}
if ($totANSWERSmtd>0)
{
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedmtd/$totANSWERSmtd))));
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecmtd/$totANSWERSmtd))));
if (round($totANSWERSspeedmtd/$totANSWERSmtd)>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round($totANSWERSspeedmtd/$totANSWERSmtd);}
$mtd_graph_stats[$ma][12]=round($totANSWERSspeedmtd/$totANSWERSmtd);
$mtd_graph_stats[$ma][16]=round($totANSWERSsecmtd/$totANSWERSmtd);
}
else
{
$totANSWERSavgspeedTIMEmtd = " 00:00";
$totANSWERSavgTIMEmtd = " 00:00";
$mtd_graph_stats[$ma][12]=0;
$mtd_graph_stats[$ma][16]=0;
}
$totANSWERStalkTIMEmtd = sprintf("%10s", floor($totANSWERSsecmtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(($totANSWERSmtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
$totABANDONSpctmtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSmtd, $totCALLSmtd)));
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd)))));
if (round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd))>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd));}
$mtd_graph_stats[$ma][11]=round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd));
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd)))));
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd)))));
if (round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd))>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd));}
$mtd_graph_stats[$ma][12]=round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd));
$mtd_graph_stats[$ma][16]=round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd));
$totANSWERStalkTIMEmtd = sprintf("%10s", floor(MathZDC($totANSWERSsecmtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(MathZDC(($totANSWERSmtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
if (($totANSWERSmtd*15)>$max_mtd_totalwraptime) {$max_mtd_totalwraptime=($totANSWERSmtd*15);}
$mtd_graph_stats[$ma][13]=($totANSWERSmtd*15);
$mtd_graph_stats[$ma][14]=($totANSWERSsecmtd+($totANSWERSmtd*15));
$mtd_graph_stats[$ma][15]=$totANSWERSsecmtd;
$totANSWERStotTIMEmtd = sprintf("%10s", floor(($totANSWERSsecmtd+($totANSWERSmtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
$totANSWERStotTIMEmtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecmtd+($totANSWERSmtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
$totAGENTSmtd=count(array_count_values($AGENTS_mtd_array));
$totAGENTSmtd = sprintf("%8s", $totAGENTSmtd);
$totANSWERSmtd = sprintf("%8s", $totANSWERSmtd);
@@ -1345,7 +1251,7 @@ else
if (trim($totABANDONSmtd)>$max_mtd_abandoned) {$max_mtd_abandoned=trim($totABANDONSmtd);}
if (trim($totAGENTSmtd)>$max_mtd_agents) {$max_mtd_agents=trim($totAGENTSmtd);}
if (trim($totABANDONSpctmtd)>$max_mtd_abandonpct) {$max_mtd_abandonpct=trim($totABANDONSpctmtd);}
if (round($totANSWERSsecmtd/$totANSWERSmtd)>$max_mtd_avgtalktime) {$max_mtd_avgtalktime=round($totANSWERSsecmtd/$totANSWERSmtd);}
if (round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd))>$max_mtd_avgtalktime) {$max_mtd_avgtalktime=round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd));}
if (trim($totANSWERSsecmtd)>$max_mtd_totaltalktime) {$max_mtd_totaltalktime=trim($totANSWERSsecmtd);}
if (trim($totANSWERSsecmtd+($totANSWERSmtd*15))>$max_mtd_totalcalltime) {$max_mtd_totalcalltime=trim($totANSWERSsecmtd+($totANSWERSmtd*15));}
$month=date("F", strtotime($dayEND[$d-1]));
@@ -1387,47 +1293,22 @@ else
if (date("m", strtotime($daySTART[$d]))==1 || date("m", strtotime($daySTART[$d]))==4 || date("m", strtotime($daySTART[$d]))==7 || date("m", strtotime($daySTART[$d]))==10) # Quarterly line
{
$totAGENTSqtd=count(array_count_values($AGENTS_qtd_array));
if ($totCALLSqtd>0)
{
$totABANDONSpctqtd = sprintf("%7.2f", (100*$totABANDONSqtd/$totCALLSqtd));
}
else
{
$totABANDONSpctqtd = " 0.0";
}
if ($totABANDONSqtd>0)
{
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecqtd/$totABANDONSqtd))));
if (round($totABANDONSsecqtd/$totABANDONSqtd)>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round($totABANDONSsecqtd/$totABANDONSqtd);}
$qtd_graph_stats[$qa][11]=round($totABANDONSsecqtd/$totABANDONSqtd);
}
else
{
$totABANDONSavgTIMEqtd = " 00:00";
$qtd_graph_stats[$qa][11]=0;
}
if ($totANSWERSqtd>0)
{
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedqtd/$totANSWERSqtd))));
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecqtd/$totANSWERSqtd))));
if (round($totANSWERSspeedqtd/$totANSWERSqtd)>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round($totANSWERSspeedqtd/$totANSWERSqtd);}
$qtd_graph_stats[$qa][12]=round($totANSWERSspeedqtd/$totANSWERSqtd);
$qtd_graph_stats[$qa][16]=round($totANSWERSsecqtd/$totANSWERSqtd);
}
else
{
$totANSWERSavgspeedTIMEqtd = " 00:00";
$totANSWERSavgTIMEqtd = " 00:00";
$qtd_graph_stats[$qa][12]=0;
$qtd_graph_stats[$qa][16]=0;
}
$totANSWERStalkTIMEqtd = sprintf("%10s", floor($totANSWERSsecqtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(($totANSWERSqtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
$totABANDONSpctqtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSqtd, $totCALLSqtd)));
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd)))));
if (round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd))>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd));}
$qtd_graph_stats[$qa][11]=round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd));
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd)))));
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd)))));
if (round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd))>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd));}
$qtd_graph_stats[$qa][12]=round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd));
$qtd_graph_stats[$qa][16]=round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd));
$totANSWERStalkTIMEqtd = sprintf("%10s", floor(MathZDC($totANSWERSsecqtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(MathZDC(($totANSWERSqtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
if (($totANSWERSqtd*15)>$max_qtd_totalwraptime) {$max_qtd_totalwraptime=($totANSWERSqtd*15);}
$qtd_graph_stats[$qa][13]=($totANSWERSqtd*15);
$qtd_graph_stats[$qa][14]=($totANSWERSsecqtd+($totANSWERSqtd*15));
$qtd_graph_stats[$qa][15]=$totANSWERSsecqtd;
$totANSWERStotTIMEqtd = sprintf("%10s", floor(($totANSWERSsecqtd+($totANSWERSqtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
$totANSWERStotTIMEqtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecqtd+($totANSWERSqtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
$totAGENTSqtd=count(array_count_values($AGENTS_qtd_array));
$totAGENTSqtd = sprintf("%8s", $totAGENTSqtd);
$totANSWERSqtd = sprintf("%8s", $totANSWERSqtd);
@@ -1439,7 +1320,7 @@ else
if (trim($totABANDONSqtd)>$max_qtd_abandoned) {$max_qtd_abandoned=trim($totABANDONSqtd);}
if (trim($totAGENTSqtd)>$max_qtd_answers) {$max_qtd_answered=trim($totAGENTSqtd);}
if (trim($totABANDONSpctqtd)>$max_qtd_abandonpct) {$max_qtd_abandonpct=trim($totABANDONSpctqtd);}
if (round($totANSWERSsecqtd/$totANSWERSqtd)>$max_qtd_avgtalktime) {$max_qtd_avgtalktime=round($totANSWERSsecqtd/$totANSWERSqtd);}
if (round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd))>$max_qtd_avgtalktime) {$max_qtd_avgtalktime=round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd));}
if (trim($totANSWERSsecqtd)>$max_qtd_totaltalktime) {$max_qtd_totaltalktime=trim($totANSWERSsecqtd);}
if (trim($totANSWERSsecqtd+($totANSWERSqtd*15))>$max_qtd_totalcalltime) {$max_qtd_totalcalltime=trim($totANSWERSsecqtd+($totANSWERSqtd*15));}
$month=date("m", strtotime($dayEND[$d]));
@@ -1533,8 +1414,8 @@ else
if (trim($totABANDONSdate[$d])>$max_abandoned) {$max_abandoned=trim($totABANDONSdate[$d]);}
if (trim($totABANDONSpctDATE[$d])>$max_abandonpct) {$max_abandonpct=trim($totABANDONSpctDATE[$d]);}
if ( ( ($totANSWERSsecdate[$d] > 0) and ($totANSWERSdate[$d] > 0) ) and (round($totANSWERSsecdate[$d]/$totANSWERSdate[$d])>$max_avgtalktime) )
{$max_avgtalktime=round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]);}
if (round(MathZDC($totANSWERSsecdate[$d], $totANSWERSdate[$d]))>$max_avgtalktime)
{$max_avgtalktime=round(MathZDC($totANSWERSsecdate[$d], $totANSWERSdate[$d]));}
if (trim($totANSWERSsecdate[$d])>$max_totaltalktime) {$max_totaltalktime=trim($totANSWERSsecdate[$d]);}
if (trim($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15))>$max_totalcalltime) {$max_totalcalltime=trim($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15));}
@@ -1566,44 +1447,26 @@ else
$d++;
}
if ($totDROPS > 0)
{$totDROPSpct = ( ($totDROPS / $totCALLS) * 100);}
else {$totDROPSpct = 0;}
$totDROPSpct = ( MathZDC($totDROPS, $totCALLS) * 100);
$totDROPSpct = round($totDROPSpct, 2);
if ($totQUEUE > 0)
{$totQUEUEpct = ( ($totQUEUE / $totCALLS) * 100);}
else {$totQUEUEpct = 0;}
$totQUEUEpct = ( MathZDC($totQUEUE, $totCALLS) * 100);
$totQUEUEpct = round($totQUEUEpct, 2);
if ($totDROPSsec > 0)
{$totDROPSavg = ($totDROPSsec / $totDROPS);}
else {$totDROPSavg = 0;}
if ($totQUEUEsec > 0)
{$totQUEUEavg = ($totQUEUEsec / $totQUEUE);}
else {$totQUEUEavg = 0;}
if ($totQUEUEsec > 0)
{$totQUEUEtot = ($totQUEUEsec / $totCALLS);}
else {$totQUEUEtot = 0;}
$totDROPSavg = MathZDC($totDROPSsec, $totDROPS);
$totQUEUEavg = MathZDC($totQUEUEsec, $totQUEUE);
$totQUEUEtot = MathZDC($totQUEUEsec, $totCALLS);
if ($totCALLSsec > 0)
{
$totCALLSavg = ($totCALLSsec / $totCALLS);
$totCALLSavg = MathZDC($totCALLSsec, $totCALLS);
$totTIME_M = MathZDC($totCALLSsec, 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%9s", $totTIME_MS);
$totTIME_M = ($totCALLSsec / 60);
$totTIME_M_int = round($totTIME_M, 2);
$totTIME_M_int = intval("$totTIME_M");
$totTIME_S = ($totTIME_M - $totTIME_M_int);
$totTIME_S = ($totTIME_S * 60);
$totTIME_S = round($totTIME_S, 0);
if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";}
$totTIME_MS = "$totTIME_M_int:$totTIME_S";
$totTIME_MS = sprintf("%9s", $totTIME_MS);
}
else
{
$totCALLSavg = 0;
$totTIME_MS=' ';
}
$FtotCALLSavg = sprintf("%6.0f", $totCALLSavg);
@@ -1616,82 +1479,34 @@ else
$FtotQUEUE = sprintf("%6s", $totQUEUE);
$FtotCALLS = sprintf("%7s", $totCALLS);
if ($FtotCALLS>0)
{
$FtotABANDONSpct = sprintf("%7.2f", (100*$FtotABANDONS/$FtotCALLS));
}
else
{
$FtotABANDONSpct = " 0.0";
}
if ($FtotABANDONS>0)
{
$FtotABANDONSavgTIME = sprintf("%7s", date("i:s", mktime(0, 0, round($FtotABANDONSsec/$FtotABANDONS))));
}
else
{
$FtotABANDONSavgTIME = sprintf("%7s", "00:00");
}
if ($FtotANSWERS>0)
{
$FtotANSWERSavgspeedTIME = sprintf("%6s", date("i:s", mktime(0, 0, round($FtotANSWERSspeed/$FtotANSWERS))));
$FtotANSWERSavgTIME = sprintf("%6s", date("i:s", mktime(0, 0, round($FtotANSWERSsec/$FtotANSWERS))));
}
else
{
$FtotANSWERSavgspeedTIME = sprintf("%6s", "00:00");
$FtotANSWERSavgTIME = sprintf("%6s", "00:00");
}
$FtotANSWERStalkTIME = sprintf("%10s", floor($FtotANSWERSsec/3600).date(":i:s", mktime(0, 0, $FtotANSWERSsec)));
$FtotANSWERSwrapTIME = sprintf("%10s", floor(($FtotANSWERS*15)/3600).date(":i:s", mktime(0, 0, ($FtotANSWERS*15))));
$FtotANSWERStotTIME = sprintf("%10s", floor(($FtotANSWERSsec+($FtotANSWERS*15))/3600).date(":i:s", mktime(0, 0, ($FtotANSWERSsec+($FtotANSWERS*15)))));
$FtotABANDONSpct = sprintf("%7.2f", (MathZDC(100*$FtotABANDONS, $FtotCALLS)));
$FtotABANDONSavgTIME = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($FtotABANDONSsec, $FtotABANDONS)))));
$FtotANSWERSavgspeedTIME = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($FtotANSWERSspeed, $FtotANSWERS)))));
$FtotANSWERSavgTIME = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($FtotANSWERSsec, $FtotANSWERS)))));
$FtotANSWERStalkTIME = sprintf("%10s", floor(MathZDC($FtotANSWERSsec, 3600)).date(":i:s", mktime(0, 0, $FtotANSWERSsec)));
$FtotANSWERSwrapTIME = sprintf("%10s", floor(MathZDC(($FtotANSWERS*15), 3600)).date(":i:s", mktime(0, 0, ($FtotANSWERS*15))));
$FtotANSWERStotTIME = sprintf("%10s", floor(MathZDC(($FtotANSWERSsec+($FtotANSWERS*15)), 3600)).date(":i:s", mktime(0, 0, ($FtotANSWERSsec+($FtotANSWERS*15)))));
$FtotANSWERS = sprintf("%8s", $FtotANSWERS);
$FtotABANDONS = sprintf("%9s", $FtotABANDONS);
if (date("w", strtotime($daySTART[$d]))>0)
{
$totAGENTSwtd=count(array_count_values($AGENTS_wtd_array));
if ($totCALLSwtd>0)
{
$totABANDONSpctwtd = sprintf("%7.2f", (100*$totABANDONSwtd/$totCALLSwtd));
}
else
{
$totABANDONSpctwtd = " 0.0";
}
if ($totABANDONSwtd>0)
{
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecwtd/$totABANDONSwtd))));
if (round($totABANDONSsecwtd/$totABANDONSwtd)>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round($totABANDONSsecwtd/$totABANDONSwtd);}
$wtd_graph_stats[$wa][11]=round($totABANDONSsecwtd/$totABANDONSwtd);
}
else
{
$totABANDONSavgTIMEwtd = " 00:00";
$wtd_graph_stats[$wa][11]=0;
}
if ($totANSWERSwtd>0)
{
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedwtd/$totANSWERSwtd))));
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecwtd/$totANSWERSwtd))));
if (round($totANSWERSspeedwtd/$totANSWERSwtd)>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round($totANSWERSspeedwtd/$totANSWERSwtd);}
$wtd_graph_stats[$wa][12]=round($totANSWERSspeedwtd/$totANSWERSwtd);
$wtd_graph_stats[$wa][16]=round($totANSWERSsecwtd/$totANSWERSwtd);
}
else
{
$totANSWERSavgspeedTIMEwtd = " 00:00";
$totANSWERSavgTIMEwtd = " 00:00";
$wtd_graph_stats[$wa][12]=0;
$wtd_graph_stats[$wa][16]=0;
}
$totANSWERStalkTIMEwtd = sprintf("%10s", floor($totANSWERSsecwtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(($totANSWERSwtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
$totABANDONSpctwtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSwtd, $totCALLSwtd)));
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd)))));
if (round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd))>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd));}
$wtd_graph_stats[$wa][11]=round(MathZDC($totABANDONSsecwtd, $totABANDONSwtd));
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd)))));
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd)))));
if (round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd))>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd));}
$wtd_graph_stats[$wa][12]=round(MathZDC($totANSWERSspeedwtd, $totANSWERSwtd));
$wtd_graph_stats[$wa][16]=round(MathZDC($totANSWERSsecwtd, $totANSWERSwtd));
$totANSWERStalkTIMEwtd = sprintf("%10s", floor(MathZDC($totANSWERSsecwtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(MathZDC(($totANSWERSwtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
if (($totANSWERSwtd*15)>$max_wtd_totalwraptime) {$max_wtd_totalwraptime=($totANSWERSwtd*15);}
$wtd_graph_stats[$wa][13]=($totANSWERSwtd*15);
$wtd_graph_stats[$wa][14]=($totANSWERSsecwtd+($totANSWERSwtd*15));
$wtd_graph_stats[$wa][15]=$totANSWERSsecwtd;
$totANSWERStotTIMEwtd = sprintf("%10s", floor(($totANSWERSsecwtd+($totANSWERSwtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
$totANSWERStotTIMEwtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecwtd+($totANSWERSwtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
$totAGENTSwtd=count(array_count_values($AGENTS_wtd_array));
$totAGENTSwtd = sprintf("%8s", $totAGENTSwtd);
$totANSWERSwtd = sprintf("%8s", $totANSWERSwtd);
@@ -1735,17 +1550,17 @@ else
$wtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$TOTALCALLTIME_graph);
for ($q=0; $q<count($wtd_graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($wtd_graph_stats)) {$class=" last";} else {$class="";}
$wtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][1]/$max_wtd_offered)."' height='16' />".$wtd_graph_stats[$q][1]."</td></tr>";
$wtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][2]/$max_wtd_answered)."' height='16' />".$wtd_graph_stats[$q][2]."</td></tr>";
$wtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][17]/$max_wtd_agents)."' height='16' />".$wtd_graph_stats[$q][17]."</td></tr>";
$wtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][3]/$max_wtd_abandoned)."' height='16' />".$wtd_graph_stats[$q][3]."</td></tr>";
$wtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][4]/$max_wtd_abandonpct)."' height='16' />".$wtd_graph_stats[$q][4]."% </td></tr>";
$wtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][11]/$max_wtd_avgabandontime)."' height='16' />".$wtd_graph_stats[$q][5]."</td></tr>";
$wtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][12]/$max_wtd_avganswerspeed)."' height='16' />".$wtd_graph_stats[$q][6]."</td></tr>";
$wtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][16]/$max_wtd_avgtalktime)."' height='16' />".$wtd_graph_stats[$q][7]."</td></tr>";
$wtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][15]/$max_wtd_totaltalktime)."' height='16' />".$wtd_graph_stats[$q][8]."</td></tr>";
$wtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][13]/$max_wtd_totalwraptime)."' height='16' />".$wtd_graph_stats[$q][9]."</td></tr>";
$wtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][14]/$max_wtd_totalcalltime)."' height='16' />".$wtd_graph_stats[$q][10]."</td></tr>";
$wtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][1], $max_wtd_offered))."' height='16' />".$wtd_graph_stats[$q][1]."</td></tr>";
$wtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][2], $max_wtd_answered))."' height='16' />".$wtd_graph_stats[$q][2]."</td></tr>";
$wtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][17], $max_wtd_agents))."' height='16' />".$wtd_graph_stats[$q][17]."</td></tr>";
$wtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][3], $max_wtd_abandoned))."' height='16' />".$wtd_graph_stats[$q][3]."</td></tr>";
$wtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][4], $max_wtd_abandonpct))."' height='16' />".$wtd_graph_stats[$q][4]."% </td></tr>";
$wtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][11], $max_wtd_avgabandontime))."' height='16' />".$wtd_graph_stats[$q][5]."</td></tr>";
$wtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][12], $max_wtd_avganswerspeed))."' height='16' />".$wtd_graph_stats[$q][6]."</td></tr>";
$wtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][16], $max_wtd_avgtalktime))."' height='16' />".$wtd_graph_stats[$q][7]."</td></tr>";
$wtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][15], $max_wtd_totaltalktime))."' height='16' />".$wtd_graph_stats[$q][8]."</td></tr>";
$wtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][13], $max_wtd_totalwraptime))."' height='16' />".$wtd_graph_stats[$q][9]."</td></tr>";
$wtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$wtd_graph_stats[$q][14], $max_wtd_totalcalltime))."' height='16' />".$wtd_graph_stats[$q][10]."</td></tr>";
}
$ASCII_text.="$MAINH\n";
@@ -1770,47 +1585,22 @@ else
if (date("d", strtotime($daySTART[$d]))!=1)
{
$totAGENTSmtd=count(array_count_values($AGENTS_mtd_array));
if ($totCALLSmtd>0)
{
$totABANDONSpctmtd = sprintf("%7.2f", (100*$totABANDONSmtd/$totCALLSmtd));
}
else
{
$totABANDONSpctmtd = " 0.0";
}
if ($totABANDONSmtd>0)
{
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecmtd/$totABANDONSmtd))));
if (round($totABANDONSsecmtd/$totABANDONSmtd)>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round($totABANDONSsecmtd/$totABANDONSmtd);}
$mtd_graph_stats[$ma][11]=round($totABANDONSsecmtd/$totABANDONSmtd);
}
else
{
$totABANDONSavgTIMEmtd = " 00:00";
$mtd_graph_stats[$ma][11]=0;
}
if ($totANSWERSmtd>0)
{
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedmtd/$totANSWERSmtd))));
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecmtd/$totANSWERSmtd))));
if (round($totANSWERSspeedmtd/$totANSWERSmtd)>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round($totANSWERSspeedmtd/$totANSWERSmtd);}
$mtd_graph_stats[$ma][12]=round($totANSWERSspeedmtd/$totANSWERSmtd);
$mtd_graph_stats[$ma][16]=round($totANSWERSsecmtd/$totANSWERSmtd);
}
else
{
$totANSWERSavgspeedTIMEmtd = " 00:00";
$totANSWERSavgTIMEmtd = " 00:00";
$mtd_graph_stats[$ma][12]=0;
$mtd_graph_stats[$ma][16]=0;
}
$totANSWERStalkTIMEmtd = sprintf("%10s", floor($totANSWERSsecmtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(($totANSWERSmtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
$totABANDONSpctmtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSmtd, $totCALLSmtd)));
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd)))));
if (round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd))>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd));}
$mtd_graph_stats[$ma][11]=round(MathZDC($totABANDONSsecmtd, $totABANDONSmtd));
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd)))));
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd)))));
if (round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd))>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd));}
$mtd_graph_stats[$ma][12]=round(MathZDC($totANSWERSspeedmtd, $totANSWERSmtd));
$mtd_graph_stats[$ma][16]=round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd));
$totANSWERStalkTIMEmtd = sprintf("%10s", floor(MathZDC($totANSWERSsecmtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(MathZDC(($totANSWERSmtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
if (($totANSWERSmtd*15)>$max_mtd_totalwraptime) {$max_mtd_totalwraptime=($totANSWERSmtd*15);}
$mtd_graph_stats[$ma][13]=($totANSWERSmtd*15);
$mtd_graph_stats[$ma][14]=($totANSWERSsecmtd+($totANSWERSmtd*15));
$mtd_graph_stats[$ma][15]=$totANSWERSsecmtd;
$totANSWERStotTIMEmtd = sprintf("%10s", floor(($totANSWERSsecmtd+($totANSWERSmtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
$totANSWERStotTIMEmtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecmtd+($totANSWERSmtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
$totAGENTSmtd=count(array_count_values($AGENTS_mtd_array));
$totAGENTSmtd = sprintf("%8s", $totAGENTSmtd);
$totANSWERSmtd = sprintf("%8s", $totANSWERSmtd);
@@ -1823,8 +1613,8 @@ else
if (trim($totABANDONSmtd)>$max_mtd_abandoned) {$max_mtd_abandoned=trim($totABANDONSmtd);}
if (trim($totABANDONSpctmtd)>$max_mtd_abandonpct) {$max_mtd_abandonpct=trim($totABANDONSpctmtd);}
if ( ( ($totANSWERSsecmtd > 0) and ($totANSWERSmtd > 0) ) and (round($totANSWERSsecmtd/$totANSWERSmtd)>$max_mtd_avgtalktime) )
{$max_mtd_avgtalktime=round($totANSWERSsecmtd/$totANSWERSmtd);}
if (round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd))>$max_mtd_avgtalktime)
{$max_mtd_avgtalktime=round(MathZDC($totANSWERSsecmtd, $totANSWERSmtd));}
if (trim($totANSWERSsecmtd)>$max_mtd_totaltalktime) {$max_mtd_totaltalktime=trim($totANSWERSsecmtd);}
if (trim($totANSWERSsecmtd+($totANSWERSmtd*15))>$max_mtd_totalcalltime) {$max_mtd_totalcalltime=trim($totANSWERSsecmtd+($totANSWERSmtd*15));}
@@ -1856,17 +1646,17 @@ else
$mtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$TOTALCALLTIME_graph);
for ($q=0; $q<count($mtd_graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($mtd_graph_stats)) {$class=" last";} else {$class="";}
$mtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][1]/$max_mtd_offered)."' height='16' />".$mtd_graph_stats[$q][1]."</td></tr>";
$mtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][2]/$max_mtd_answered)."' height='16' />".$mtd_graph_stats[$q][2]."</td></tr>";
$mtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][17]/$max_mtd_agents)."' height='16' />".$mtd_graph_stats[$q][17]."</td></tr>";
$mtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][3]/$max_mtd_abandoned)."' height='16' />".$mtd_graph_stats[$q][3]."</td></tr>";
$mtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][4]/$max_mtd_abandonpct)."' height='16' />".$mtd_graph_stats[$q][4]."%</td></tr>";
$mtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][11]/$max_mtd_avgabandontime)."' height='16' />".$mtd_graph_stats[$q][5]."</td></tr>";
$mtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][12]/$max_mtd_avganswerspeed)."' height='16' />".$mtd_graph_stats[$q][6]."</td></tr>";
$mtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][16]/$max_mtd_avgtalktime)."' height='16' />".$mtd_graph_stats[$q][7]."</td></tr>";
$mtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][15]/$max_mtd_totaltalktime)."' height='16' />".$mtd_graph_stats[$q][8]."</td></tr>";
$mtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][13]/$max_mtd_totalwraptime)."' height='16' />".$mtd_graph_stats[$q][9]."</td></tr>";
$mtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][14]/$max_mtd_totalcalltime)."' height='16' />".$mtd_graph_stats[$q][10]."</td></tr>";
$mtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][1], $max_mtd_offered))."' height='16' />".$mtd_graph_stats[$q][1]."</td></tr>";
$mtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][2], $max_mtd_answered))."' height='16' />".$mtd_graph_stats[$q][2]."</td></tr>";
$mtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][17], $max_mtd_agents))."' height='16' />".$mtd_graph_stats[$q][17]."</td></tr>";
$mtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][3], $max_mtd_abandoned))."' height='16' />".$mtd_graph_stats[$q][3]."</td></tr>";
$mtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][4], $max_mtd_abandonpct))."' height='16' />".$mtd_graph_stats[$q][4]."%</td></tr>";
$mtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][11], $max_mtd_avgabandontime))."' height='16' />".$mtd_graph_stats[$q][5]."</td></tr>";
$mtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][12], $max_mtd_avganswerspeed))."' height='16' />".$mtd_graph_stats[$q][6]."</td></tr>";
$mtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][16], $max_mtd_avgtalktime))."' height='16' />".$mtd_graph_stats[$q][7]."</td></tr>";
$mtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][15], $max_mtd_totaltalktime))."' height='16' />".$mtd_graph_stats[$q][8]."</td></tr>";
$mtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][13], $max_mtd_totalwraptime))."' height='16' />".$mtd_graph_stats[$q][9]."</td></tr>";
$mtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$mtd_graph_stats[$q][14], $max_mtd_totalcalltime))."' height='16' />".$mtd_graph_stats[$q][10]."</td></tr>";
$graph_totCALLSmtd+=$mtd_graph_stats[$q][1];
$graph_totANSWERSmtd+=$mtd_graph_stats[$q][2];
$graph_totAGENTSmtd+=$mtd_graph_stats[$q][17];
@@ -1901,162 +1691,137 @@ else
# if (date("m", strtotime($daySTART[$d]))==1 || date("m", strtotime($daySTART[$d]))==4 || date("m", strtotime($daySTART[$d]))==7 || date("m", strtotime($daySTART[$d]))==10) # Quarterly line
# {
$totAGENTSqtd=count(array_count_values($AGENTS_qtd_array));
if ($totCALLSqtd>0)
{
$totABANDONSpctqtd = sprintf("%7.2f", (100*$totABANDONSqtd/$totCALLSqtd));
}
else
{
$totABANDONSpctqtd = " 0.0";
}
if ($totABANDONSqtd>0)
{
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecqtd/$totABANDONSqtd))));
if (round($totABANDONSsecqtd/$totABANDONSqtd)>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round($totABANDONSsecqtd/$totABANDONSqtd);}
$qtd_graph_stats[$qa][11]=round($totABANDONSsecqtd/$totABANDONSqtd);
}
else
{
$totABANDONSavgTIMEqtd = " 00:00";
$qtd_graph_stats[$qa][11]=0;
}
if ($totANSWERSqtd>0)
{
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedqtd/$totANSWERSqtd))));
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecqtd/$totANSWERSqtd))));
if (round($totANSWERSspeedqtd/$totANSWERSqtd)>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round($totANSWERSspeedqtd/$totANSWERSqtd);}
$qtd_graph_stats[$qa][12]=round($totANSWERSspeedqtd/$totANSWERSqtd);
$qtd_graph_stats[$qa][16]=round($totANSWERSsecqtd/$totANSWERSqtd);
}
else
{
$totANSWERSavgspeedTIMEqtd = " 00:00";
$totANSWERSavgTIMEqtd = " 00:00";
$qtd_graph_stats[$qa][12]=0;
$qtd_graph_stats[$qa][16]=0;
}
$totANSWERStalkTIMEqtd = sprintf("%10s", floor($totANSWERSsecqtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(($totANSWERSqtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
if (($totANSWERSqtd*15)>$max_qtd_totalwraptime) {$max_qtd_totalwraptime=($totANSWERSqtd*15);}
$qtd_graph_stats[$qa][13]=($totANSWERSqtd*15);
$qtd_graph_stats[$qa][14]=($totANSWERSsecqtd+($totANSWERSqtd*15));
$qtd_graph_stats[$qa][15]=$totANSWERSsecqtd;
$totANSWERStotTIMEqtd = sprintf("%10s", floor(($totANSWERSsecqtd+($totANSWERSqtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
$totAGENTSqtd=count(array_count_values($AGENTS_qtd_array));
$totAGENTSqtd = sprintf("%8s", $totAGENTSqtd);
$totANSWERSqtd = sprintf("%8s", $totANSWERSqtd);
$totABANDONSqtd = sprintf("%9s", $totABANDONSqtd);
$totCALLSqtd = sprintf("%7s", $totCALLSqtd);
$totABANDONSpctqtd = sprintf("%7.2f", (MathZDC(100*$totABANDONSqtd, $totCALLSqtd)));
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd)))));
if (round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd))>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd));}
$qtd_graph_stats[$qa][11]=round(MathZDC($totABANDONSsecqtd, $totABANDONSqtd));
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd)))));
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd)))));
if (round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd))>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd));}
$qtd_graph_stats[$qa][12]=round(MathZDC($totANSWERSspeedqtd, $totANSWERSqtd));
$qtd_graph_stats[$qa][16]=round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd));
$totANSWERStalkTIMEqtd = sprintf("%10s", floor(MathZDC($totANSWERSsecqtd, 3600)).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(MathZDC(($totANSWERSqtd*15), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
if (($totANSWERSqtd*15)>$max_qtd_totalwraptime) {$max_qtd_totalwraptime=($totANSWERSqtd*15);}
$qtd_graph_stats[$qa][13]=($totANSWERSqtd*15);
$qtd_graph_stats[$qa][14]=($totANSWERSsecqtd+($totANSWERSqtd*15));
$qtd_graph_stats[$qa][15]=$totANSWERSsecqtd;
$totANSWERStotTIMEqtd = sprintf("%10s", floor(MathZDC(($totANSWERSsecqtd+($totANSWERSqtd*15)), 3600)).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
$totAGENTSqtd=count(array_count_values($AGENTS_qtd_array));
$totAGENTSqtd = sprintf("%8s", $totAGENTSqtd);
$totANSWERSqtd = sprintf("%8s", $totANSWERSqtd);
$totABANDONSqtd = sprintf("%9s", $totABANDONSqtd);
$totCALLSqtd = sprintf("%7s", $totCALLSqtd);
if (trim($totCALLSqtd)>$max_qtd_offered) {$max_qtd_offered=trim($totCALLSqtd);}
if (trim($totANSWERSqtd)>$max_qtd_answered) {$max_qtd_answered=trim($totANSWERSqtd);}
if (trim($totAGENTSqtd)>$max_qtd_agents) {$max_qtd_agents=trim($totAGENTSqtd);}
if (trim($totABANDONSqtd)>$max_qtd_abandoned) {$max_qtd_abandoned=trim($totABANDONSqtd);}
if (trim($totABANDONSpctqtd)>$max_qtd_abandonpct) {$max_qtd_abandonpct=trim($totABANDONSpctqtd);}
if (trim($totCALLSqtd)>$max_qtd_offered) {$max_qtd_offered=trim($totCALLSqtd);}
if (trim($totANSWERSqtd)>$max_qtd_answered) {$max_qtd_answered=trim($totANSWERSqtd);}
if (trim($totAGENTSqtd)>$max_qtd_agents) {$max_qtd_agents=trim($totAGENTSqtd);}
if (trim($totABANDONSqtd)>$max_qtd_abandoned) {$max_qtd_abandoned=trim($totABANDONSqtd);}
if (trim($totABANDONSpctqtd)>$max_qtd_abandonpct) {$max_qtd_abandonpct=trim($totABANDONSpctqtd);}
if ( ( ($totANSWERSsecqtd > 0) and ($totANSWERSqtd > 0) ) and (round($totANSWERSsecqtd/$totANSWERSqtd)>$max_qtd_avgtalktime) )
{$max_qtd_avgtalktime=round($totANSWERSsecqtd/$totANSWERSqtd);}
if ( (round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd))>$max_qtd_avgtalktime) )
{$max_qtd_avgtalktime=round(MathZDC($totANSWERSsecqtd, $totANSWERSqtd));}
if (trim($totANSWERSsecqtd)>$max_qtd_totaltalktime) {$max_qtd_totaltalktime=trim($totANSWERSsecqtd);}
if (trim($totANSWERSsecqtd+($totANSWERSqtd*15))>$max_qtd_totalcalltime) {$max_qtd_totalcalltime=trim($totANSWERSsecqtd+($totANSWERSqtd*15));}
if (trim($totANSWERSsecqtd)>$max_qtd_totaltalktime) {$max_qtd_totaltalktime=trim($totANSWERSsecqtd);}
if (trim($totANSWERSsecqtd+($totANSWERSqtd*15))>$max_qtd_totalcalltime) {$max_qtd_totalcalltime=trim($totANSWERSsecqtd+($totANSWERSqtd*15));}
$month=date("m", strtotime($dayEND[$d-1]));
$year=substr($dayEND[$d-1], 0, 4);
$qtr1=array(01,02,03);
$qtr2=array(04,05,06);
$qtr3=array(07,08,09);
$qtr4=array(10,11,12);
if(in_array($month,$qtr1)) {
$qtr="1st";
} else if(in_array($month,$qtr2)) {
$qtr="2nd";
} else if(in_array($month,$qtr3)) {
$qtr="3rd";
} else if(in_array($month,$qtr4)) {
$qtr="4th";
}
$qtd_graph_stats[$qa][0]="$qtr quarter, $year";
$qtd_graph_stats[$qa][1]=trim($totCALLSqtd);
$qtd_graph_stats[$qa][2]=trim($totANSWERSqtd);
$qtd_graph_stats[$qa][3]=trim($totABANDONSqtd);
$qtd_graph_stats[$qa][4]=trim($totABANDONSpctqtd);
$qtd_graph_stats[$qa][5]=trim($totABANDONSavgTIMEqtd);
$qtd_graph_stats[$qa][6]=trim($totANSWERSavgspeedTIMEqtd);
$qtd_graph_stats[$qa][7]=trim($totANSWERSavgTIMEqtd);
$qtd_graph_stats[$qa][8]=trim($totANSWERStalkTIMEqtd);
$qtd_graph_stats[$qa][9]=trim($totANSWERSwrapTIMEqtd);
$qtd_graph_stats[$qa][10]=trim($totANSWERStotTIMEqtd);
$qtd_graph_stats[$qa][17]=trim($totAGENTSqtd);
$qtd_OFFERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$OFFERED_graph);
$qtd_ANSWERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ANSWERED_graph);
$qtd_AGENTS_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AGENTS_graph);
$qtd_ABANDONED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONED_graph);
$qtd_ABANDONPCT_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONPCT_graph);
$qtd_AVGABANDONTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGABANDONTIME_graph);
$qtd_AVGANSWERSPEED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGANSWERSPEED_graph);
$qtd_AVGTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGTALKTIME_graph);
$qtd_TOTALTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALTALKTIME_graph);
$qtd_TOTALWRAPTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALWRAPTIME_graph);
$qtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALCALLTIME_graph);
for ($q=0; $q<count($qtd_graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($qtd_graph_stats)) {$class=" last";} else {$class="";}
$qtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][1]/$max_qtd_offered)."' height='16' />".$qtd_graph_stats[$q][1]."</td></tr>";
$qtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][2]/$max_qtd_answered)."' height='16' />".$qtd_graph_stats[$q][2]."</td></tr>";
$qtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][17]/$max_qtd_agents)."' height='16' />".$qtd_graph_stats[$q][17]."</td></tr>";
$qtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][3]/$max_qtd_abandoned)."' height='16' />".$qtd_graph_stats[$q][3]."</td></tr>";
$qtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][4]/$max_qtd_abandonpct)."' height='16' />".$qtd_graph_stats[$q][4]."%</td></tr>";
$qtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][11]/$max_qtd_avgabandontime)."' height='16' />".$qtd_graph_stats[$q][5]."</td></tr>";
$qtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][12]/$max_qtd_avganswerspeed)."' height='16' />".$qtd_graph_stats[$q][6]."</td></tr>";
$qtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][16]/$max_qtd_avgtalktime)."' height='16' />".$qtd_graph_stats[$q][7]."</td></tr>";
$qtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][15]/$max_qtd_totaltalktime)."' height='16' />".$qtd_graph_stats[$q][8]."</td></tr>";
$qtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][13]/$max_qtd_totalwraptime)."' height='16' />".$qtd_graph_stats[$q][9]."</td></tr>";
$qtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][14]/$max_qtd_totalcalltime)."' height='16' />".$qtd_graph_stats[$q][10]."</td></tr>";
$graph_totCALLSqtd+=$qtd_graph_stats[$q][1];
$graph_totANSWERSqtd+=$qtd_graph_stats[$q][2];
$graph_totAGENTSqtd+=$qtd_graph_stats[$q][17];
$graph_totABANDONSqtd+=$qtd_graph_stats[$q][3];
$graph_totABANDONSpctqtd+=$qtd_graph_stats[$q][4];
$graph_totABANDONSavgTIMEqtd+=$qtd_graph_stats[$q][5];
$graph_totANSWERSavgspeedTIMEqtd+=$qtd_graph_stats[$q][6];
$graph_totANSWERSavgTIMEqtd+=$qtd_graph_stats[$q][7];
$graph_totANSWERStalkTIMEqtd+=$qtd_graph_stats[$q][8];
$graph_totANSWERSwrapTIMEqtd+=$qtd_graph_stats[$q][9];
$graph_totANSWERStotTIMEqtd+=$qtd_graph_stats[$q][10];
}
$month=date("m", strtotime($dayEND[$d-1]));
$year=substr($dayEND[$d-1], 0, 4);
$qtr1=array(01,02,03);
$qtr2=array(04,05,06);
$qtr3=array(07,08,09);
$qtr4=array(10,11,12);
if(in_array($month,$qtr1)) {
$qtr="1st";
} else if(in_array($month,$qtr2)) {
$qtr="2nd";
} else if(in_array($month,$qtr3)) {
$qtr="3rd";
} else if(in_array($month,$qtr4)) {
$qtr="4th";
}
$qtd_graph_stats[$qa][0]="$qtr quarter, $year";
$qtd_graph_stats[$qa][1]=trim($totCALLSqtd);
$qtd_graph_stats[$qa][2]=trim($totANSWERSqtd);
$qtd_graph_stats[$qa][3]=trim($totABANDONSqtd);
$qtd_graph_stats[$qa][4]=trim($totABANDONSpctqtd);
$qtd_graph_stats[$qa][5]=trim($totABANDONSavgTIMEqtd);
$qtd_graph_stats[$qa][6]=trim($totANSWERSavgspeedTIMEqtd);
$qtd_graph_stats[$qa][7]=trim($totANSWERSavgTIMEqtd);
$qtd_graph_stats[$qa][8]=trim($totANSWERStalkTIMEqtd);
$qtd_graph_stats[$qa][9]=trim($totANSWERSwrapTIMEqtd);
$qtd_graph_stats[$qa][10]=trim($totANSWERStotTIMEqtd);
$qtd_graph_stats[$qa][17]=trim($totAGENTSqtd);
$qtd_OFFERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$OFFERED_graph);
$qtd_ANSWERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ANSWERED_graph);
$qtd_AGENTS_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AGENTS_graph);
$qtd_ABANDONED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONED_graph);
$qtd_ABANDONPCT_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONPCT_graph);
$qtd_AVGABANDONTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGABANDONTIME_graph);
$qtd_AVGANSWERSPEED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGANSWERSPEED_graph);
$qtd_AVGTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGTALKTIME_graph);
$qtd_TOTALTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALTALKTIME_graph);
$qtd_TOTALWRAPTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALWRAPTIME_graph);
$qtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALCALLTIME_graph);
for ($q=0; $q<count($qtd_graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($qtd_graph_stats)) {$class=" last";} else {$class="";}
$qtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][1], $max_qtd_offered))."' height='16' />".$qtd_graph_stats[$q][1]."</td></tr>";
$qtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][2], $max_qtd_answered))."' height='16' />".$qtd_graph_stats[$q][2]."</td></tr>";
$qtd_AGENTS_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][17], $max_qtd_agents))."' height='16' />".$qtd_graph_stats[$q][17]."</td></tr>";
$qtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][3], $max_qtd_abandoned))."' height='16' />".$qtd_graph_stats[$q][3]."</td></tr>";
$qtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][4], $max_qtd_abandonpct))."' height='16' />".$qtd_graph_stats[$q][4]."%</td></tr>";
$qtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][11], $max_qtd_avgabandontime))."' height='16' />".$qtd_graph_stats[$q][5]."</td></tr>";
$qtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][12], $max_qtd_avganswerspeed))."' height='16' />".$qtd_graph_stats[$q][6]."</td></tr>";
$qtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][16], $max_qtd_avgtalktime))."' height='16' />".$qtd_graph_stats[$q][7]."</td></tr>";
$qtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][15], $max_qtd_totaltalktime))."' height='16' />".$qtd_graph_stats[$q][8]."</td></tr>";
$qtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][13], $max_qtd_totalwraptime))."' height='16' />".$qtd_graph_stats[$q][9]."</td></tr>";
$qtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$qtd_graph_stats[$q][14], $max_qtd_totalcalltime))."' height='16' />".$qtd_graph_stats[$q][10]."</td></tr>";
$graph_totCALLSqtd+=$qtd_graph_stats[$q][1];
$graph_totANSWERSqtd+=$qtd_graph_stats[$q][2];
$graph_totAGENTSqtd+=$qtd_graph_stats[$q][17];
$graph_totABANDONSqtd+=$qtd_graph_stats[$q][3];
$graph_totABANDONSpctqtd+=$qtd_graph_stats[$q][4];
$graph_totABANDONSavgTIMEqtd+=$qtd_graph_stats[$q][5];
$graph_totANSWERSavgspeedTIMEqtd+=$qtd_graph_stats[$q][6];
$graph_totANSWERSavgTIMEqtd+=$qtd_graph_stats[$q][7];
$graph_totANSWERStalkTIMEqtd+=$qtd_graph_stats[$q][8];
$graph_totANSWERSwrapTIMEqtd+=$qtd_graph_stats[$q][9];
$graph_totANSWERStotTIMEqtd+=$qtd_graph_stats[$q][10];
}
$ASCII_text.="$MAINH\n";
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totAGENTSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |";
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totAGENTSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"";
for ($s=0; $s<count($status_array); $s++) {
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
}
$ASCII_text.="\n";
$CSV_text.="\n";
$ASCII_text.="$MAINH\n";
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totAGENTSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |";
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totAGENTSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"";
for ($s=0; $s<count($status_array); $s++) {
$ASCII_text.=" ".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))." |";
$CSV_text.=",\"".sprintf("%10s", ($totSTATUSESqtd[$status_array[$s][0]]+0))."\"";
}
$ASCII_text.="\n";
$CSV_text.="\n";
$totCALLSqtd=0;
$totANSWERSqtd=0;
$AGENTS_qtd_array=array();
$totANSWERSsecqtd=0;
$totANSWERSspeedqtd=0;
$totABANDONSqtd=0;
$totABANDONSsecqtd=0;
$totCALLSqtd=0;
$totANSWERSqtd=0;
$AGENTS_qtd_array=array();
$totANSWERSsecqtd=0;
$totANSWERSspeedqtd=0;
$totABANDONSqtd=0;
$totABANDONSsecqtd=0;
# }
}
for ($q=0; $q<count($graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$OFFERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_offered)."' height='16' />".$graph_stats[$q][1]."</td></tr>";
$ANSWERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][2]/$max_answered)."' height='16' />".$graph_stats[$q][2]."</td></tr>";
$AGENTS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][17]/$max_agents)."' height='16' />".$graph_stats[$q][17]."</td></tr>";
$ABANDONED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][3]/$max_abandoned)."' height='16' />".$graph_stats[$q][3]."</td></tr>";
$ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][4]/$max_abandonpct)."' height='16' />".$graph_stats[$q][4]."%</td></tr>";
$AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][11]/$max_avgabandontime)."' height='16' />".$graph_stats[$q][5]."</td></tr>";
$AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][12]/$max_avganswerspeed)."' height='16' />".$graph_stats[$q][6]."</td></tr>";
$AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][16]/$max_avgtalktime)."' height='16' />".$graph_stats[$q][7]."</td></tr>";
$TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][15]/$max_totaltalktime)."' height='16' />".$graph_stats[$q][8]."</td></tr>";
$TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][13]/$max_totalwraptime)."' height='16' />".$graph_stats[$q][9]."</td></tr>";
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][14]/$max_totalcalltime)."' height='16' />".$graph_stats[$q][10]."</td></tr>";
$OFFERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][1], $max_offered))."' height='16' />".$graph_stats[$q][1]."</td></tr>";
$ANSWERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][2], $max_answered))."' height='16' />".$graph_stats[$q][2]."</td></tr>";
$AGENTS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][17], $max_agents))."' height='16' />".$graph_stats[$q][17]."</td></tr>";
$ABANDONED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][3], $max_abandoned))."' height='16' />".$graph_stats[$q][3]."</td></tr>";
$ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][4], $max_abandonpct))."' height='16' />".$graph_stats[$q][4]."%</td></tr>";
$AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][11], $max_avgabandontime))."' height='16' />".$graph_stats[$q][5]."</td></tr>";
$AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][12], $max_avganswerspeed))."' height='16' />".$graph_stats[$q][6]."</td></tr>";
$AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][16], $max_avgtalktime))."' height='16' />".$graph_stats[$q][7]."</td></tr>";
$TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][15], $max_totaltalktime))."' height='16' />".$graph_stats[$q][8]."</td></tr>";
$TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][13], $max_totalwraptime))."' height='16' />".$graph_stats[$q][9]."</td></tr>";
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$q][14], $max_totalcalltime))."' height='16' />".$graph_stats[$q][10]."</td></tr>";
}
$OFFERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
$ANSWERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERS)."</th></tr></table>";
@@ -2237,15 +2002,9 @@ else
while ($i < $TOTintervals)
{
if ($qrtCALLS[$i] > 0)
{$qrtCALLSavg[$i] = ($qrtCALLSsec[$i] / $qrtCALLS[$i]);}
else {$qrtCALLSavg[$i] = 0;}
if ($qrtDROPS[$i] > 0)
{$qrtDROPSavg[$i] = ($qrtDROPSsec[$i] / $qrtDROPS[$i]);}
else {$qrtDROPSavg[$i] = 0;}
if ($qrtQUEUE[$i] > 0)
{$qrtQUEUEavg[$i] = ($qrtQUEUEsec[$i] / $qrtQUEUE[$i]);}
else {$qrtQUEUEavg[$i] = 0;}
$qrtCALLSavg[$i] = MathZDC($qrtCALLSsec[$i], $qrtCALLS[$i]);
$qrtDROPSavg[$i] = MathZDC($qrtDROPSsec[$i], $qrtDROPS[$i]);
$qrtQUEUEavg[$i] = MathZDC($qrtQUEUEsec[$i], $qrtQUEUE[$i]);
if ($qrtCALLS[$i] > $hi_hour_count) {$hi_hour_count = $qrtCALLS[$i];}
if ($qrtQUEUEavg[$i] > $hi_hold_count) {$hi_hold_count = $qrtQUEUEavg[$i];}
@@ -2271,14 +2030,8 @@ else
$MAIN.=$ASCII_text;
}
if ($hi_hour_count < 1)
{$hour_multiplier = 0;}
else
{$hour_multiplier = (20 / $hi_hour_count);}
if ($hi_hold_count < 1)
{$hold_multiplier = 0;}
else
{$hold_multiplier = (20 / $hi_hold_count);}
$hour_multiplier = MathZDC(20, $hi_hour_count);
$hold_multiplier = MathZDC(20, $hi_hold_count);
$ENDtime = date("U");
@@ -2366,7 +2119,7 @@ function HourDifference($time_BEGIN, $time_END) {
}
$time1 = strtotime($time_BEGIN)+$TBoffset;
$time2 = strtotime($time_END)+1+$TEoffset;
$hpd = ceil(($time2 - $time1) / 3600);
$hpd = ceil(MathZDC(($time2 - $time1), 3600));
if ($hpd<0) {$hpd+=24;}
}
@@ -2412,7 +2165,7 @@ function RecalculateHPD($query_date_BEGIN, $query_date_END, $time_BEGIN, $time_E
}
$time1 = strtotime($time_BEGIN)+$TBoffset;
$time2 = strtotime($time_END)+1+$TEoffset;
$hpd = ceil(($time2 - $time1) / 3600);
$hpd = ceil(MathZDC(($time2 - $time1), 3600));
if ($hpd<0) {$hpd+=24;}
$SQdate_ARY = explode(' ',$query_date_BEGIN);
@@ -2432,7 +2185,7 @@ function RecalculateHPD($query_date_BEGIN, $query_date_END, $time_BEGIN, $time_E
if (!$DURATIONday)
{
$DURATIONsec = ($EQepoch - $SQepoch);
$DURATIONday = intval( ($DURATIONsec / 86400) + 1 );
$DURATIONday = intval( MathZDC($DURATIONsec, 86400) + 1 );
if ( ($EQsec < $SQsec) and ($DURATIONday < 1) )
{
+9 -8
View File
@@ -1,7 +1,7 @@
<?php
# AST_parkstats.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -11,6 +11,7 @@
# 130610-1133 - Finalized changing of all ereg instances to preg
# 130621-0728 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2012 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
require("dbconnect_mysqli.php");
@@ -175,7 +176,7 @@ if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt);
$TOTALcalls = sprintf("%10s", $row[0]);
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
@@ -191,10 +192,10 @@ if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt);
$DROPcalls = sprintf("%10s", $row[0]);
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
$DROPpercent = (MathZDC($DROPcalls, $TOTALcalls) * 100);
$DROPpercent = round($DROPpercent, 0);
$average_hold_seconds = ($row[1] / $row[0]);
$average_hold_seconds = MathZDC($row[1], $row[0]);
$average_hold_seconds = round($average_hold_seconds, 0);
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
@@ -226,7 +227,7 @@ while ($i < $users_to_print)
$USERtotTALK = $row[3];
$USERavgTALK = $row[4];
$USERtotTALK_M = ($USERtotTALK / 60);
$USERtotTALK_M = MathZDC($USERtotTALK, 60);
$USERtotTALK_M = round($USERtotTALK_M, 2);
$USERtotTALK_M_int = intval("$USERtotTALK_M");
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
@@ -236,7 +237,7 @@ while ($i < $users_to_print)
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
$USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS);
$USERavgTALK_M = ($USERavgTALK / 60);
$USERavgTALK_M = MathZDC($USERavgTALK, 60);
$USERavgTALK_M = round($USERavgTALK_M, 2);
$USERavgTALK_M_int = intval("$USERavgTALK_M");
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
@@ -326,7 +327,7 @@ while ($i <= 96)
$h++;
}
$hour_multiplier = (100 / $hi_hour_count);
$hour_multiplier = MathZDC(100, $hi_hour_count);
#$hour_multiplier = round($hour_multiplier, 0);
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
@@ -340,7 +341,7 @@ while ($k <= 102)
if ($Mk >= 5)
{
$Mk=0;
$scale_num=($k / $hour_multiplier);
$scale_num=MathZDC($k, $hour_multiplier);
$scale_num = round($scale_num, 0);
$LENscale_num = (strlen($scale_num));
$k = ($k + $LENscale_num);
+2 -1
View File
@@ -22,6 +22,7 @@
# 130901-2012 - Changed to mysqli PHP functions
# 130926-0658 - Added check for several different ploticus bin paths
# 140108-0716 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -298,7 +299,7 @@ else
$AVGload = sprintf("%10s", $row[0]);
$AVGchannels = sprintf("%10s", $row[1]);
$HIGHload = $row[2];
$HIGHmulti = intval($HIGHload / 100);
$HIGHmulti = intval(MathZDC($HIGHload, 100));
$HIGHchannels = $row[3];
$HIGHprocesses =$row[4];
if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+64 -217
View File
@@ -20,6 +20,7 @@
# 130621-0723 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2011 - Changed to mysqli PHP functions
# 140108-0733 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -769,79 +770,37 @@ if ($SUBMIT=="SUBMIT")
$user_talk_time = sec_convert($talk_time,'H');
$group_talk_time+=$talk_time;
$user_system_time = sec_convert($system_time,'H');
$talk_hours=$talk_time/3600;
$talk_hours=MathZDC($talk_time, 3600);
$group_system_time+=$system_time;
$user_nonpause_time = sec_convert($nonpause_time,'H');
$group_nonpause_time+=$nonpause_time;
if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";}
if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round(MathZDC($sales_talk_time_array[$user], $sale_array[$user])), 'H');} else {$average_sale_time="00:00";}
$group_sales_talk_time+=$sales_talk_time_array[$user];
if ($contacts>0) {$average_contact_time=sec_convert(round($contact_talk_time/$contacts), 'H');} else {$average_contact_time="00:00";}
if ($contacts>0) {$average_contact_time=sec_convert(round(MathZDC($contact_talk_time, $contacts)), 'H');} else {$average_contact_time="00:00";}
$ASCII_text.="| ".sprintf("%-40s", $user_row["full_name"]);
$ASCII_text.=" | <a href='user_stats.php?user=$user&begin_date=$query_date_D&end_date=$end_date_D'>".sprintf("%10s", "$user")."</a>";
$ASCII_text.=" | ".sprintf("%5s", $calls); $group_calls+=$calls;
$ASCII_text.=" | ".sprintf("%5s", $leads); $group_leads+=$leads;
$ASCII_text.=" | ".sprintf("%8s", $contacts); $group_contacts+=$contacts;
if ($leads>0)
{
$contact_ratio=sprintf("%.2f", (100*$contacts/$leads));
}
else
{
$contact_ratio="0.00";
}
$contact_ratio=sprintf("%.2f", MathZDC(100*$contacts,$leads));
$ASCII_text.=" | ".sprintf("%12s", $contact_ratio)."%";
$ASCII_text.=" | ".sprintf("%13s", $user_nonpause_time);
$ASCII_text.=" | ".sprintf("%11s", $user_system_time);
$ASCII_text.=" | ".sprintf("%9s", $user_talk_time);
$ASCII_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user];
if ($nonpause_time>0)
{
$sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600)));
}
else
{
$sales_per_working_hours="0.00";
}
$sales_per_working_hours=sprintf("%.2f", (MathZDC($sale_array[$user], MathZDC($nonpause_time, 3600))));
$ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours);
if ($leads>0)
{
$sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads));
}
else
{
$sales_ratio="0.00";
}
$sales_ratio=sprintf("%.2f", MathZDC(100*$sale_array[$user], $leads));
$ASCII_text.=" | ".sprintf("%19s", $sales_ratio)."%";
if ($contacts>0)
{
$sale_contact_ratio=sprintf("%.2f", (100*$sale_array[$user]/$contacts));
}
else
{
$sale_contact_ratio=0;
}
$sale_contact_ratio=sprintf("%.2f", MathZDC(100*$sale_array[$user], $contacts));
$ASCII_text.=" | ".sprintf("%22s", $sale_contact_ratio)."%";
if ($talk_hours>0)
{
$sales_per_hour=sprintf("%.2f", ($sale_array[$user]/$talk_hours));
}
else
{
$sales_per_hour="0.00";
}
if ( ($calls>0) and ($leads>0) )
{
$stcall=sprintf("%.2f", ($calls/$leads));
}
else
{
$stcall="0.00";
}
$sales_per_hour=sprintf("%.2f", MathZDC($sale_array[$user], $talk_hours));
$stcall=sprintf("%.2f", MathZDC($calls, $leads));
if ($sale_array[$user]>0) {$avg_sale_time=round($sales_talk_time_array[$user]/$sale_array[$user]);} else {$avg_sale_time=0;}
if ($contacts>0) {$avg_contact_time=round($contact_talk_time/$contacts);} else {$avg_contact_time=0;}
$avg_sale_time=round(MathZDC($sales_talk_time_array[$user], $sale_array[$user]));
$avg_contact_time=round(MathZDC($contact_talk_time, $contacts));
$graph_stats[$j][0]=$user_row["full_name"]." - $user";
$graph_stats[$j][1]=trim($calls);
$graph_stats[$j][2]=trim($leads);
@@ -907,23 +866,9 @@ if ($SUBMIT=="SUBMIT")
}
##### GROUP TOTALS #############
if ($group_sales>0)
{
$group_average_sale_time=sec_convert(round($group_sales_talk_time/$group_sales), 'H');
}
else
{
$group_average_sale_time="00:00:00";
}
if ($group_contacts>0)
{
$group_average_contact_time=sec_convert(round($group_contact_talk_time/$group_contacts), 'H');
}
else
{
$group_average_contact_time="00:00:00";
}
$group_talk_hours=$group_talk_time/3600;
$group_average_sale_time=sec_convert(round(MathZDC($group_sales_talk_time, $group_sales)), 'H');
$group_average_contact_time=sec_convert(round(MathZDC($group_contact_talk_time, $group_contacts)), 'H');
$group_talk_hours=MathZDC($group_talk_time, 3600);
$GROUP_text.="| ".sprintf("%40s", "$group_name");
$GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]");
@@ -936,62 +881,20 @@ if ($SUBMIT=="SUBMIT")
$TOTAL_text=" | ".sprintf("%5s", $group_calls);
$TOTAL_text.=" | ".sprintf("%5s", $group_leads);
$TOTAL_text.=" | ".sprintf("%8s", $group_contacts);
if ($group_leads>0)
{
$group_contact_ratio=sprintf("%.2f", (100*$group_contacts/$group_leads));
}
else
{
$group_contact_ratio="0.00";
}
$group_contact_ratio=sprintf("%.2f", MathZDC(100*$group_contacts, $group_leads));
$TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%";
$TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H'));
$TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H'));
$TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H'));
$TOTAL_text.=" | ".sprintf("%5s", $group_sales);
if ($group_nonpause_time>0)
{
$sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600)));
}
else
{
$sales_per_working_hours="0.00";
}
$sales_per_working_hours=sprintf("%.2f", (MathZDC($group_sales, MathZDC($group_nonpause_time, 3600))));
$TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours);
if ($group_leads>0)
{
$group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads));
}
else
{
$group_sales_ratio="0.00";
}
$group_sales_ratio=sprintf("%.2f", MathZDC(100*$group_sales, $group_leads));
$TOTAL_text.=" | ".sprintf("%19s", $group_sales_ratio)."%";
if ($group_contacts>0)
{
$group_sale_contact_ratio=sprintf("%.2f", (100*$group_sales/$group_contacts));
}
else
{
$group_sale_contact_ratio=0;
}
$group_sale_contact_ratio=sprintf("%.2f", MathZDC(100*$group_sales, $group_contacts));
$TOTAL_text.=" | ".sprintf("%22s", $group_sale_contact_ratio)."%";
if ($group_talk_hours>0)
{
$group_sales_per_hour=sprintf("%.2f", ($group_sales/$group_talk_hours));
}
else
{
$group_sales_per_hour="0.00";
}
if ( ($group_calls>0) and ($group_leads>0) )
{
$group_stcall=sprintf("%.2f", ($group_calls/$group_leads));
}
else
{
$group_stcall="0.00";
}
$group_sales_per_hour=sprintf("%.2f", MathZDC($group_sales, $group_talk_hours));
$group_stcall=sprintf("%.2f", MathZDC($group_calls, $group_leads));
$TOTAL_text.=" | ".sprintf("%14s", $group_sales_per_hour);
$TOTAL_text.=" | ".sprintf("%16s", $group_inc_sales);
$TOTAL_text.=" | ".sprintf("%15s", $group_cnc_sales);
@@ -1072,29 +975,29 @@ if ($SUBMIT=="SUBMIT")
for ($d=1; $d<=count($graph_stats); $d++) {
if ($d==1) {$class=" first";} else if ($d==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$LEADS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_leads)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$CONTACTS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_contacts)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$CONTACTRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_contactratio)."' height='16' />".$graph_stats[$d][4]."%</td></tr>";
$SYSTEMTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_systemtime)."' height='16' />".sec_convert($graph_stats[$d][5], 'H')."</td></tr>";
$TALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_talktime)."' height='16' />".sec_convert($graph_stats[$d][6], 'H')."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_sales)."' height='16' />".$graph_stats[$d][7]."</td></tr>";
$SALESLEADSRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_salesleadsratio)."' height='16' />".$graph_stats[$d][8]."%</td></tr>";
$SALESCONTACTSRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_salescontactsratio)."' height='16' />".$graph_stats[$d][9]."%</td></tr>";
$SALESPERHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][10]/$max_salesperhour)."' height='16' />".$graph_stats[$d][10]."</td></tr>";
$INCSALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][11]/$max_incsales)."' height='16' />".$graph_stats[$d][11]."</td></tr>";
$CANCELLEDSALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][12]/$max_cancelledsales)."' height='16' />".$graph_stats[$d][12]."</td></tr>";
$CALLBACKS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][13]/$max_callbacks)."' height='16' />".$graph_stats[$d][13]."</td></tr>";
$FIRSTCALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][14]/$max_firstcall)."' height='16' />".$graph_stats[$d][14]."</td></tr>";
$AVGSALETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][15]/$max_avgsaletime)."' height='16' />".sec_convert($graph_stats[$d][15], 'H')."</td></tr>";
$AVGCONTACTTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][16]/$max_avgcontacttime)."' height='16' />".sec_convert($graph_stats[$d][16], 'H')."</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$LEADS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_leads))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$CONTACTS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_contacts))."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$CONTACTRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_contactratio))."' height='16' />".$graph_stats[$d][4]."%</td></tr>";
$SYSTEMTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_systemtime))."' height='16' />".sec_convert($graph_stats[$d][5], 'H')."</td></tr>";
$TALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_talktime))."' height='16' />".sec_convert($graph_stats[$d][6], 'H')."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][7], $max_sales))."' height='16' />".$graph_stats[$d][7]."</td></tr>";
$SALESLEADSRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][8], $max_salesleadsratio))."' height='16' />".$graph_stats[$d][8]."%</td></tr>";
$SALESCONTACTSRATIO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][9], $max_salescontactsratio))."' height='16' />".$graph_stats[$d][9]."%</td></tr>";
$SALESPERHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][10], $max_salesperhour))."' height='16' />".$graph_stats[$d][10]."</td></tr>";
$INCSALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][11], $max_incsales))."' height='16' />".$graph_stats[$d][11]."</td></tr>";
$CANCELLEDSALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][12], $max_cancelledsales))."' height='16' />".$graph_stats[$d][12]."</td></tr>";
$CALLBACKS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][13], $max_callbacks))."' height='16' />".$graph_stats[$d][13]."</td></tr>";
$FIRSTCALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][14], $max_firstcall))."' height='16' />".$graph_stats[$d][14]."</td></tr>";
$AVGSALETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][15], $max_avgsaletime))."' height='16' />".sec_convert($graph_stats[$d][15], 'H')."</td></tr>";
$AVGCONTACTTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][16], $max_avgcontacttime))."' height='16' />".sec_convert($graph_stats[$d][16], 'H')."</td></tr>";
for ($e=0; $e<count($call_status); $e++) {
$Sstatus=$call_status[$e];
$varname=$Sstatus."_graph";
$max_varname="max_".$Sstatus;
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+17)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+17)]."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][($e+17)], $$max_varname))."' height='16' />".$graph_stats[$d][($e+17)]."</td></tr>";
}
}
@@ -1172,85 +1075,29 @@ if ($SUBMIT=="SUBMIT")
$ASCII_text.=$GROUP_text;
$ASCII_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+$HTMLborderheader\n";
if ($total_sales>0)
{
$total_average_sale_time=sec_convert(round($total_sales_talk_time/$total_sales), 'H');
}
else
{
$total_average_sale_time="00:00:00";
}
if ($total_contacts>0)
{
$total_average_contact_time=sec_convert(round($total_contact_talk_time/$total_contacts), 'H');
}
else
{
$total_average_contact_time="00:00:00";
}
$total_talk_hours=$total_talk_time/3600;
$total_average_sale_time=sec_convert(round(MathZDC($total_sales_talk_time,$total_sales)), 'H');
$total_average_contact_time=sec_convert(round(MathZDC($total_contact_talk_time,$total_contacts)), 'H');
$total_talk_hours=MathZDC($total_talk_time, 3600);
$ASCII_text.="| ".sprintf("%40s", "");
$ASCII_text.=" | ".sprintf("%10s", "TOTALS:");
$ASCII_text.=" | ".sprintf("%5s", $total_calls);
$ASCII_text.=" | ".sprintf("%5s", $total_leads);
$ASCII_text.=" | ".sprintf("%8s", $total_contacts);
if ($total_leads>0)
{
$total_contact_ratio=sprintf("%.2f", (100*$total_contacts/$total_leads));
}
else
{
$total_contact_ratio="0.00";
}
$total_contact_ratio=sprintf("%.2f", MathZDC(100*$total_contacts, $total_leads));
$ASCII_text.=" | ".sprintf("%12s", $total_contact_ratio)."%";
$ASCII_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H'));
$ASCII_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H'));
$ASCII_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H'));
$ASCII_text.=" | ".sprintf("%5s", $total_sales);
if ($total_nonpause_time>0)
{
$sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600)));
}
else
{
$sales_per_working_hours="0.00";
}
$sales_per_working_hours=sprintf("%.2f", MathZDC($total_sales, MathZDC($total_nonpause_time, 3600)));
$ASCII_text.=" | ".sprintf("%22s", $sales_per_working_hours);
if ($total_leads>0)
{
$total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads));
}
else
{
$total_sales_ratio="0.00";
}
$total_sales_ratio=sprintf("%.2f", MathZDC(100*$total_sales, $total_leads));
$ASCII_text.=" | ".sprintf("%19s", $total_sales_ratio)."%";
if ($total_contacts>0)
{
$total_sale_contact_ratio=sprintf("%.2f", (100*$total_sales/$total_contacts));
}
else
{
$total_sale_contact_ratio=0;
}
$total_sale_contact_ratio=sprintf("%.2f", MathZDC(100*$total_sales, $total_contacts));
$ASCII_text.=" | ".sprintf("%22s", $total_sale_contact_ratio)."%";
if ($total_talk_hours>0)
{
$total_sales_per_hour=sprintf("%.2f", ($total_sales/$total_talk_hours));
}
else
{
$total_sales_per_hour="0.00";
}
if ( ($total_calls>0) and ($total_leads>0) )
{
$total_stcall=sprintf("%.2f", ($total_calls/$total_leads));
}
else
{
$total_stcall="0.00";
}
$total_sales_per_hour=sprintf("%.2f", MathZDC($total_sales, $total_talk_hours));
$total_stcall=sprintf("%.2f", MathZDC($total_calls, $total_leads));
$ASCII_text.=" | ".sprintf("%14s", $total_sales_per_hour);
$ASCII_text.=" | ".sprintf("%16s", $total_inc_sales);
$ASCII_text.=" | ".sprintf("%15s", $total_cnc_sales);
@@ -1278,22 +1125,22 @@ if ($SUBMIT=="SUBMIT")
$CSV_text.="\"\",\"\",\"TOTALS:\",\"$total_calls\",\"$total_leads\",\"$total_contacts\",\"$total_contact_ratio %\",\"".sec_convert($total_nonpause_time,'H')."\",\"".sec_convert($total_system_time,'H')."\",\"".sec_convert($total_talk_time,'H')."\",\"$total_sales\",\"$sales_per_working_hours\",\"$total_sales_ratio\",\"$total_sale_contact_ratio\",\"$total_sales_per_hour\",\"$total_inc_sales\",\"$total_cnc_sales\",\"$total_callbacks\",\"$total_stcall\",\"$total_average_sale_time\",\"$total_average_contact_time\"$CSV_status_text\n";
for ($d=0; $d<count($total_graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($total_graph_stats)) {$class=" last";} else {$class="";}
$TOTALCALLS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][1]/$max_totalcalls)."' height='16' />".$total_graph_stats[$d][1]."</td></tr>";
$TOTALLEADS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][2]/$max_totalleads)."' height='16' />".$total_graph_stats[$d][2]."</td></tr>";
$TOTALCONTACTS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][3]/$max_totalcontacts)."' height='16' />".$total_graph_stats[$d][3]."</td></tr>";
$TOTALCONTACTRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][4]/$max_totalcontactratio)."' height='16' />".$total_graph_stats[$d][4]."%</td></tr>";
$TOTALSYSTEMTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][5]/$max_totalsystemtime)."' height='16' />".sec_convert($total_graph_stats[$d][5], 'H')."</td></tr>";
$TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][6]/$max_totaltalktime)."' height='16' />".sec_convert($total_graph_stats[$d][6], 'H')."</td></tr>";
$TOTALSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][7]/$max_totalsales)."' height='16' />".$total_graph_stats[$d][7]."</td></tr>";
$TOTALSALESLEADSRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][8]/$max_totalsalesleadsratio)."' height='16' />".$total_graph_stats[$d][8]."%</td></tr>";
$TOTALSALESCONTACTSRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][9]/$max_totalsalescontactsratio)."' height='16' />".$total_graph_stats[$d][9]."%</td></tr>";
$TOTALSALESPERHOUR_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][10]/$max_totalsalesperhour)."' height='16' />".$total_graph_stats[$d][10]."</td></tr>";
$TOTALINCSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][11]/$max_totalincsales)."' height='16' />".$total_graph_stats[$d][11]."</td></tr>";
$TOTALCANCELLEDSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][12]/$max_totalcancelledsales)."' height='16' />".$total_graph_stats[$d][12]."</td></tr>";
$TOTALCALLBACKS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][13]/$max_totalcallbacks)."' height='16' />".$total_graph_stats[$d][13]."</td></tr>";
$TOTALFIRSTCALLS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][14]/$max_totalfirstcall)."' height='16' />".$total_graph_stats[$d][14]."</td></tr>";
$TOTALAVGSALETIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][15]/$max_totalavgsaletime)."' height='16' />".sec_convert($total_graph_stats[$d][15], 'H')."</td></tr>";
$TOTALAVGCONTACTTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][16]/$max_totalavgcontacttime)."' height='16' />".sec_convert($total_graph_stats[$d][16], 'H')."</td></tr>";
$TOTALCALLS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][1], $max_totalcalls))."' height='16' />".$total_graph_stats[$d][1]."</td></tr>";
$TOTALLEADS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][2], $max_totalleads))."' height='16' />".$total_graph_stats[$d][2]."</td></tr>";
$TOTALCONTACTS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][3], $max_totalcontacts))."' height='16' />".$total_graph_stats[$d][3]."</td></tr>";
$TOTALCONTACTRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][4], $max_totalcontactratio))."' height='16' />".$total_graph_stats[$d][4]."%</td></tr>";
$TOTALSYSTEMTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][5], $max_totalsystemtime))."' height='16' />".sec_convert($total_graph_stats[$d][5], 'H')."</td></tr>";
$TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][6], $max_totaltalktime))."' height='16' />".sec_convert($total_graph_stats[$d][6], 'H')."</td></tr>";
$TOTALSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][7], $max_totalsales))."' height='16' />".$total_graph_stats[$d][7]."</td></tr>";
$TOTALSALESLEADSRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][8], $max_totalsalesleadsratio))."' height='16' />".$total_graph_stats[$d][8]."%</td></tr>";
$TOTALSALESCONTACTSRATIO_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][9], $max_totalsalescontactsratio))."' height='16' />".$total_graph_stats[$d][9]."%</td></tr>";
$TOTALSALESPERHOUR_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][10], $max_totalsalesperhour))."' height='16' />".$total_graph_stats[$d][10]."</td></tr>";
$TOTALINCSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][11], $max_totalincsales))."' height='16' />".$total_graph_stats[$d][11]."</td></tr>";
$TOTALCANCELLEDSALES_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][12], $max_totalcancelledsales))."' height='16' />".$total_graph_stats[$d][12]."</td></tr>";
$TOTALCALLBACKS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][13], $max_totalcallbacks))."' height='16' />".$total_graph_stats[$d][13]."</td></tr>";
$TOTALFIRSTCALLS_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][14], $max_totalfirstcall))."' height='16' />".$total_graph_stats[$d][14]."</td></tr>";
$TOTALAVGSALETIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][15], $max_totalavgsaletime))."' height='16' />".sec_convert($total_graph_stats[$d][15], 'H')."</td></tr>";
$TOTALAVGCONTACTTIME_graph.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][16], $max_totalavgcontacttime))."' height='16' />".sec_convert($total_graph_stats[$d][16], 'H')."</td></tr>";
for ($e=0; $e<count($call_status); $e++) {
$Sstatus=$call_status[$e];
@@ -1301,7 +1148,7 @@ if ($SUBMIT=="SUBMIT")
$max_varname="max_total".$Sstatus;
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
$$varname.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$total_graph_stats[$d][($e+17)]/$$max_varname)."' height='16' />".$total_graph_stats[$d][($e+17)]."</td></tr>";
$$varname.=" <tr><td class='chart_td$class'>".$total_graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$total_graph_stats[$d][($e+17)], $$max_varname))."' height='16' />".$total_graph_stats[$d][($e+17)]."</td></tr>";
}
}
+66 -170
View File
@@ -85,10 +85,11 @@
# 130901-2008 - Changed to mysqli PHP functions
# 131120-1543 - Fixed small display bug when customer phone view is enabled
# 140213-1705 - Fixed division by zero bug
# 140328-0006 - Converted division calculations to use MathZDC function
#
$version = '2.8-74';
$build = '140213-1705';
$version = '2.8-75';
$build = '140328-0006';
header ("Content-type: text/html; charset=utf-8");
@@ -254,7 +255,7 @@ function get_server_load($windows = false)
$i++;
}
$cpuload = round($cpuload / $i, 2);
$cpuload = round(MathZDC($cpuload, $i), 2);
return "$cpuload%";
}
else
@@ -1192,57 +1193,27 @@ if ( ($ALLINGROUPstats > 0) or ( (preg_match('/O/',$with_inbound)) and ($adastat
$hold_sec_drop_calls = $row[14];
$hold_sec_queue_calls = $row[15];
$ingroupdetail = $row[16];
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
$drpctTODAY = ( MathZDC($dropsTODAY, $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
if ($callsTODAY > 0)
{
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
}
else
{$AVGhold_sec_queue_calls=0;}
$AVGhold_sec_queue_calls = MathZDC($hold_sec_queue_calls, $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
if ($dropsTODAY > 0)
{
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
}
else
{$AVGhold_sec_drop_calls=0;}
$AVGhold_sec_drop_calls = MathZDC($hold_sec_drop_calls, $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
if ($answersTODAY > 0)
{
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
if ($agent_non_pause_sec > 0)
{
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
}
else
{$AVG_ANSWERagent_non_pause_sec=0;}
}
else
{
$PCThold_sec_stat_one=0;
$PCThold_sec_stat_two=0;
$AVGhold_sec_answer_calls=0;
$AVG_ANSWERagent_non_pause_sec=0;
}
$PCThold_sec_stat_one = ( MathZDC($hold_sec_stat_one, $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( MathZDC($hold_sec_stat_two, $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = MathZDC($hold_sec_answer_calls, $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
$AVG_ANSWERagent_non_pause_sec = (MathZDC($answersTODAY, $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
if (preg_match('/0$|2$|4$|6$|8$/',$r)) {$bgcolor='#E6E6E6';}
else {$bgcolor='white';}
@@ -1301,14 +1272,9 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) )
$callsTODAY = $row[0];
$dropsTODAY = $row[1];
$answersTODAY = $row[2];
if ( ($dropsTODAY > 0) and ($callsTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $callsTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
$drpctTODAY = ( MathZDC($dropsTODAY, $callsTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
$DROPINGROUPstatsHTML .= "<TR BGCOLOR=\"#E6E6E6\">";
$DROPINGROUPstatsHTML .= "<TD ALIGN=RIGHT COLSPAN=2><font size=2><B>DROP IN-GROUP STATS -</B></TD>";
@@ -1460,23 +1426,12 @@ if ($CARRIERstats > 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;}
if ( ($TFhour_count[$print_ctp] < 1) or ($TFhour_total < 1) ) {$TFhour_pct=0;}
else {$TFhour_pct = (100*($TFhour_count[$print_ctp]/$TFhour_total));}
if ( ($SIXhour_count[$print_ctp] < 1) or ($SIXhour_total < 1) ) {$SIXhour_pct=0;}
else {$SIXhour_pct = (100*($SIXhour_count[$print_ctp]/$SIXhour_total));}
if ( ($ONEhour_count[$print_ctp] < 1) or ($ONEhour_total < 1) ) {$ONEhour_pct=0;}
else {$ONEhour_pct = (100*($ONEhour_count[$print_ctp]/$ONEhour_total));}
if ( ($FTminute_count[$print_ctp] < 1) or ($FTminute_total < 1) ) {$TFminute_pct=0;}
else {$TFminute_pct = (100*($FTminute_count[$print_ctp]/$FTminute_total));}
if ( ($FIVEminute_count[$print_ctp] < 1) or ($FIVEminute_total < 1) ) {$FIVEminute_pct=0;}
else {$FIVEminute_pct = (100*($FIVEminute_count[$print_ctp]/$FIVEminute_total));}
if ( ($ONEminute_count[$print_ctp] < 1) or ($ONEminute_total < 1) ) {$ONEminute_pct=0;}
else {$ONEminute_pct = (100*($ONEminute_count[$print_ctp]/$ONEminute_total));}
$TFhour_pct = (100*MathZDC($TFhour_count[$print_ctp], $TFhour_total));
$SIXhour_pct = (100*MathZDC($SIXhour_count[$print_ctp], $SIXhour_total));
$ONEhour_pct = (100*MathZDC($ONEhour_count[$print_ctp], $ONEhour_total));
$TFminute_pct = (100*MathZDC($FTminute_count[$print_ctp], $FTminute_total));
$FIVEminute_pct = (100*MathZDC($FIVEminute_count[$print_ctp], $FIVEminute_total));
$ONEminute_pct = (100*MathZDC($ONEminute_count[$print_ctp], $ONEminute_total));
$CARRIERstatsHTML .= "<TR>";
$CARRIERstatsHTML .= "<TD BGCOLOR=white><font size=2>&nbsp;</TD>";
@@ -1594,57 +1549,27 @@ if (preg_match('/O/',$with_inbound))
$hold_sec_answer_calls = $row[13];
$hold_sec_drop_calls = $row[14];
$hold_sec_queue_calls = $row[15];
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
$drpctTODAY = ( MathZDC($dropsTODAY, $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
if ($callsTODAY > 0)
{
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
}
else
{$AVGhold_sec_queue_calls=0;}
$AVGhold_sec_queue_calls = MathZDC($hold_sec_queue_calls, $callsTODAY);
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
if ($dropsTODAY > 0)
{
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
}
else
{$AVGhold_sec_drop_calls=0;}
$AVGhold_sec_drop_calls = MathZDC($hold_sec_drop_calls, $dropsTODAY);
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
if ($answersTODAY > 0)
{
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
if ($agent_non_pause_sec > 0)
{
$AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
}
else
{$AVG_ANSWERagent_non_pause_sec=0;}
}
else
{
$PCThold_sec_stat_one=0;
$PCThold_sec_stat_two=0;
$AVGhold_sec_answer_calls=0;
$AVG_ANSWERagent_non_pause_sec=0;
}
$PCThold_sec_stat_one = ( MathZDC($hold_sec_stat_one, $answersTODAY) * 100);
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
$PCThold_sec_stat_two = ( MathZDC($hold_sec_stat_two, $answersTODAY) * 100);
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
$AVGhold_sec_answer_calls = MathZDC($hold_sec_answer_calls, $answersTODAY);
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
$AVG_ANSWERagent_non_pause_sec = (MathZDC($answersTODAY, $agent_non_pause_sec) * 60);
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2>&nbsp; $callsTODAY&nbsp; &nbsp; </TD>";
@@ -1764,14 +1689,9 @@ else
$answersTODAY = $row[7];
if ($multi_drop > 0)
{
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
{
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
else
{$drpctTODAY=0;}
$drpctTODAY = ( MathZDC($dropsTODAY, $answersTODAY) * 100);
$drpctTODAY = round($drpctTODAY, 2);
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
}
$VSCcat1 = $row[8];
$VSCcat1tally = $row[9];
@@ -1787,12 +1707,8 @@ else
$VSCagentacw = $row[19];
$VSCagentpause = $row[20];
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
{
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
}
else {$diffpctONEMIN = '0.00';}
$diffpctONEMIN = ( MathZDC($diffONEMIN, $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats $group_SQLwhere;";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -1880,41 +1796,21 @@ else
if ($AGENTtimeSTATS>0)
{
if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) )
{
$avgpauseTODAY = ($VSCagentpause / $VSCagentcalls);
$avgpauseTODAY = round($avgpauseTODAY, 0);
$avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY);
}
else
{$avgpauseTODAY=0;}
$avgpauseTODAY = MathZDC($VSCagentpause, $VSCagentcalls);
$avgpauseTODAY = round($avgpauseTODAY, 0);
$avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) )
{
$avgwaitTODAY = ($VSCagentwait / $VSCagentcalls);
$avgwaitTODAY = round($avgwaitTODAY, 0);
$avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY);
}
else
{$avgwaitTODAY=0;}
$avgwaitTODAY = MathZDC($VSCagentwait, $VSCagentcalls);
$avgwaitTODAY = round($avgwaitTODAY, 0);
$avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) )
{
$avgcustTODAY = ($VSCagentcust / $VSCagentcalls);
$avgcustTODAY = round($avgcustTODAY, 0);
$avgcustTODAY = sprintf("%01.0f", $avgcustTODAY);
}
else
{$avgcustTODAY=0;}
$avgcustTODAY = MathZDC($VSCagentcust, $VSCagentcalls);
$avgcustTODAY = round($avgcustTODAY, 0);
$avgcustTODAY = sprintf("%01.0f", $avgcustTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) )
{
$avgacwTODAY = ($VSCagentacw / $VSCagentcalls);
$avgacwTODAY = round($avgacwTODAY, 0);
$avgacwTODAY = sprintf("%01.0f", $avgacwTODAY);
}
else
{$avgacwTODAY=0;}
$avgacwTODAY = MathZDC($VSCagentacw, $VSCagentcalls);
$avgacwTODAY = round($avgacwTODAY, 0);
$avgacwTODAY = sprintf("%01.0f", $avgacwTODAY);
echo "<TR>";
echo "<TD ALIGN=RIGHT><font size=2><B>AGENT AVG WAIT:</B></TD><TD ALIGN=LEFT><font size=2>&nbsp; $avgwaitTODAY &nbsp;</TD>";
+6 -9
View File
@@ -1,7 +1,7 @@
<?php
# AST_timeonVDADallREC.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# live real-time stats for the VICIDIAL Auto-Dialer all servers
#
@@ -30,6 +30,7 @@
# 130610-1126 - Finalized changing of all ereg instances to preg
# 130620-2300 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2007 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
header ("Content-type: text/html; charset=utf-8");
@@ -108,7 +109,7 @@ $cpuload += $cpu->LoadPercentage;
$i++;
}
$cpuload = round($cpuload / $i, 2);
$cpuload = round(MathZDC($cpuload, $i), 2);
return "$cpuload%";
}
else {
@@ -468,12 +469,8 @@ $diffONEMIN = $row[4];
$agentsONEMIN = $row[5];
$balanceFILL = $row[6];
$answersTODAY = $row[7];
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
{
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
}
else {$diffpctONEMIN = '0.00';}
$diffpctONEMIN = (MathZDC($diffONEMIN, $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysqli_real_escape_string($link, $group) . "';";
if ($group=='XXXX-ALL-ACTIVE-XXXX')
@@ -839,7 +836,7 @@ $talking_to_print = mysqli_num_rows($rslt);
else
{$call_time_S = ($STARTtime - $row[5]);}
$call_time_M = ($call_time_S / 60);
$call_time_M = MathZDC($call_time_S, 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
+17 -40
View File
@@ -1,7 +1,7 @@
<?php
# AST_timeonVDADallSUMMARY.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
#
@@ -26,6 +26,7 @@
# 130610-1120 - Finalized changing of all ereg instances to preg
# 130620-2256 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-2006 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
require("dbconnect_mysqli.php");
@@ -341,12 +342,8 @@ $VSCagentcust = $row[18];
$VSCagentacw = $row[19];
$VSCagentpause = $row[20];
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
{
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
}
else {$diffpctONEMIN = '0.00';}
$diffpctONEMIN = ( MathZDC($diffONEMIN, $agentsONEMIN) * 100);
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysqli_real_escape_string($link, $group) . "';";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -426,41 +423,21 @@ $CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$V
if ($VSCagentcalls > 0)
{
if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) )
{
$avgpauseTODAY = ($VSCagentpause / $VSCagentcalls);
$avgpauseTODAY = round($avgpauseTODAY, 0);
$avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY);
}
else
{$avgpauseTODAY=0;}
$avgpauseTODAY = MathZDC($VSCagentpause, $VSCagentcalls);
$avgpauseTODAY = round($avgpauseTODAY, 0);
$avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) )
{
$avgwaitTODAY = ($VSCagentwait / $VSCagentcalls);
$avgwaitTODAY = round($avgwaitTODAY, 0);
$avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY);
}
else
{$avgwaitTODAY=0;}
$avgwaitTODAY = MathZDC($VSCagentwait, $VSCagentcalls);
$avgwaitTODAY = round($avgwaitTODAY, 0);
$avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) )
{
$avgcustTODAY = ($VSCagentcust / $VSCagentcalls);
$avgcustTODAY = round($avgcustTODAY, 0);
$avgcustTODAY = sprintf("%01.0f", $avgcustTODAY);
}
else
{$avgcustTODAY=0;}
$avgcustTODAY = MathZDC($VSCagentcust, $VSCagentcalls);
$avgcustTODAY = round($avgcustTODAY, 0);
$avgcustTODAY = sprintf("%01.0f", $avgcustTODAY);
if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) )
{
$avgacwTODAY = ($VSCagentacw / $VSCagentcalls);
$avgacwTODAY = round($avgacwTODAY, 0);
$avgacwTODAY = sprintf("%01.0f", $avgacwTODAY);
}
else
{$avgacwTODAY=0;}
$avgacwTODAY = MathZDC($VSCagentacw, $VSCagentcalls);
$avgacwTODAY = round($avgacwTODAY, 0);
$avgacwTODAY = sprintf("%01.0f", $avgacwTODAY);
$MAIN.="<TR>";
$MAIN.="<TD ALIGN=RIGHT><font size=2><B>AGENT AVG WAIT:</B></TD><TD ALIGN=LEFT><font size=2>&nbsp; $avgwaitTODAY &nbsp;</TD>";
@@ -593,7 +570,7 @@ $talking_to_print = mysqli_num_rows($rslt);
else
{$call_time_S = ($STARTtime - $row[5]);}
$call_time_M = ($call_time_S / 60);
$call_time_M = MathZDC($call_time_S, 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
+4 -3
View File
@@ -54,10 +54,11 @@
# 130802-0619 - Added status deduping option without template
# 130824-2322 - Changed to mysqli PHP functions
# 140214-1022 - Fixed status dedupe bug
# 140328-0007 - Converted division calculations to use MathZDC function
#
$version = '2.8-52';
$build = '140214-1022';
$version = '2.8-53';
$build = '140328-0007';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -314,7 +315,7 @@ else
$SERVER_GMT = date("O");
$SERVER_GMT = preg_replace('/\+/i', '',$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
$SERVER_GMT = MathZDC($SERVER_GMT, 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
+25 -34
View File
@@ -26,6 +26,7 @@
# 130619-2339 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-1930 - Changed to mysqli PHP functions
# 140108-0725 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -328,7 +329,7 @@ $HTML_text.="<option value=\"ALL\">ALL</option>\n";
$HTML_text.="</SELECT>\n";
$HTML_text.="<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
$HTML_text.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?query_date=$query_date&group=$group&shift=$shift&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a><BR/>Display as:<BR><input type='radio' name='report_display_type' value='ASCII' checked>ASCII<BR/><input type='radio' name='report_display_type' value='HTML' >HTML<BR/></FONT>\n";
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"$PHP_SELF?query_date=$query_date&group=$group&shift=$shift&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a><BR/></FONT>\n";
$HTML_text.="</FORM>\n\n";
$HTML_text.="<PRE><FONT SIZE=2>\n\n";
@@ -541,8 +542,7 @@ while ($i < $users_to_print)
$totOTHER = ($totOTHER + $OTHER);
$TOTsales = ($TOTsales + $sales);
if ( ($USERcallsRAW[$i] > 0) and ($sales > 0) ) {$Spct = ( ($sales / $USERcallsRAW[$i]) * 100);}
else {$Spct=0;}
$Spct = MathZDC($sales, $USERcallsRAW[$i])*100;
$Spct = round($Spct, 2);
$Spct = sprintf("%01.2f", $Spct);
@@ -581,8 +581,7 @@ while ($i < $users_to_print)
}
if ( ($TOTcalls > 0) and ($TOTsales > 0) ) {$totSpct = ( ($TOTsales / $TOTcalls) * 100);}
else {$totSpct=0;}
$totSpct = MathZDC($TOTsales, $TOTcalls)*100;
$totSpct = round($totSpct, 2);
$totSpct = sprintf("%01.2f", $totSpct);
$totSpct = sprintf("%6s", $totSpct);
@@ -609,7 +608,7 @@ if ($DB) {$ASCII_text.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
$AVGwait = $row[0];
$AVGwait_M = ($AVGwait / 60);
$AVGwait_M = MathZDC($AVGwait, 60);
$AVGwait_M = round($AVGwait_M, 2);
$AVGwait_M_int = intval("$AVGwait_M");
$AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
@@ -631,12 +630,12 @@ $CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$SUCCESS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_success)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$XFERS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_xfers)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$SUCCESSPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_success_pct)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$SALE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_sales)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_drops)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_other)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$SUCCESS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_success))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$XFERS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_xfers))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$SUCCESSPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_success_pct))."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$SALE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_sales))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_drops))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5] ,$max_other))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
}
$SUCCESS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTsales)."</th></tr></table>";
$XFERS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
@@ -821,26 +820,22 @@ while ($i < $users_to_print)
$totOTHER = ($totOTHER + $OTHER);
$totPOINTS = ($totPOINTS + $points);
if ( ($USERcallsRAW[$i] > 0) and ($sales > 0) ) {$Cpct = ( ($sales / ( ($USERcallsRAW[$i] - 0) - $DROP) ) * 100);}
else {$Cpct=0;}
$Cpct = MathZDC($sales, ( ($USERcallsRAW[$i] - 0) - $DROP) )*100;
$Cpct = round($Cpct, 2);
$Cpct = sprintf("%01.2f", $Cpct);
$Cpct = sprintf("%6s", $Cpct);
if ( ($sales > 0) and ($uTOP > 0) ) {$TOP = ( ($uTOP / $sales) * 100);}
else {$TOP=0;}
$TOP = MathZDC($uTOP, $sales)*100;
$TOP = round($TOP, 0);
$TOP = sprintf("%01.0f", $TOP);
$TOP = sprintf("%3s", $TOP);
if ( ($sales > 0) and ($uBOT > 0) ) {$BOT = ( ($uBOT / $sales) * 100);}
else {$BOT=0;}
$BOT = MathZDC($uBOT, $sales)*100;
$BOT = round($BOT, 0);
$BOT = sprintf("%01.0f", $BOT);
$BOT = sprintf("%3s", $BOT);
if ( ($USERcallsRAW[$i] > 0) and ($points > 0) ) {$ppc = ($points / ( ($USERcallsRAW[$i] - 0) - $DROP) );}
else {$ppc=0;}
$ppc = MathZDC($points, ( ($USERcallsRAW[$i] - 0) - $DROP) );
$ppc = round($ppc, 2);
$ppc = sprintf("%01.2f", $ppc);
$ppc = sprintf("%4s", $ppc);
@@ -879,26 +874,22 @@ while ($i < $users_to_print)
}
if ( ($TOTcalls > 0) and ($TOTsales > 0) ) {$totCpct = ( ($TOTsales / ( ($TOTcalls - 0) - $totDROP) ) * 100);}
else {$totCpct=0;}
$totCpct = MathZDC($TOTsales, ( ($TOTcalls - 0) - $totDROP) )*100;
$totCpct = round($totCpct, 2);
$totCpct = sprintf("%01.2f", $totCpct);
$totCpct = sprintf("%6s", $totCpct);
if ( ($TOTcalls > 0) and ($totPOINTS > 0) ) {$ppc = ($totPOINTS / ( ($TOTcalls - $totOTHER) - $totDROP) );}
else {$ppc=0;}
$ppc = MathZDC($totPOINTS, ( ($TOTcalls - $totOTHER) - $totDROP) );
$ppc = round($ppc, 2);
$ppc = sprintf("%01.2f", $ppc);
$ppc = sprintf("%4s", $ppc);
if ( ($TOTsales > 0) and ($totTOP > 0) ) {$TOP = ( ($totTOP / $TOTsales) * 100);}
else {$TOP=0;}
$TOP = MathZDC($totTOP, $TOTsales)*100;
$TOP = round($TOP, 0);
$TOP = sprintf("%01.0f", $TOP);
$TOP = sprintf("%3s", $TOP);
if ( ($TOTsales > 0) and ($totBOT > 0) ) {$BOT = ( ($totBOT / $TOTsales) * 100);}
else {$BOT=0;}
$BOT = MathZDC($totBOT, $TOTsales)*100;
$BOT = round($BOT, 0);
$BOT = sprintf("%01.0f", $BOT);
$BOT = sprintf("%3s", $BOT);
@@ -926,12 +917,12 @@ $CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$
for ($d=0; $d<count($graph_stats); $d++) {
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_sales)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_drops)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_other)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$SALES2_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_sales2)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$CONVPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_conv_pct)."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][1], $max_calls))."' height='16' />".$graph_stats[$d][1]."</td></tr>";
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][2], $max_sales))."' height='16' />".$graph_stats[$d][2]."</td></tr>";
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][3], $max_drops))."' height='16' />".$graph_stats[$d][3]."</td></tr>";
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][4], $max_other))."' height='16' />".$graph_stats[$d][4]."</td></tr>";
$SALES2_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][5], $max_sales2))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
$CONVPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(MathZDC(400*$graph_stats[$d][6], $max_conv_pct))."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
}
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
$SALES_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totA1)."</th></tr></table>";
+11 -9
View File
@@ -4,7 +4,7 @@
#
# functions for administrative scripts and reports
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# CHANGES:
@@ -17,7 +17,7 @@
# 130615-2111 - Added user authentication function and login lockout for 15 minutes after 10 failed login
# 130705-1957 - Added password encryption compatibility
# 130831-0919 - Changed to mysqli PHP functions
# 140319-1924 - Added ZeroDivisionCheck function
# 140319-1924 - Added MathZDC function
#
##### BEGIN validate user login credentials, check for failed lock out #####
@@ -152,7 +152,7 @@ function sec_convert($sec,$precision)
if ($precision == 'H')
{
$Fhours_H = ($sec / 3600);
$Fhours_H = MathZDC($sec, 3600);
$Fhours_H_int = floor($Fhours_H);
$Fhours_H_int = intval("$Fhours_H_int");
$Fhours_M = ($Fhours_H - $Fhours_H_int);
@@ -168,7 +168,7 @@ function sec_convert($sec,$precision)
}
if ($precision == 'M')
{
$Fminutes_M = ($sec / 60);
$Fminutes_M = MathZDC($sec, 60);
$Fminutes_M_int = floor($Fminutes_M);
$Fminutes_M_int = intval("$Fminutes_M_int");
$Fminutes_S = ($Fminutes_M - $Fminutes_M_int);
@@ -297,7 +297,7 @@ function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$met
echo "<th scope=\"col\" style=\"text-align: left; vertical-align:top;\"><span class=\"auraltext\">$metric_name</span> </th>\n";
echo "</tr>\n";
$max_multi = (400 / $max_count);
$max_multi = MathZDC(400, $max_count);
$i=0;
while($i < $days_graph)
{
@@ -407,11 +407,13 @@ function mysql_to_mysqli($stmt, $link) {
return $rslt;
}
function ZeroDivisionCheck($dividend, $divisor) {
if ($divisor>0) {
return ($dividend/$divisor);
} else {
function MathZDC($dividend, $divisor, $quotient=0) {
if ($divisor==0) {
return $quotient;
} else if ($dividend==0) {
return 0;
} else {
return ($dividend/$divisor);
}
}
?>
+10 -14
View File
@@ -86,10 +86,11 @@
# 140206-1205 - Added update_user function
# 140211-1056 - Added server_refresh function
# 140214-1540 - Added check_phone_number function
# 140331-2119 - Converted division calculations to use MathZDC function
#
$version = '2.8-62';
$build = '140214-1540';
$version = '2.8-63';
$build = '140331-2119';
$api_url_log = 0;
$startMS = microtime();
@@ -4427,34 +4428,29 @@ if ($function == 'agent_stats_export')
$login_start_end_check = ( ($ASend_epoch[$k] - $ASstart_epoch[$k]) + $ASend_sec[$k]);
if ($login_sec > $login_start_end_check) {$login_sec = $login_start_end_check;}
if ($ASsessions[$k] < 1) {$ASsessions[$k] = 1;}
$avg_session_sec = ($login_sec / $ASsessions[$k]);
$avg_session_sec = MathZDC($login_sec, $ASsessions[$k]);
$avg_pause_sec = MathZDC($ASpause_sec[$k], $ASpauses[$k]);
$avg_pause_session = MathZDC($ASpauses[$k], $ASsessions[$k]);
if ( ($ASpauses[$k] < 1) or ($login_sec < 1) )
{
$avg_pause_sec = 0;
$avg_pause_session = 0;
$pct_pause = 100;
}
else
{
$avg_pause_sec = ($ASpause_sec[$k] / $ASpauses[$k]);
$avg_pause_session = ($ASpauses[$k] / $ASsessions[$k]);
$pct_pause = ( ($ASpause_sec[$k] / $login_sec) * 100);
$pct_pause = ( MathZDC($ASpause_sec[$k], $login_sec) * 100);
}
$avg_cust_sec = MathZDC($cust_sec, $AScalls[$k]);
$avg_wait_sec = MathZDC($ASwait_sec[$k], $AScalls[$k]);
$pct_of_queue = ( MathZDC($AScalls[$k], $total_calls) * 100);
if ($AScalls[$k] < 1)
{
$cust_sec = 0;
$wait_sec = 0;
$avg_cust_sec = 0;
$avg_wait_sec = 0;
$pct_of_queue = 0;
}
else
{
$cust_sec = ($AStalk_sec[$k] - $ASdead_sec[$k]);
$wait_sec = $ASwait_sec[$k];
$avg_cust_sec = ($cust_sec / $AScalls[$k]);
$avg_wait_sec = ($ASwait_sec[$k] / $AScalls[$k]);
$pct_of_queue = ( ($AScalls[$k] / $total_calls) * 100);
}
$avg_session_sec = round($avg_session_sec);
$avg_pause_sec = round($avg_pause_sec);
+4 -3
View File
@@ -1,7 +1,7 @@
<?php
# phone_stats.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# changes:
@@ -13,6 +13,7 @@
# 130610-1110 - Finalized changing of all ereg instances to preg
# 130617-2156 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-0900 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
require("dbconnect_mysqli.php");
@@ -198,7 +199,7 @@ while ($statuses_to_print > $o)
{$bgcolor='bgcolor="#9BB9FB"';}
$call_seconds = $row[2];
$call_hours = ($call_seconds / 3600);
$call_hours = MathZDC($call_seconds, 3600);
$call_hours = round($call_hours, 2);
$call_hours_int = intval("$call_hours");
$call_minutes = ($call_hours - $call_hours_int);
@@ -220,7 +221,7 @@ while ($statuses_to_print > $o)
$counts_to_print = mysqli_num_rows($rslt);
$row=mysqli_fetch_row($rslt);
$call_seconds = $row[0];
$call_hours = ($call_seconds / 3600);
$call_hours = MathZDC($call_seconds, 3600);
$call_hours = round($call_hours, 2);
$call_hours_int = intval("$call_hours");
$call_minutes = ($call_hours - $call_hours_int);
+3 -2
View File
@@ -1,7 +1,7 @@
<?php
# timeclock_edit.php
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -13,6 +13,7 @@
# 130610-1107 - Finalized changing of all ereg instances to preg
# 130616-1541 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-0840 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
header ("Content-type: text/html; charset=utf-8");
@@ -391,7 +392,7 @@ if ( ($invalid_record < 1) or (strlen($timeclock_id)<1) )
# $LOGINevent_id = $timeclock_id;
# $LOGOUTevent_id = $tcid_link;
$event_hours = ($LOGINlogin_sec / 3600);
$event_hours = MathZDC($LOGINlogin_sec, 3600);
$event_hours_int = round($event_hours, 2);
$event_hours_int = intval("$event_hours_int");
$event_minutes = ($event_hours - $event_hours_int);
+9 -7
View File
@@ -23,6 +23,7 @@
# 130616-1026 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-0839 - Changed to mysqli PHP functions
# 140108-0720 - Added webserver and hostname to report logging
# 140328-0005 - Converted division calculations to use MathZDC function
#
$startMS = microtime();
@@ -344,6 +345,7 @@ while($i < $user_group_ct)
{
$user_group_string .= "$user_group[$i]|";
$user_group_SQL .= "'$user_group[$i]',";
$user_groupQS .= "&user_group[]=$user_group[$i]";
$i++;
}
if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
@@ -438,8 +440,8 @@ $MAIN.="<INPUT TYPE=text NAME=user SIZE=7 MAXLENGTH=20 VALUE=\"$user\">\n";
$MAIN.="<BR><BR><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n";
$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n";
$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&order=$order&user=$user&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2> &nbsp; | &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
$MAIN.="</TD><TD ALIGN=CENTER VALIGN=TOP ROWSPAN=3>\n";
$MAIN.="<FONT class=\"select_bold\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; <a href=\"$PHP_SELF?DB=$DB$user_groupQS&query_date=$query_date&end_date=$end_date&order=$order&user=$user&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a><FONT class=\"select_bold\" COLOR=BLACK SIZE=2> &nbsp; | &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
$MAIN.="</TD></TR></TABLE>\n";
$MAIN.="</FORM>\n\n";
@@ -502,7 +504,7 @@ if (!$report_display_type || $report_display_type=="TEXT")
if ($login_sec[$i] > 0)
{
$dbHOURS = ($login_sec[$i] / 3600);
$dbHOURS = MathZDC($login_sec[$i], 3600);
$dbHOURS = round($dbHOURS, 2);
$dbHOURS = sprintf("%01.2f", $dbHOURS);
}
@@ -535,7 +537,7 @@ if (!$report_display_type || $report_display_type=="TEXT")
$MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n";
$MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n";
$MAIN.="</TR>\n";
$CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n";
$CSV_text.="\"\",\"".($j+1)."\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n";
$j++;
}
@@ -543,7 +545,7 @@ if (!$report_display_type || $report_display_type=="TEXT")
if ($TOTlogin_sec > 0)
{
$TOTdbHOURS = ($TOTlogin_sec / 3600);
$TOTdbHOURS = MathZDC($TOTlogin_sec, 3600);
$TOTdbHOURS = round($TOTdbHOURS, 0);
$TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS);
}
@@ -571,7 +573,7 @@ else
if ($row[2] > 0)
{
$dbHOURS = ($row[2] / 3600);
$dbHOURS = MathZDC($row[2], 3600);
$dbHOURS = round($dbHOURS, 2);
$dbHOURS = sprintf("%01.2f", $dbHOURS);
}
@@ -595,7 +597,7 @@ else
if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";}
$MAIN.=" <tr>\n";
$MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n";
$MAIN.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n";
$MAIN.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(MathZDC(400*$ct_ary[$i][1], $high_ct))."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n";
$MAIN.=" </tr>\n";
}
$MAIN.=" <tr>\n";
+5 -4
View File
@@ -4,7 +4,7 @@
# make sure you have added a user to the vicidial_users MySQL table with at
# least user_level 4 to access this page the first time
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Changes
# 50307-1721 - First version
@@ -17,6 +17,7 @@
# 130610-1105 - Finalized changing of all ereg instances to preg
# 130616-0005 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130901-0833 - Changed to mysqli PHP functions
# 140328-0005 - Converted division calculations to use MathZDC function
#
$version = '2.8-10';
@@ -407,7 +408,7 @@ if ($ADD==61111)
$start_time = sprintf("%-19s", $row[5]);
$call_time_S = ($STARTtime - $row[6]);
$call_time_M = ($call_time_S / 60);
$call_time_M = MathZDC($call_time_S, 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
@@ -476,7 +477,7 @@ if ($ADD==71111)
$row=mysqli_fetch_row($rslt);
$in_calls = $row[0];
$in_time = $row[1];
$in_time_M = ($in_time / 60);
$in_time_M = MathZDC($in_time, 60);
$in_time_M = round($in_time_M, 2);
$in_time_M_int = intval("$in_time_M");
$in_time_SEC = ($in_time_M - $in_time_M_int);
@@ -516,7 +517,7 @@ if ($ADD==71111)
$start_time = sprintf("%-19s", $row[5]);
$call_time_S = $row[6];
$call_time_M = ($call_time_S / 60);
$call_time_M = MathZDC($call_time_S, 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);