$_SESSION["message"] = $text['message-update']; header("Location: ivr_menu_edit.php?id=" . $ivr_menu_uuid); return; } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //initialize the destinations object $destination = new destinations(); //pre-populate the form if (strlen($ivr_menu_uuid) == 0) { $ivr_menu_uuid = check_str($_REQUEST["id"]); } if (strlen($ivr_menu_uuid) > 0 && $_POST["persistformvar"] != "true") { require_once "resources/classes/ivr_menu.php"; $ivr = new ivr_menu(); $ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->ivr_menu_uuid = $ivr_menu_uuid; $result = $ivr->find(); $result_count = count($result); foreach ($result as &$row) { $ivr_menu_name = $row["ivr_menu_name"]; $ivr_menu_extension = $row["ivr_menu_extension"]; $ivr_menu_greet_long = $row["ivr_menu_greet_long"]; $ivr_menu_greet_short = $row["ivr_menu_greet_short"]; $ivr_menu_invalid_sound = $row["ivr_menu_invalid_sound"]; $ivr_menu_exit_sound = $row["ivr_menu_exit_sound"]; $ivr_menu_confirm_macro = $row["ivr_menu_confirm_macro"]; $ivr_menu_confirm_key = $row["ivr_menu_confirm_key"]; $ivr_menu_tts_engine = $row["ivr_menu_tts_engine"]; $ivr_menu_tts_voice = $row["ivr_menu_tts_voice"];
//redirect the user $_SESSION["message"] = $text['message-update']; header("Location: ivr_menu_edit.php?id=" . $ivr_menu_uuid); return; } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //initialize the destinations object $destination = new destinations(); //pre-populate the form if (strlen($ivr_menu_uuid) == 0) { $ivr_menu_uuid = check_str($_REQUEST["id"]); } if (strlen($ivr_menu_uuid) > 0 && $_POST["persistformvar"] != "true") { $ivr = new ivr_menu(); $ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->ivr_menu_uuid = $ivr_menu_uuid; $ivr_menus = $ivr->find(); if (is_array($ivr_menus)) { foreach ($ivr_menus as &$row) { $dialplan_uuid = $row["dialplan_uuid"]; $ivr_menu_name = $row["ivr_menu_name"]; $ivr_menu_extension = $row["ivr_menu_extension"]; $ivr_menu_greet_long = $row["ivr_menu_greet_long"]; $ivr_menu_greet_short = $row["ivr_menu_greet_short"]; $ivr_menu_invalid_sound = $row["ivr_menu_invalid_sound"]; $ivr_menu_exit_sound = $row["ivr_menu_exit_sound"]; $ivr_menu_confirm_macro = $row["ivr_menu_confirm_macro"]; $ivr_menu_confirm_key = $row["ivr_menu_confirm_key"]; $ivr_menu_tts_engine = $row["ivr_menu_tts_engine"];
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 "<b>" . $text['header-ivr_menus'] . "</b>\n"; echo "<br /><br />\n"; echo $text['description-ivr_menus'] . "\n"; echo "<br /><br />\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(); //use total ivr menu count from the database $total_ivr_menus = $num_rows; //prepare to page the results $rows_per_page = 150; $param = ""; if (!isset($_GET['page'])) { $_GET['page'] = 0; }
require_once "resources/check_auth.php"; if (permission_exists('ivr_menu_delete')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text(); $text = $language->get(); //get the id if (count($_GET) > 0) { $id = check_str($_GET["id"]); } if (strlen($id) > 0) { //include the ivr menu class require_once "resources/classes/database.php"; require_once "resources/classes/ivr_menu.php"; $ivr = new ivr_menu(); $ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->ivr_menu_uuid = $id; $ivr->delete(); //synchronize the xml config save_dialplan_xml(); //clear the cache $cache = new cache(); $cache->delete("dialplan:" . $_SESSION["context"]); } //redirect the user $_SESSION['message'] = $text['message-delete']; header("Location: ivr_menus.php");
require_once "resources/persist_form_var.php"; echo "<div align='center'>\n"; echo "<table><tr><td>\n"; echo $msg . "<br />"; echo "</td></tr></table>\n"; persistformvar($_POST); echo "</div>\n"; require_once "resources/footer.php"; return; } //add or update the database if ($_POST["persistformvar"] != "true") { //create the object require_once "resources/classes/database.php"; require_once "resources/classes/ivr_menu.php"; $ivr = new ivr_menu(); $ivr->domain_uuid = $_SESSION["domain_uuid"]; $ivr->ivr_menu_uuid = $ivr_menu_uuid; $ivr->ivr_menu_option_uuid = $ivr_menu_option_uuid; $ivr->ivr_menu_option_digits = trim($ivr_menu_option_digits); $ivr->ivr_menu_option_action = $ivr_menu_option_action; $ivr->ivr_menu_option_param = $ivr_menu_option_param; $ivr->ivr_menu_option_order = $ivr_menu_option_order; $ivr->ivr_menu_option_description = $ivr_menu_option_description; if ($action == "add" && permission_exists('ivr_menu_add')) { //run the add method in the ivr menu class $ivr_menu_option_uuid = uuid(); $ivr->ivr_menu_option_uuid = $ivr_menu_option_uuid; $ivr->add(); //redirect the user $_SESSION['message'] = $text['message-add'];
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 "<b>" . $text['header-ivr_menus'] . "</b>\n"; echo "<br /><br />\n"; echo $text['description-ivr_menus'] . "\n"; echo "<br /><br />\n"; //get the count $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(); //use total ivr menu count from the database $total_ivr_menus = $num_rows; //prepare to page the results $rows_per_page = $_SESSION['domain']['paging']['numeric'] != '' ? $_SESSION['domain']['paging']['numeric'] : 50; $param = ""; if (!isset($_GET['page'])) { $_GET['page'] = 0; }