diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php
index aba78e75a9..12ce59c053 100644
--- a/app/xml_cdr/resources/dashboard/missed_calls.php
+++ b/app/xml_cdr/resources/dashboard/missed_calls.php
@@ -6,9 +6,9 @@
//includes files
require_once "resources/require.php";
+ require_once "resources/check_auth.php";
//check permisions
- require_once "resources/check_auth.php";
if (permission_exists('xml_cdr_view')) {
//access granted
}
@@ -21,8 +21,7 @@
$language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings');
-//missed calls
- echo "
\n";
+//create assigned extensions array
if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
@@ -33,6 +32,7 @@
//if also viewing system status, show more recent calls (more room avaialble)
$missed_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
+//get the missed calls from call detail records
$sql = "select \n";
$sql .= " direction, \n";
$sql .= " start_stamp, \n";
@@ -68,17 +68,17 @@
$sql .= "order by \n";
$sql .= "start_epoch desc \n";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
- //echo $sql;
- //view_array($parameters);
if (!isset($database)) { $database = new database; }
$result = $database->select($sql, $parameters, 'all');
-
$num_rows = is_array($result) ? sizeof($result) : 0;
+//define row styles
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
+//missed calls
+ echo "
\n";
//add doughnut chart
?>
@@ -99,7 +99,7 @@
''
],
borderColor: '',
- borderWidth: '',
+ borderWidth: '',
cutout: chart_cutout
}]
},
@@ -143,7 +143,7 @@
file_exists($theme_image_path."icon_cdr_local_cancelled.png")
) ? true : false;
- foreach($result as $index => $row) {
+ foreach ($result as $index => $row) {
if ($index + 1 > $missed_limit) { break; } //only show limit
$tmp_year = date("Y", strtotime($row['start_stamp']));
$tmp_month = date("M", strtotime($row['start_stamp']));
@@ -189,4 +189,4 @@
echo "";
echo "
\n";
-?>
+?>
\ No newline at end of file
diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php
index a292b0ef78..1fecc19016 100644
--- a/app/xml_cdr/resources/dashboard/recent_calls.php
+++ b/app/xml_cdr/resources/dashboard/recent_calls.php
@@ -6,9 +6,9 @@
//includes files
require_once "resources/require.php";
+ require_once "resources/check_auth.php";
//check permisions
- require_once "resources/check_auth.php";
if (permission_exists('xml_cdr_view')) {
//access granted
}
@@ -27,6 +27,7 @@
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
}
}
+ unset($assigned_extension);
//if also viewing system status, show more recent calls (more room avaialble)
$recent_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
@@ -96,8 +97,10 @@
data: {
datasets: [{
data: ['', 0.00001],
- backgroundColor: ['',
- ''],
+ backgroundColor: [
+ '',
+ ''
+ ],
borderColor: '',
borderWidth: '',
cutout: chart_cutout
@@ -150,7 +153,7 @@
file_exists($theme_image_path."icon_cdr_local_failed.png")
) ? true : false;
- foreach($result as $index => $row) {
+ foreach ($result as $index => $row) {
if ($index + 1 > $recent_limit) { break; } //only show limit
$tmp_year = date("Y", strtotime($row['start_stamp']));
$tmp_month = date("M", strtotime($row['start_stamp']));
@@ -221,4 +224,4 @@
echo "
";
echo "
\n";
-?>
+?>
\ No newline at end of file