-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteItems.php
69 lines (58 loc) · 1.67 KB
/
deleteItems.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
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
<?php
require_once './includes/connect.php';
if(isset($_GET['delete_food_id'])){
$id=$_GET['delete_food_id'];
$sql="DELETE FROM food_items WHERE food_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:food.php');
}else{
die(mysqli_error($con));
}
}else if(isset($_GET['delete_shop_id'])){
$id=$_GET['delete_shop_id'];
$sql="DELETE FROM shopping_items WHERE shop_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:shopping.php');
}else{
die(mysqli_error($con));
}
}else if(isset($_GET['delete_health_id'])){
$id=$_GET['delete_health_id'];
$sql="DELETE FROM health_items WHERE health_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:health.php');
}else{
die(mysqli_error($con));
}
}else if(isset($_GET['delete_others_id'])){
$id=$_GET['delete_others_id'];
$sql="DELETE FROM other_items WHERE others_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:others.php');
}else{
die(mysqli_error($con));
}
}else if(isset($_GET['delete_lent_id'])){
$id=$_GET['delete_lent_id'];
$sql="DELETE FROM lent_items WHERE lent_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:lent.php');
}else{
die(mysqli_error($con));
}
}else if(isset($_GET['delete_borrow_id'])){
$id=$_GET['delete_borrow_id'];
$sql="DELETE FROM borrow_items WHERE borrow_id=$id";
$result=mysqli_query($con,$sql);
if($result){
header('location:borrow.php');
}else{
die(mysqli_error($con));
}
}
?>