Update fifo_list_inc.php
This commit is contained in:
parent
0455859934
commit
57147fd7f1
|
|
@ -17,22 +17,26 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Copyright (C) 2010
|
Copyright (C) 2010 - 2019
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
include "root.php";
|
||||||
if (permission_exists('active_queue_view')) {
|
require_once "resources/require.php";
|
||||||
//access granted
|
require_once "resources/check_auth.php";
|
||||||
}
|
|
||||||
else {
|
//check permissions
|
||||||
echo "access denied";
|
if (permission_exists('active_queue_view')) {
|
||||||
exit;
|
//access granted
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
|
|
@ -41,90 +45,91 @@ else {
|
||||||
//include theme config for button images
|
//include theme config for button images
|
||||||
include_once("themes/".$_SESSION['domain']['template']['name']."/config.php");
|
include_once("themes/".$_SESSION['domain']['template']['name']."/config.php");
|
||||||
|
|
||||||
$switch_cmd = 'fifo list';
|
//show the list
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$switch_cmd = 'fifo list';
|
||||||
if ($fp) {
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
$xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
|
if ($fp) {
|
||||||
try {
|
$xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
|
||||||
$xml = new SimpleXMLElement($xml_str);
|
try {
|
||||||
}
|
$xml = new SimpleXMLElement($xml_str);
|
||||||
catch(Exception $e) {
|
|
||||||
//echo $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
<fifo_report>
|
|
||||||
<fifo name="5900@voip.fusionpbx.com" consumer_count="0" caller_count="1" waiting_count="1" importance="0">
|
|
||||||
<callers>
|
|
||||||
<caller uuid="73a9324f-2a87-df11-bedf-0019dbe93b1f" status="WAITING" timestamp="2010-07-04 05:09:23">
|
|
||||||
<caller_profile></caller_profile>
|
|
||||||
</caller>
|
|
||||||
</callers>
|
|
||||||
<consumers></consumers>
|
|
||||||
</fifo>
|
|
||||||
<fifo name="cool_fifo@voip.fusionpbx.com" consumer_count="0" caller_count="0" waiting_count="0" importance="0">
|
|
||||||
<callers></callers>
|
|
||||||
<consumers></consumers>
|
|
||||||
</fifo>
|
|
||||||
</fifo_report>
|
|
||||||
*/
|
|
||||||
|
|
||||||
$c = 0;
|
|
||||||
$row_style["0"] = "row_style0";
|
|
||||||
$row_style["1"] = "row_style1";
|
|
||||||
|
|
||||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<th>".$text['label-name']."</th>\n";
|
|
||||||
echo "<th>".$text['label-consumer_count']."</th>\n";
|
|
||||||
echo "<th>".$text['label-caller_count']."</th>\n";
|
|
||||||
echo "<th>".$text['label-waiting_count']."</th>\n";
|
|
||||||
echo "<th>".$text['label-importance']."</th>\n";
|
|
||||||
echo "<td class='list_control_icon'></td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
foreach ($xml->fifo as $row) {
|
|
||||||
|
|
||||||
foreach($row->attributes() as $tmp_name => $tmp_value) {
|
|
||||||
$$tmp_name = $tmp_value;
|
|
||||||
}
|
}
|
||||||
unset($tmp_name, $tmp_value);
|
catch(Exception $e) {
|
||||||
|
//echo $e->getMessage();
|
||||||
//remove the domain from name
|
|
||||||
$tmp_name = str_replace('_', ' ', $name);
|
|
||||||
$tmp_name_array = explode('@', $name);
|
|
||||||
$tmp_name = $tmp_name_array[0];
|
|
||||||
|
|
||||||
$td_onclick = "onclick=\"document.location.href='fifo_interactive.php?c=".$name."';\"";
|
|
||||||
|
|
||||||
if (if_group("superadmin")) {
|
|
||||||
//show all fifo queues
|
|
||||||
echo "<tr >\n";
|
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick."><a href='fifo_interactive.php?c=".$name."'>".$tmp_name."</a></td>\n";
|
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$consumer_count."</td>\n";
|
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$caller_count."</td>\n";
|
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$waiting_count."</td>\n";
|
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$importance."</td>\n";
|
|
||||||
echo "<td class='list_control_icon'><a href='fifo_interactive.php?c=".$name."' alt='".$text['button-view']."'>$v_link_label_view</a></td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
//show only the fifo queues that match the domain_name
|
/*
|
||||||
if (stripos($name, $_SESSION['domain_name']) !== false) {
|
<fifo_report>
|
||||||
|
<fifo name="5900@voip.fusionpbx.com" consumer_count="0" caller_count="1" waiting_count="1" importance="0">
|
||||||
|
<callers>
|
||||||
|
<caller uuid="73a9324f-2a87-df11-bedf-0019dbe93b1f" status="WAITING" timestamp="2010-07-04 05:09:23">
|
||||||
|
<caller_profile></caller_profile>
|
||||||
|
</caller>
|
||||||
|
</callers>
|
||||||
|
<consumers></consumers>
|
||||||
|
</fifo>
|
||||||
|
<fifo name="cool_fifo@voip.fusionpbx.com" consumer_count="0" caller_count="0" waiting_count="0" importance="0">
|
||||||
|
<callers></callers>
|
||||||
|
<consumers></consumers>
|
||||||
|
</fifo>
|
||||||
|
</fifo_report>
|
||||||
|
*/
|
||||||
|
|
||||||
|
$c = 0;
|
||||||
|
$row_style["0"] = "row_style0";
|
||||||
|
$row_style["1"] = "row_style1";
|
||||||
|
|
||||||
|
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||||
|
echo "<tr>\n";
|
||||||
|
echo "<th>".$text['label-name']."</th>\n";
|
||||||
|
echo "<th>".$text['label-consumer_count']."</th>\n";
|
||||||
|
echo "<th>".$text['label-caller_count']."</th>\n";
|
||||||
|
echo "<th>".$text['label-waiting_count']."</th>\n";
|
||||||
|
echo "<th>".$text['label-importance']."</th>\n";
|
||||||
|
echo "<td class='list_control_icon'></td>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
foreach ($xml->fifo as $row) {
|
||||||
|
|
||||||
|
foreach($row->attributes() as $tmp_name => $tmp_value) {
|
||||||
|
$$tmp_name = $tmp_value;
|
||||||
|
}
|
||||||
|
unset($tmp_name, $tmp_value);
|
||||||
|
|
||||||
|
//remove the domain from name
|
||||||
|
$tmp_name = str_replace('_', ' ', $name);
|
||||||
|
$tmp_name_array = explode('@', $name);
|
||||||
|
$tmp_name = $tmp_name_array[0];
|
||||||
|
|
||||||
|
$td_onclick = "onclick=\"document.location.href='fifo_interactive.php?c=".escape($name)."';\"";
|
||||||
|
|
||||||
|
if (if_group("superadmin")) {
|
||||||
|
//show all fifo queues
|
||||||
echo "<tr >\n";
|
echo "<tr >\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick."><a href='fifo_interactive.php?c=".$name."'>".$tmp_name."</a></td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick."><a href='fifo_interactive.php?c=".escape($name)."'>".escape($tmp_name)."</a></td>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$consumer_count."</td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($consumer_count)."</td>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$caller_count."</td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($caller_count)."</td>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$waiting_count."</td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($waiting_count)."</td>\n";
|
||||||
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".$importance."</td>\n";
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($importance)."</td>\n";
|
||||||
echo "<td class='list_control_icon'><a href='fifo_interactive.php?c=".$name."' alt='".$text['button-view']."'>$v_link_label_view</a></td>\n";
|
echo "<td class='list_control_icon'><a href='fifo_interactive.php?c=".escape($name)."' alt='".$text['button-view']."'>$v_link_label_view</a></td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//show only the fifo queues that match the domain_name
|
||||||
|
if (stripos($name, $_SESSION['domain_name']) !== false) {
|
||||||
|
echo "<tr >\n";
|
||||||
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick."><a href='fifo_interactive.php?c=".$name."'>".escape($tmp_name)."</a></td>\n";
|
||||||
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($consumer_count)."</td>\n";
|
||||||
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($caller_count)."</td>\n";
|
||||||
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($waiting_count)."</td>\n";
|
||||||
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick.">".escape($importance)."</td>\n";
|
||||||
|
echo "<td class='list_control_icon'><a href='fifo_interactive.php?c=".escape($name)."' alt='".$text['button-view']."'>$v_link_label_view</a></td>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($c==0) { $c=1; } else { $c=0; }
|
||||||
}
|
}
|
||||||
|
echo "</table>\n";
|
||||||
if ($c==0) { $c=1; } else { $c=0; }
|
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue