diff --git a/app/call_center_active/call_center_active_inc.php b/app/call_center_active/call_center_active_inc.php index e09165227b..c8dc37913d 100644 --- a/app/call_center_active/call_center_active_inc.php +++ b/app/call_center_active/call_center_active_inc.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2016 the Initial Developer. All Rights Reserved. Contributor(s): @@ -49,11 +49,11 @@ else { if (trim(strtoupper($tmp_array[0])) != "+OK") { $tmp_field_name_array = explode ($tmp_delimiter, $tmp_array[0]); $x = 0; - foreach ($tmp_array as $row) { + if (isset($tmp_array)) foreach ($tmp_array as $row) { if ($x > 0) { $tmp_field_value_array = explode ($tmp_delimiter, $tmp_array[$x]); $y = 0; - foreach ($tmp_field_value_array as $tmp_value) { + if (isset($tmp_field_value_array)) foreach ($tmp_field_value_array as $tmp_value) { $tmp_name = $tmp_field_name_array[$y]; if (trim(strtoupper($tmp_value)) != "+OK") { $result[$x][$tmp_name] = $tmp_value; @@ -106,7 +106,7 @@ else { //prepare the result for array_multisort $x = 0; - foreach ($result as $row) { + if (isset($result)) foreach ($result as $row) { $tier_result[$x]['level'] = $row['level']; $tier_result[$x]['position'] = $row['position']; $tier_result[$x]['agent'] = $row['agent']; @@ -141,7 +141,7 @@ else { echo "".$text['label-options']."\n"; } echo "\n"; - foreach ($tier_result as $tier_row) { + if (isset($tier_result)) foreach ($tier_result as $tier_row) { //$queue = $tier_row['queue']; //$queue = str_replace('@'.$_SESSION['domain_name'], '', $queue); $agent = $tier_row['agent']; @@ -150,7 +150,7 @@ else { $tier_level = $tier_row['level']; $tier_position = $tier_row['position']; - foreach ($agent_result as $agent_row) { + if (isset($agent_result)) foreach ($agent_result as $agent_row) { if ($tier_row['agent'] == $agent_row['name']) { $name = $agent_row['name']; $name = str_replace('@'.$_SESSION['domain_name'], '', $name); @@ -261,7 +261,7 @@ else { echo " ".$text['description-queue']."
\n"; echo " \n"; echo " "; - foreach ($result as $row) { + if (isset($result)) foreach ($result as $row) { $state = $row['state']; $q_trying += ($state == "Trying") ? 1 : 0; $q_waiting += ($state == "Waiting") ? 1 : 0; @@ -288,7 +288,7 @@ else { echo "".$text['label-agent']."\n"; echo "\n"; - foreach ($result as $row) { + if (isset($result)) foreach ($result as $row) { $queue = $row['queue']; $system = $row['system']; $uuid = $row['uuid']; @@ -354,7 +354,6 @@ else { echo "
\n"; echo "
\n"; echo "
\n"; - - } -?> + +?> \ No newline at end of file