Update ivr_menus.php

Add indentation, and improve the code in ivr_menus.php.
This commit is contained in:
FusionPBX
2016-07-14 01:16:07 -06:00
committed by GitHub
parent 752a55d9b7
commit 21ff75fc8f
+18 -18
View File
@@ -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>
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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
require_once "root.php";
require_once "resources/require.php"; //includes
require_once "resources/check_auth.php"; require_once "root.php";
if (permission_exists('ivr_menu_view')) { require_once "resources/require.php";
//access granted require_once "resources/check_auth.php";
}
else { //check permissions
echo "access denied"; if (permission_exists('ivr_menu_view')) {
exit; //access granted
} }
else {
echo "access denied";
exit;
}
//add multi-lingual support //add multi-lingual support
$language = new text; $language = new text;
@@ -60,8 +64,6 @@ else {
echo "<br /><br />\n"; echo "<br /><br />\n";
//get the count //get the count
require_once "resources/classes/database.php";
require_once "resources/classes/ivr_menu.php";
$ivr = new ivr_menu; $ivr = new ivr_menu;
$ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->domain_uuid = $_SESSION["domain_uuid"];
$ivr->table = "v_ivr_menus"; $ivr->table = "v_ivr_menus";
@@ -88,9 +90,7 @@ else {
$ivr->order_by = $order_by; $ivr->order_by = $order_by;
} }
} }
$result = $ivr->find(); $ivr_menus = $ivr->find();
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
@@ -112,8 +112,8 @@ else {
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
if ($result_count > 0) { if (is_array($ivr_menus)) {
foreach($result as $row) { foreach($ivr_menus as $row) {
$ivr_menu_name = str_replace("-", " ", $row['ivr_menu_name']); $ivr_menu_name = str_replace("-", " ", $row['ivr_menu_name']);
$tr_link = (permission_exists('ivr_menu_edit')) ? "href='ivr_menu_edit.php?id=".$row['ivr_menu_uuid']."'" : null; $tr_link = (permission_exists('ivr_menu_edit')) ? "href='ivr_menu_edit.php?id=".$row['ivr_menu_uuid']."'" : null;
echo "<tr ".$tr_link.">\n"; echo "<tr ".$tr_link.">\n";