Database class integration.

This commit is contained in:
Nate
2019-07-26 23:05:01 -06:00
parent 4ce02d1627
commit a841bfe5f0
5 changed files with 121 additions and 128 deletions
+16 -14
View File
@@ -39,24 +39,26 @@ else {
$text = $language->get();
//get the http values and set as variables
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
$contact_phone_uuid = $_GET["id"];
$contact_uuid = $_GET["contact_uuid"];
//delete the record
if (strlen($id) > 0) {
$sql = "delete from v_contact_phones ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and contact_phone_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
if (is_uuid($contact_phone_uuid) && is_uuid($contact_uuid)) {
$array['contact_phones'][0]['contact_phone_uuid'] = $contact_phone_uuid;
$array['contact_phones'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['contact_phones'][0]['contact_uuid'] = $contact_uuid;
$database = new database;
$database->app_name = 'contacts';
$database->app_uuid = '04481e0e-a478-c559-adad-52bd4174574c';
$database->delete($array);
unset($array);
message::add($text['message-delete']);
}
//redirect the browser
message::add($text['message-delete']);
//redirect
header("Location: contact_edit.php?id=".$contact_uuid);
return;
exit;
?>