-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
101 lines (88 loc) · 2.61 KB
/
delete.php
File metadata and controls
101 lines (88 loc) · 2.61 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
require ('connection.inc.php');
require ('functions.inc.php');
//Student Delete
if(isset($_GET['student'])){
$id = get_safe_value($con,$_GET['student']);
$result = mysqli_query($con, "DELETE FROM `students` WHERE `id` = '$id'");
if($result){
$_SESSION['student-success'] = "Delete Successfully";
header('location: students.php');
exit(0);
}else{
$_SESSION['student-error'] = "Something is Worng";
header('location: students.php');
exit(0);
}
}
//Department Delete
if(isset($_GET['department'])){
$id = get_safe_value($con,$_GET['department']);
$result = mysqli_query($con, "DELETE FROM `department` WHERE `id` = '$id'");
if($result){
$_SESSION['department-success'] = "Delete Successfully";
header('location: add_categories.php');
exit(0);
}else{
$_SESSION['department-error'] = "Something is Worng";
header('location: add_categories.php');
exit(0);
}
}
//Session Delete
if(isset($_GET['session'])){
$id = get_safe_value($con,$_GET['session']);
$result = mysqli_query($con, "DELETE FROM `session` WHERE `id` = '$id'");
if($result){
$_SESSION['session-success'] = "Delete Successfully";
header('location: add_categories.php');
exit(0);
}else{
$_SESSION['session-error'] = "Something is Worng";
header('location: add_categories.php');
exit(0);
}
}
//Company Delete
if(isset($_GET['company'])){
$id = get_safe_value($con,$_GET['company']);
$result = mysqli_query($con, "DELETE FROM `company` WHERE `id` = '$id'");
if($result){
$_SESSION['company-success'] = "Delete Successfully";
header('location: add_categories.php');
exit(0);
}else{
$_SESSION['company-error'] = "Something is Worng";
header('location: add_categories.php');
exit(0);
}
}
//Message Delete
if(isset($_GET['message'])){
$id = get_safe_value($con,$_GET['message']);
$result = mysqli_query($con, "DELETE FROM `message` WHERE `id` = '$id'");
if($result){
$_SESSION['message-success'] = "Delete Successfully";
header('location: a-message.php');
exit(0);
}else{
$_SESSION['message-error'] = "Something is Worng";
header('location: a-message.php');
exit(0);
}
}
//User Delete
if(isset($_GET['user'])){
$id = get_safe_value($con,$_GET['user']);
$result = mysqli_query($con, "DELETE FROM `user` WHERE `id` = '$id'");
if($result){
$_SESSION['user-success'] = "Delete Successfully";
header('location: users.php');
exit(0);
}else{
$_SESSION['user-error'] = "Something is Worng";
header('location: users.php');
exit(0);
}
}
?>