-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_product_delete.php
63 lines (56 loc) · 1.79 KB
/
admin_product_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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SandoCA</title>
<link rel="stylesheet" type="text/css" href="assets/bootstrap-3.3.6-dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" id="topnav">
<div class="container-fluid">
<div class="navbar-header">
<a href="index.php" class="navbar-brand">SandoCA</a>
</div>
</div>
</div>
<p><br><br></p>
<p><br><br></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" id="err_msg"></div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="panel panel-primary">
<div class="panel-heading">Delete Product</div>
<div class="panel-body">
<?php
session_start();
include('dbconnect.php');
if (isset($_GET['id'])) {
$product_id = $_GET['id'];
// Delete the Product
$delete_query = "DELETE FROM products WHERE product_id = '$product_id'";
if ($conn->query($delete_query) == TRUE) {
echo "Product deleted successfully. <a href='admin_product_management.php'>Go back</a>";
} else {
echo "Error deleting product: " . $conn->error;
}
} else {
echo "Prdouct ID not provided.";
}
?>
</div>
</div>
<a href="admin_product_management.php">Back to Product Management</a>
<div class="panel-footer"></div>
</div>
</div>
<div class="col-md-2"></div>
</div>
</body>
</html>