-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproducts_category.php
52 lines (51 loc) · 1.53 KB
/
products_category.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
<?php
session_start();
include('config/dbcon.php');
include('components/header.php');
include('components/navbar.php');
include('components/frontbar.php');
?>
<main>
<div class="categoty_container">
<div class="title">
<h1>Product Category</h1>
</div>
<div class="category">
<?php
$sql = "SELECT * FROM categories";
$result = mysqli_query($connection, $sql);
if ($result) {
if (mysqli_num_rows($result) > 0) {
foreach ($result as $items) {
if ($items["status"] != "Hidden") {
?>
<div class="each_category">
<a href="prodcuts.php?category=<?= $items["name"]; ?>">
<div class="image_container"><img src="admin/uploads/<?= $items["image"]; ?>" alt="<?= $items["name"]; ?>"></div>
<p><?= $items["name"]; ?></p>
</a>
</div>
<?php
}
}
} else {
?>
<div class="each_category">
<p>No Categories Avaliable!</p>
</div>
<?php
}
} else {
?>
<div class="each_category">
<p>Somehing Went Wrong! Sorry About that.</p>
</div>
<?php
}
?>
</div>
</div>
</main>
<?php
include('components/footer.php');
?>