Update ivr_menu_option_delete.php

This commit is contained in:
FusionPBX 2019-05-07 19:34:52 -06:00 committed by GitHub
parent 0328cf8a64
commit a4834e391b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 9 deletions

View File

@ -49,21 +49,40 @@
}
//delete the ivr menu option
if (strlen($id) > 0) {
$sql = "delete from v_ivr_menu_options ";
$sql .= "where domain_uuid = '".$_SESSION["domain_uuid"]."' ";
$sql .= "and ivr_menu_option_uuid = '".$id."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
if (is_uuid($id)) {
//get the dialplan_uuid
$sql = "select * from v_ivr_menus ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ivr_menu_uuid = :ivr_menu_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['ivr_menu_uuid'] = $ivr_menu_uuid;
$database = new database;
$result = $database->select($sql, $parameters);
if (is_array($result)) {
foreach ($result as &$row) {
$dialplan_uuid = $row["dialplan_uuid"];
$ivr_menu_context = $row["ivr_menu_context"];
}
}
unset($sql, $parameters);
//delete the data
$array['ivr_menu_options'][]['ivr_menu_option_uuid'] = $id;
$database = new database;
$database->app_name = 'ivr_menus';
$database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab';
$database->delete($array);
//$message = $database->message;
}
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["context"]);
$cache->delete("dialplan:".$ivr_menu_context);
//redirect the user
message::add($text['message-delete']);
header('Location: ivr_menu_edit.php?id='.$ivr_menu_uuid);
if (is_uuid($ivr_menu_uuid)) {
header('Location: ivr_menu_edit.php?id='.$ivr_menu_uuid);
}
?>