-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdelete.php
More file actions
146 lines (125 loc) · 4.33 KB
/
delete.php
File metadata and controls
146 lines (125 loc) · 4.33 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
include('session.php');
if($start == 1 || $start == 2){
$id=$_GET['id'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--==================== UNICONS ====================-->
<link
rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.0/css/line.css"
/>
<!--==================== SWIPER CSS ====================-->
<link
rel="stylesheet"
href="https://www.rahcode.com/assets/css/swiper-bundle.min.css"
/>
<!--==================== CSS ====================-->
<link
rel="stylesheet"
href="https://www.rahcode.com/assets/css/styles.css"
/>
<title>delete</title>
</head>
<body>
<!--==================== HEADER ====================-->
<header class="header" id="header">
<nav class="nav container">
<a href="/" class="nav__logo">inventory.php</a>
<div class="nav__menu" id="nav-menu">
<ul class="nav__list grid">
<li class="nav__item">
<a href="#" class="nav__link">
<i class="uil uil-at nav__icon"></i>
Hello "<?php echo $user ?>"
</a>
</li>
<?php
if($start == 1){
?>
<li class="nav__item">
<a href="users.php" class="nav__link">
<i class="uil uil-user nav__icon"></i>
Users
</a>
</li>
<li class="nav__item">
<a href="docs/" class="nav__link">
<i class="uil uil-arrow-circle-up nav__icon"></i>
Update
</a>
</li>
<?php
}
?>
<li class="nav__item">
<a href="logout.php" class="nav__link">
<i class="uil uil-signout nav__icon"></i>
Logout
</a>
</li>
</ul>
<i class="uil uil-times nav__close" id="nav-close"></i>
</div>
<div class="nav__btns">
<!-- Theme change button -->
<i class="uil uil-moon change-theme" id="theme-button"></i>
<div class="nav__toggle" id="nav-toggle">
<i class="uil uil-apps"></i>
</div>
</div>
</nav>
</header>
<!--==================== MAIN ====================-->
<main class="main">
<!--==================== ABOUT ====================-->
<section class="about section" id="about">
<h2 class="section__title">Delete</h2>
<span class="section__subtitle">Product</span>
<div class="about__container container grid">
<div class="about__data">
<p class="about__description">
Are you sure you want to remove this product?
<br>
<br>
<a href="?id=<?php echo $id ?>&action=yes" class="button button--flex">
Yes
</a>
<br>
<br>
<a href="/" class="button button--flex">
No
</a>
</p>
</div>
</div>
</section>
</main>
<!--==================== FOOTER ====================-->
<footer class="footer" id="foot"></footer>
<!--==================== SCROLL TOP ====================-->
<a href="#" class="scrollup" id="scroll-up">
<i class="uil uil-arrow-up scrollup__icon"></i>
</a>
<!--==================== SWIPER JS ====================-->
<script src="https://www.rahcode.com/assets/js/swiper-bundle.min.js"></script>
<!--==================== MAIN JS ====================-->
<script src="https://www.rahcode.com/assets/js/main.js" type="module"></script>
</body>
</html>
<?php
if(isset($_GET['action'])){
$action=$_GET['action'];
if($action=='yes'){
mysqli_query($conn,"DELETE FROM `products` WHERE id = '$id'");
header('Location: inventory.php');
}
}
}else{
echo "<script> alert('You are not allowed to do this');window.location= 'inventory.php' </script>";
}
?>