-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpricelist.php
54 lines (45 loc) · 1.1 KB
/
pricelist.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
<?php include 'includes/header.php';?>
<?php
//including the database connection file
include_once("connection.php");
//fetching data in descending order (lastest entry first)
$result = mysqli_query($mysqli, "SELECT * FROM products ORDER BY id DESC");
?>
<h2 class="head3">View Pricelist</h2>
<br>
<div class="container">
<div class="flex">
<label>Search</label>
<input type="text" placeholder="Search..">
<br>
<br>
<a class="btn btn-primary" href="updateprice.php">Update Prices</a>
<br>
</div>
</div>
<br>
<div class="container">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Item</th>
<th scope="col">Description</th>
<th scope="col">Min Price</th>
<th scope="col">Max Price</th>
</tr>
</thead>
<tbody>
<?php
while($res = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>".$res['id']."</td>";
echo "<td>".$res['name']."</td>";
echo "<td>".$res['description']."</td>";
echo "<td>".$res['min_price']."</td>";
echo "<td>".$res['max_price']."</td>";
}
?>
</tbody>
</table>
</div>