diff --git a/app/xml_cdr/xml_cdr_statistics.php b/app/xml_cdr/xml_cdr_statistics.php
index 3dde4b4f75..2e6f6f7019 100644
--- a/app/xml_cdr/xml_cdr_statistics.php
+++ b/app/xml_cdr/xml_cdr_statistics.php
@@ -329,11 +329,11 @@
echo "
".$row['time']." | \n";
}
echo " ".escape($row['volume'])." | \n";
- echo " ".(round(escape($row['minutes']),2))." | \n";
- echo " ".(round(escape($row['avg_min']),2))." / ".(round(escape($row['cpm_ans']),2))." | \n";
- echo " ".escape($row['missed'])." | \n";
- echo " ".(round(escape($row['asr']),2))." | \n";
- echo " ".(round(escape($row['aloc']),2))." | \n";
+ echo " ".escape(round($row['minutes'] ?? 0, 2))." | \n";
+ echo " ".escape(round($row['avg_min'] ?? 0, 2))." / ".escape(round($row['cpm_ans'] ?? 0, 2))." | \n";
+ echo " ".escape($row['missed'] ?? '')." | \n";
+ echo " ".escape(round($row['asr'] ?? 0, 2))." | \n";
+ echo " ".escape(round($row['aloc'] ?? 0, 2))." | \n";
echo "\n";
$i++;
}
@@ -343,4 +343,4 @@
//include the footer
require_once "resources/footer.php";
-?>
+?>
\ No newline at end of file
diff --git a/app/xml_cdr/xml_cdr_statistics_inc.php b/app/xml_cdr/xml_cdr_statistics_inc.php
index a5296d8c48..f6e0d7ecbe 100644
--- a/app/xml_cdr/xml_cdr_statistics_inc.php
+++ b/app/xml_cdr/xml_cdr_statistics_inc.php
@@ -297,7 +297,7 @@
}
//Exclude enterprise ring group legs
if (!permission_exists('xml_cdr_enterprise_leg')) {
- $sql_where_ands[] .= "c.originating_leg_uuid IS NULL";
+ $sql_where_ands[] = "c.originating_leg_uuid IS NULL";
}
//If you can't see lose_race, don't run stats on it
elseif (!permission_exists('xml_cdr_lose_race')) {
@@ -604,7 +604,7 @@
$x = 0;
foreach ($stats as $row) {
$graph['minutes'][$x][] = $row['start_epoch'] * 1000;
- $graph['minutes'][$x][] = round($row['minutes'],2);
+ $graph['minutes'][$x][] = round($row['minutes'] ?? 0,2);
if ($x == $hours) { break; }
$x++;
}
@@ -625,16 +625,16 @@
$x = 0;
foreach ($stats as $row) {
$graph['asr'][$x][] = $row['start_epoch'] * 1000;
- $graph['asr'][$x][] = round($row['asr'],2) / 100;
+ $graph['asr'][$x][] = round($row['asr'] ?? 0,2) / 100;
if ($x == $hours) { break; }
$x++;
}
$x = 0;
foreach ($stats as $row) {
$graph['aloc'][$x][] = $row['start_epoch'] * 1000;
- $graph['aloc'][$x][] = round($row['aloc'],2);
+ $graph['aloc'][$x][] = round($row['aloc'] ?? 0,2);
if ($x == $hours) { break; }
$x++;
}
-?>
+?>
\ No newline at end of file