-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.php
executable file
·43 lines (38 loc) · 1.47 KB
/
delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
require_once('includes/config.php');
include('includes/sc-includes.php');
//DELETE CONTACT
if (isset($_GET['contact'])) {
mysql_query("DELETE FROM contacts WHERE contact_id = ".$_GET['contact']."");
mysql_query("DELETE FROM history WHERE history_contact = ".$_GET['contact']."");
mysql_query("DELETE FROM notes WHERE note_contact = ".$_GET['contact']."");
mysql_query("DELETE FROM donations WHERE donor_id = ".$_GET['contact']."");
redirect('Contact Deleted',"contacts.php");
}
//
//DELETE DONATION
if (isset($_GET['donation']) && isset($_GET['redirect'])) {
mysql_query("DELETE FROM donations WHERE id = ".$_GET['donation']."");
redirect('Donation Deleted',$_GET['redirect']);
}
//
//DELETE NOTE
if (isset($_GET['note'])) {
mysql_query("DELETE FROM notes WHERE note_id = ".$_GET['note']."");
$redirect = "contact-details.php?id=$_GET[id]";
redirect('Note Deleted',$redirect);
}
//
//DELETE FIELD
if (isset($_GET['field'])) {
mysql_query("DELETE FROM fields WHERE field_id = ".$_GET['field']."");
$redirect = 'fields.php';
redirect('Field Deleted',$redirect);
}
//
if (isset($_GET['user'])) {
mysql_query("DELETE FROM users WHERE user_id = ".$_GET['user']."");
$redirect = "users.php";
redirect('User Deleted',$redirect);
}
?>