-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct.php
119 lines (92 loc) · 3.64 KB
/
product.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
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
<?php
include 'components/header.php';
include ('components/sidebar.php');
session_start();
if (!isset($_SESSION['username'])){
header("Location: login.php");
} elseif(isset($_SESSION['username'])){
if($_SESSION['role'] === 'customer'){
header("Location: dashboarduser.php");
} elseif ($_SESSION['role'] === 'cashier'){
header("Location: dashboardcashier.php");
}
}
$product = query("SELECT * FROM product");
?>
<!DOCTYPE html>
<html lang="en">
<header id="header" class="header fixed-top d-flex align-items-center">
<div class="d-flex align-items-center justify-content-between">
<a href="usersetting.html" class="logo d-flex align-items-center">
<img src="assets/img/logo.png" alt="" />
<span class="d-none d-lg-block">PRES U Caffe</span>
</a>
<i class="bi bi-list toggle-sidebar-btn"></i>
</div>
<!-- End Search Bar -->
<nav class="header-nav ms-auto">
<ul class="d-flex align-items-center">
<li class="nav-item d-block d-lg-none">
<a class="nav-link nav-icon search-bar-toggle" href="#">
<i class="bi bi-search"></i>
</a>
</li>
<!--End Search Icon-->
<!-- End Profile Nav -->
</ul>
</nav>
<!-- End Icons Navigation -->
</header>
<main id="main" class="main">
<div class="pagetitle">
<h3>Product</h3>
</div>
<!-- End Page Titsle -->
<a href="addproduct.php" type="button" class="btn btn-primary" data-mdb-toggle="modal" data-mdb-target="#exampleModal">
ADD
</a>
<!-- Recent Sales -->
<table class="table table-borderless datatable">
<thead>
<tr>
<th scope="col">No</th>
<th scope="col">Product Name</th>
<th scope="col">Description</th>
<th scope="col">Type</th>
<th scope="col">Qty</th>
<th scope="col">Price</th>
<th scope="col">Action</th>
</tr>
</thead>
<!-- Button trigger modal -->
<!-- Modal -->
<tbody>
<?php foreach( $product as $p) : ?>
<?php static $productNum = 0; $productNum++; ?>
<tr>
<th scope="row"><a href="#"> <?php echo $productNum ?> </a></th>
<td> <?php echo $p['productName'] ?></td>
<td> <?php echo $p['productDesc'] ?></td>
<td> <?php echo $p['productType'] ?></td>
<td> <?php echo $p['productQty'] ?></td>
<td> <?php echo $p['productPrice'] ?></td>
<td>
<a href="editproduct.php?productId=<?php echo $p['productId']?>" type="button" class="btn btn-primary" data-mdb-toggle="modal"
data-mdb-target="#exampleModal">
Edit
</a>
<a href="deleteProduct.php?id=<?php echo $p['productId']?>" type="button" class="btn btn-danger" data-mdb-toggle="modal"
data-mdb-target="#exampleModal">
Delete
</a>
</td>
<?php endforeach; ?>
</tbody>
</table>
<!-- End Recent Sales -->
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
<script src="assets/js/mdb.min.js.map"></script>
<script src="assets/js/mdb.min"></script>
</body>
</html>