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
$sql = "delete from v_dialplan_details "; if (isset($dialplan_uuid)) {
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; "; $sql = "delete from v_dialplan_details ";
$db->query($sql); $sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
unset($sql); $db->query($sql);
unset($sql);
}
//delete parent data //delete parent data
$sql = "delete from v_dialplans "; if (isset($dialplan_uuid)) {
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; "; $sql = "delete from v_dialplans ";
$db->query($sql); $sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
unset($sql); $db->query($sql);
//unset the variable unset($sql,$dialplan_uuid);
unset($dialplan_uuid); }
} }
//only run the following code if the directory exists //only run the following code if the directory exists