Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('ivr_menu_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } //additional includes require_once "resources/header.php"; $page["title"] = $text['title-ivr_menus']; require_once "resources/paging.php"; //get the http values and set them as variables if (isset($_GET["order_by"])) { $order_by['0']['name'] = check_str($_GET["order_by"]); $order_by['0']['order'] = check_str($_GET["order"]); } else { $order_by['0']['name'] = 'ivr_menu_name'; $order_by['0']['order'] = 'asc'; } //show the content echo "
"; echo "\n"; echo "\n"; echo " "; echo ""; echo "
\n"; echo "
"; //show the content header echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['header-ivr_menus']."
".$text['description-ivr_menus']."
\n"; echo "
\n"; //get the count require_once "resources/classes/database.php"; require_once "resources/classes/ivr_menu.php"; $ivr = new ivr_menu; $ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->table = "v_ivr_menus"; $where[0]['name'] = 'domain_uuid'; $where[0]['value'] = $_SESSION["domain_uuid"]; $where[0]['operator'] = '='; $ivr->where = $where; $num_rows = $ivr->count(); //prepare to page the results $rows_per_page = 150; $param = ""; if (!isset($_GET['page'])) { $_GET['page'] = 0; } $_GET['page'] = check_str($_GET['page']); list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); $offset = $rows_per_page * $_GET['page']; //get the list from the db if (isset($order_by)) { if (count($order_by) > 0) { $ivr->order_by = $order_by; } } $result = $ivr->find(); $result_count = count($result); unset ($prep_statement, $sql); $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; echo "\n"; echo th_order_by('ivr_menu_name', $text['label-name'], $order_by[0]['name'], $order_by[0]['order']); echo th_order_by('ivr_menu_extension', $text['label-extension'], $order_by[0]['name'], $order_by[0]['order']); echo th_order_by('ivr_menu_direct_dial', $text['label-direct_dial'], $order_by[0]['name'], $order_by[0]['order']); echo th_order_by('ivr_menu_enabled', $text['label-enabled'], $order_by[0]['name'], $order_by[0]['order']); echo th_order_by('ivr_menu_description', $text['label-description'], $order_by[0]['name'], $order_by[0]['order']); echo "\n"; echo "\n"; if ($result_count > 0) { foreach($result as $row) { $ivr_menu_name = str_replace("-", " ", $row['ivr_menu_name']); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $result, $row_count); } //end if results echo "\n"; echo "\n"; echo "\n"; echo "
"; if (permission_exists('ivr_menu_add')) { echo "$v_link_label_add"; } echo "
".$ivr_menu_name."".$row['ivr_menu_extension']." ".$row['ivr_menu_direct_dial']."".$row['ivr_menu_enabled']."".$row['ivr_menu_description']." "; if (permission_exists('ivr_menu_edit')) { echo "$v_link_label_edit"; } if (permission_exists('ivr_menu_delete')) { echo "$v_link_label_delete"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls"; if (permission_exists('ivr_menu_add')) { echo "$v_link_label_add"; } echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; echo "
"; echo "
"; echo "

"; //show the footer require_once "resources/footer.php"; ?>