Make sure the dialplan_uuid is set before trying to delete it

This commit is contained in:
Mark Crane 2014-08-16 18:54:32 +00:00
parent b3af16f364
commit 4b5e2d99ce
1 changed files with 12 additions and 10 deletions

View File

@ -59,17 +59,19 @@
} }
unset($prep_statement); unset($prep_statement);
//delete child data //delete child data
if (isset($dialplan_uuid)) {
$sql = "delete from v_dialplan_details "; $sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; "; $sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
$db->query($sql); $db->query($sql);
unset($sql); unset($sql);
}
//delete parent data //delete parent data
if (isset($dialplan_uuid)) {
$sql = "delete from v_dialplans "; $sql = "delete from v_dialplans ";
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; "; $sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
$db->query($sql); $db->query($sql);
unset($sql); unset($sql,$dialplan_uuid);
//unset the variable }
unset($dialplan_uuid);
} }
//only run the following code if the directory exists //only run the following code if the directory exists