-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproductByCategory.php
172 lines (167 loc) · 9.93 KB
/
productByCategory.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
require_once __DIR__. "/autoload/autoload.php";
$id = intval(getInput('id'));
$sql = " SELECT * FROM `products` WHERE `categoryID` = $id";
$products = $db->fetchsql($sql);
$currentCategory = $db->fetchID('categories',$id)
?>
<?php require_once __DIR__. "/layouts/header.php";?>
<!-- Breadcrumb Section Begin -->
<section class="breadcrumb-section set-bg" data-setbg="public/frontend/img/breadcrumb.jpg">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<div class="breadcrumb__text">
<h2>Sneaker Lord</h2>
<div class="breadcrumb__option">
<a href="./index.php">Home</a>
<span><?php echo $currentCategory['name'];?></span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Breadcrumb Section End -->
<!-- Product Section Begin -->
<section class="product spad">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-5">
<div class="sidebar">
<div class="sidebar__item">
<h4>Categories</h4>
<ul>
<?php foreach($categories as $item) : ?>
<li ><a href="productByCategory.php?id=<?php echo $item['id'] ?>"><?php echo $item['name'] ?></a></li>
<?php endforeach ?>
</ul>
</div>
<div class="sidebar__item">
<h4>Price</h4>
<div class="price-range-wrap">
<div class="price-range ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"
data-min="10" data-max="540">
<div class="ui-slider-range ui-corner-all ui-widget-header"></div>
<span tabindex="0" class="ui-slider-handle ui-corner-all ui-state-default"></span>
<span tabindex="0" class="ui-slider-handle ui-corner-all ui-state-default"></span>
</div>
<div class="range-slider">
<div class="price-input">
<input type="text" id="minamount">
<input type="text" id="maxamount">
</div>
</div>
</div>
</div>
<div class="sidebar__item">
<div class="latest-product__text">
<h4>Latest Products</h4>
<!-- <div class="latest-product__slider owl-carousel">
<div class="latest-prdouct__slider__item">
<a href="#" class="latest-product__item">
<div class="latest-product__item__pic">
<img src="public/frontend/img/latest-product/lp-1.jpg" alt="">
</div>
<div class="latest-product__item__text">
<h6>Crab Pool Security</h6>
<span>$30.00</span>
</div>
</a>
<a href="#" class="latest-product__item">
<div class="latest-product__item__pic">
<img src="public/frontend/img/latest-product/lp-2.jpg" alt="">
</div>
<div class="latest-product__item__text">
<h6>Crab Pool Security</h6>
<span>$30.00</span>
</div>
</a>
<a href="#" class="latest-product__item">
<div class="latest-product__item__pic">
<img src="public/frontend/img/latest-product/lp-3.jpg" alt="">
</div>
<div class="latest-product__item__text">
<h6>Crab Pool Security</h6>
<span>$30.00</span>
</div>
</a>
</div>
<div class="latest-prdouct__slider__item">
<a href="#" class="latest-product__item">
<div class="latest-product__item__pic">
<img src="public/frontend/img/latest-product/lp-1.jpg" alt="">
</div>
<div class="latest-product__item__text">
<h6>Crab Pool Security</h6>
<span>$30.00</span>
</div>
</a>
</div>
</div> -->
</div>
</div>
</div>
</div>
<div class="col-lg-9 col-md-7">
<div class="product__discount">
<div class="section-title product__discount__title">
<h2><?php echo $currentCategory['name'];?></h2>
</div>
</div>
<div class="filter__item">
<div class="row">
<div class="col-lg-4 col-md-5">
<div class="filter__sort">
<span>Sort By</span>
<select>
<option value="0">Default</option>
<option value="0">Default</option>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4">
<div class="filter__found">
<h6><span>16</span> Products found</h6>
</div>
</div>
<div class="col-lg-4 col-md-3">
<div class="filter__option">
<span class="icon_grid-2x2"></span>
<span class="icon_ul"></span>
</div>
</div>
</div>
</div>
<div class="row">
<?php foreach($products as $item): ?>
<div class="col-lg-4 col-md-6 col-sm-6">
<div class="product__item">
<div class="product__item__pic set-bg" data-setbg="public/uploads/products/<?php echo $item['image'] ?>">
<ul class="product__item__pic__hover">
<li><a href="#"><i class="fa fa-heart"></i></a></li>
<li><a href="#"><i class="fa fa-retweet"></i></a></li>
<li><a href="#"><i class="fa fa-shopping-cart"></i></a></li>
</ul>
</div>
<div class="product__item__text">
<h6><a href="detailProduct.php?id=<?php echo $item['id'] ?>"><?php echo $item['name'] ?></a></h6>
<h5><?php echo formatPrice($item['price']) ?> VND</h5>
</div>
</div>
</div>
<?php endforeach;?>
<!-- items show up -->
</div>
<div class="product__pagination">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#"><i class="fa fa-long-arrow-right"></i></a>
</div>
</div>
</div>
</div>
</section>
<!-- Product Section End -->
<?php require_once __DIR__. "/layouts/footer.php"; ?>