Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (!permission_exists('contact_attachment_delete')) { echo "access denied"; exit; } //add multi-lingual support $language = new text; $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"]); } //delete the record if (is_uuid($id)) { $sql = "delete from v_contact_attachments "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and contact_attachment_uuid = :contact_attachment_uuid "; $bind[':contact_attachment_uuid'] = $id; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(is_array($bind) ? $bind : null); unset($sql); } //redirect the browser message::add($text['message-delete']); header("Location: contact_edit.php?id=".$contact_uuid); return; ?>