Add more comments and is_array before foreach
This commit is contained in:
parent
bb56827f4f
commit
0fce8ac1a5
|
|
@ -18,16 +18,17 @@
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings');
|
$text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings');
|
||||||
|
|
||||||
//recent calls
|
//create assigned extensions array
|
||||||
echo "<div class='hud_box'>\n";
|
if (is_array($_SESSION['user']['extension'])) {
|
||||||
|
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
|
||||||
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
|
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
|
||||||
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if also viewing system status, show more recent calls (more room avaialble)
|
//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;
|
$recent_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
|
||||||
|
|
||||||
|
//get the recent calls from call detail records
|
||||||
$sql = "
|
$sql = "
|
||||||
select
|
select
|
||||||
direction,
|
direction,
|
||||||
|
|
@ -70,10 +71,14 @@
|
||||||
$result = $database->select($sql, $parameters, 'all');
|
$result = $database->select($sql, $parameters, 'all');
|
||||||
$num_rows = is_array($result) ? sizeof($result) : 0;
|
$num_rows = is_array($result) ? sizeof($result) : 0;
|
||||||
|
|
||||||
|
//define row styles
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$row_style["0"] = "row_style0";
|
$row_style["0"] = "row_style0";
|
||||||
$row_style["1"] = "row_style1";
|
$row_style["1"] = "row_style1";
|
||||||
|
|
||||||
|
//recent calls
|
||||||
|
echo "<div class='hud_box'>\n";
|
||||||
|
|
||||||
//add doughnut chart
|
//add doughnut chart
|
||||||
?>
|
?>
|
||||||
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;'>
|
<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;'>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue