diff --git a/app/fifo_list/fifo_list_inc.php b/app/fifo_list/fifo_list_inc.php index 3a5235570b..19306c5286 100644 --- a/app/fifo_list/fifo_list_inc.php +++ b/app/fifo_list/fifo_list_inc.php @@ -17,22 +17,26 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 + Copyright (C) 2010 - 2019 All Rights Reserved. Contributor(s): Mark J Crane */ -include "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('active_queue_view')) { - //access granted -} -else { - echo "access denied"; - exit; -} + +//includes + include "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('active_queue_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } //add multi-lingual support $language = new text; @@ -41,90 +45,91 @@ else { //include theme config for button images include_once("themes/".$_SESSION['domain']['template']['name']."/config.php"); -$switch_cmd = 'fifo list'; -$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); -if ($fp) { - $xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); - try { - $xml = new SimpleXMLElement($xml_str); - } - catch(Exception $e) { - //echo $e->getMessage(); - } - - /* - - - - - - - - - - - - - - - */ - - $c = 0; - $row_style["0"] = "row_style0"; - $row_style["1"] = "row_style1"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - foreach ($xml->fifo as $row) { - - foreach($row->attributes() as $tmp_name => $tmp_value) { - $$tmp_name = $tmp_value; +//show the list + $switch_cmd = 'fifo list'; + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + if ($fp) { + $xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); + try { + $xml = new SimpleXMLElement($xml_str); } - 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=".$name."';\""; - - if (if_group("superadmin")) { - //show all fifo queues - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + catch(Exception $e) { + //echo $e->getMessage(); } - else { - //show only the fifo queues that match the domain_name - if (stripos($name, $_SESSION['domain_name']) !== false) { + + /* + + + + + + + + + + + + + + + */ + + $c = 0; + $row_style["0"] = "row_style0"; + $row_style["1"] = "row_style1"; + + echo "
".$text['label-name']."".$text['label-consumer_count']."".$text['label-caller_count']."".$text['label-waiting_count']."".$text['label-importance']."
".$tmp_name."".$consumer_count."".$caller_count."".$waiting_count."".$importance."$v_link_label_view
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\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 "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - } + } + else { + //show only the fifo queues that match the domain_name + if (stripos($name, $_SESSION['domain_name']) !== false) { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + } + + if ($c==0) { $c=1; } else { $c=0; } } - - if ($c==0) { $c=1; } else { $c=0; } + echo "
".$text['label-name']."".$text['label-consumer_count']."".$text['label-caller_count']."".$text['label-waiting_count']."".$text['label-importance']."
".$tmp_name."".$consumer_count."".$caller_count."".$waiting_count."".$importance."$v_link_label_view".escape($tmp_name)."".escape($consumer_count)."".escape($caller_count)."".escape($waiting_count)."".escape($importance)."$v_link_label_view
".escape($tmp_name)."".escape($consumer_count)."".escape($caller_count)."".escape($waiting_count)."".escape($importance)."$v_link_label_view
\n"; } - echo "\n"; -} -?> \ No newline at end of file +?>