-
Notifications
You must be signed in to change notification settings - Fork 0
/
list-discount.php
114 lines (95 loc) · 4.71 KB
/
list-discount.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
<?php
include './inc/database.inc.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include "./admin-head.php"; ?>
</head>
<body class="layout-4">
<!-- Page Loader -->
<div class="page-loader-wrapper">
<span class="loader"><span class="loader-inner"></span></span>
</div>
<div id="app">
<div class="main-wrapper main-wrapper-1">
<div class="navbar-bg"></div>
<?php include "./admin-header.php"; ?>
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>Discounts List</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item active"><a href="admin-index.php">Dashboard</a></div>
<div class="breadcrumb-item">Discounts List</div>
</div>
</div>
<div class="section-body">
<h2 class="section-title">Discounts</h2>
<p class="section-lead">Here are all the registered Discounts.</p>
<div class="row">
<div class="col-12 col-md-12 col-lg-12">
<div class="card">
<div class="card-header">
<h4>Discounts</h4>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped table-md v_center">
<tr>
<th>ID</th>
<th>Product Name</th>
<th>Discount</th>
<th>Action</th>
</tr>
<?php
$res = $db->get_entities('discount');
while ($row = mysqli_fetch_array($res)) {
?>
<tr>
<td><?= $row["id"] ?></td>
<td><?php
$product_id = $row["product_id"];
echo $db->get_entity('product', $product_id)["name"];
?></td>
<td><?= $row["discount_percentage"] * 100 ?>%</td>
<td><a href="details-user.php?id=<?= $row["id"] ?>" class="btn btn-secondary">Detail</a> / <a href="delete-confirm-user.php?id=<?= $row["id"] ?>" class="btn btn-danger">Delete</a></td>
</tr>
<?php }
if ($res->num_rows == 0) {
echo "<tr><td colspan='7'><div class='alert alert-danger'>No Discounts found!</div></td></tr>";
} ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- Start app Footer part -->
<footer class="main-footer">
<div class="footer-left">
<div class="bullet"></div> Smart Cart System
</div>
<div class="footer-right">
</div>
</footer>
</div>
</div>
<!-- General JS Scripts -->
<script src="assets/bundles/lib.vendor.bundle.js"></script>
<script src="js/CodiePie.js"></script>
<!-- JS Libraies -->
<script src="assets/modules/jquery-ui/jquery-ui.min.js"></script>
<!-- Page Specific JS File -->
<script src="js/page/components-table.js"></script>
<!-- Template JS File -->
<script src="js/scripts.js"></script>
<script src="js/custom.js"></script>
</body>
<!-- components-table.html Tue, 07 Jan 2020 03:37:13 GMT -->
</html>
<!-- Start app main Content -->