-
Notifications
You must be signed in to change notification settings - Fork 0
/
categoryDetails.php
87 lines (78 loc) · 3.22 KB
/
categoryDetails.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
<?php
session_start();
include("include/connect.php");
$id = $_GET['id'];
$query1 = "select * from category";
$results1 = mysqli_query($conn,$query1) or die("Cannot connect");
$name = "select * from category WHERE id=$id";
$res_name = mysqli_query($conn, $name);
$query2 = "select * from product WHERE category_id=$id";
$results2 = mysqli_query($conn,$query2) or die("Cannot connect");
$t = mysqli_num_rows($results2);
?>
<!doctype html>
<html lang="en">
<head>
</head>
<?php include ('header.php')?>
<body>
<!---- content box--->
<div class="ui main container">
<div class="ui grid">
<div class="three wide column">
<div class="ui vertical menu">
<a class="item">
<div class="header"><h3>Products Categories</div>
</a>
<?php
while ($row = mysqli_fetch_assoc($results1))
{
?>
<a class="item" href="categoryDetails.php?id=<?php echo $row['id']; ?>" > <?php echo strtoupper($row['name']); ?> </a>
<?php } ?>
</div>
</div>
<div class="thirteen wide column">
<h3>Category: <?php while ($row = mysqli_fetch_array($res_name))
{
echo strtoupper($row['name']);
}?>
<div style="float: right"><?php echo $t ?>+ featured products</div> </h3>
<div class="ui three column grid">
<?php
while ($row = mysqli_fetch_assoc($results2))
{
?>
<div class="column">
<div class="ui segment">
<a class="item">
<center>
<img src='product_images/<?php echo $row["prod_image"]?>'> <br>
<strong><?php echo mb_strtoupper($row["name"]);?></strong><br>
Price : Rs
<?php echo $row["price"];?><br>
<div class="ui vertical animated button" tabindex="0">
<div class="hidden content"> <a href="productDetails.php?id=<?php echo $row["id"]?>">Shop</a></div>
<div class="visible content">
<i class="shop icon"></i>
</div>
</div>
<div class="ui animated google button" tabindex="0">
<div class="hidden content"> <a href="productDetails.php?id=<?php echo $row["id"]?>">Details</a></div>
<div class="visible content">
<i class="content icon"></i>
</div>
</div>
</center>
</a>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<!----- footer------>
<?php include ('footer.php')?>
</body>
</html>