-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcategory.php
441 lines (401 loc) · 14.2 KB
/
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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<?php
// we will only start the session with session_start() IF the session isn't started yet //
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
?>
<?php
// including the conn.php to establish connection with database //
include "conn.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- SITE TITTLE -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Category | Shoppa </title>
<link href="logo_image/favicon.png" rel="shortcut icon">
<!-- PLUGINS CSS STYLE -->
<!-- <link href="plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet"> -->
<!-- Bootstrap -->
<link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="plugins/bootstrap/css/bootstrap-slider.css">
<!-- Font Awesome -->
<link href="plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- Owl Carousel -->
<link href="plugins/slick-carousel/slick/slick.css" rel="stylesheet">
<link href="plugins/slick-carousel/slick/slick-theme.css" rel="stylesheet">
<!-- Fancy Box -->
<link href="plugins/fancybox/jquery.fancybox.pack.css" rel="stylesheet">
<link href="plugins/jquery-nice-select/css/nice-select.css" rel="stylesheet">
<!-- CUSTOM CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="body-wrapper">
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
<nav class="navbar navbar-expand-lg navbar-light navigation">
<a class="navbar-brand" href="index.html">
<img src="images/logo.png" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto main-nav ">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item dropdown dropdown-slide">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="">Dashboard<span><i class="fa fa-angle-down"></i></span>
</a>
<!-- Dropdown list -->
<div class="dropdown-menu">
<a class="dropdown-item" href="dashboard.html">Dashboard</a>
<a class="dropdown-item" href="dashboard-my-ads.html">Dashboard My Ads</a>
<a class="dropdown-item" href="dashboard-favourite-ads.html">Dashboard Favourite Ads</a>
<a class="dropdown-item" href="dashboard-archived-ads.html">Dashboard Archived Ads</a>
<a class="dropdown-item" href="dashboard-pending-ads.html">Dashboard Pending Ads</a>
</div>
</li>
<li class="nav-item dropdown dropdown-slide">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Pages <span><i class="fa fa-angle-down"></i></span>
</a>
<!-- Dropdown list -->
<div class="dropdown-menu">
<a class="dropdown-item" href="about-us.html">About Us</a>
<a class="dropdown-item" href="contact-us.html">Contact Us</a>
<a class="dropdown-item" href="user-profile.html">User Profile</a>
<a class="dropdown-item" href="404.html">404 Page</a>
<a class="dropdown-item" href="package.html">Package</a>
<a class="dropdown-item" href="single.html">Single Page</a>
<a class="dropdown-item" href="store.html">Store Single</a>
<a class="dropdown-item" href="single-blog.html">Single Post</a>
<a class="dropdown-item" href="blog.html">Blog</a>
</div>
</li>
<li class="nav-item dropdown dropdown-slide">
<a class="nav-link dropdown-toggle" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Listing <span><i class="fa fa-angle-down"></i></span>
</a>
<!-- Dropdown list -->
<div class="dropdown-menu">
<a class="dropdown-item" href="category.html">Ad-Gird View</a>
<a class="dropdown-item" href="ad-listing-list.html">Ad-List View</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto mt-10">
<li class="nav-item">
<a class="nav-link login-button" href="login.html">Login</a>
</li>
<li class="nav-item">
<a class="nav-link text-white add-button" href="ad-listing.html"><i class="fa fa-plus-circle"></i> Add Listing</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</section>
<section class="page-search">
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- Advance Search -->
<div class="advance-search">
<form>
<div class="form-row">
<div class="form-group col-md-8">
<input type="text" style="width:100%;" class="form-control my-2 my-lg-0" id="inputtext4" placeholder="What are you looking for">
</div>
<div class="form-group col-md-2">
<input type="button" id="btnSearch" class="btn btn-primary" value="Search Now">
</div>
<div class="form-group col-md-2">
<input type="button" id="btnBack" class="btn btn-primary" value="Cancel">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<section class="section-sm">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="category-sidebar">
<div class="widget category-list">
<h4 class="widget-header">All Category</h4>
<ul id="catlist" class="category-list">
<?php
$query = "SELECT * FROM category";
$execquery = mysqli_query($db, $query);
while($result = mysqli_fetch_array($execquery)){
?>
<li><input type="button" class="btnCategory" style="background:none;border:none;margin:10px;" value="<?php echo $result['category_name'] ?>"></li>
<?php
}
?>
</ul>
</div>
<div class="widget filter">
<h4 class="widget-header">Show Products</h4>
<select class="priceDesc">
<option value="low">Lowest Price</option>
<option value="high">Highest Price</option>
</select>
</div>
<div class="widget price-range w-100">
<h4 class="widget-header">Price Range</h4>
<div class="block">
<input id="slider1" class="range-track w-100" type="text" data-slider-min="0" data-slider-max="5000" data-slider-step="5"
data-slider-value="[0,5000]">
<div class="d-flex justify-content-between mt-2">
<span class="value">$10 - $5000</span>
</div>
<div class="d-flex justify-content-between mt-2">
<input id="btnGet" type="button" class="btn btn-primary" value="Get">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="product-grid-list">
<div id="allProduct" class="row mt-30"></div>
<div id="filterProduct" class="row mt-30"></div>
</div>
</div>
</div>
</div>
</section>
<!--============================
= Footer =
=============================-->
<footer class="footer section section-sm">
<!-- Container Start -->
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-7 offset-md-1 offset-lg-0">
<!-- About -->
<div class="block about">
<!-- footer logo -->
<img src="images/logo-footer.png" alt="">
<!-- description -->
<p class="alt-color">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
<!-- Link list -->
<div class="col-lg-2 offset-lg-1 col-md-3">
<div class="block">
<h4>Site Pages</h4>
<ul>
<li><a href="#">Boston</a></li>
<li><a href="#">How It works</a></li>
<li><a href="#">Deals & Coupons</a></li>
<li><a href="#">Articls & Tips</a></li>
<li><a href="terms-condition.html">Terms & Conditions</a></li>
</ul>
</div>
</div>
<!-- Link list -->
<div class="col-lg-2 col-md-3 offset-md-1 offset-lg-0">
<div class="block">
<h4>Admin Pages</h4>
<ul>
<li><a href="category.html">Category</a></li>
<li><a href="single.html">Single Page</a></li>
<li><a href="store.html">Store Single</a></li>
<li><a href="single-blog.html">Single Post</a>
</li>
<li><a href="blog.html">Blog</a></li>
</ul>
</div>
</div>
<!-- Promotion -->
<div class="col-lg-4 col-md-7">
<!-- App promotion -->
<div class="block-2 app-promotion">
<div class="mobile d-flex">
<a href="">
<!-- Icon -->
<img src="images/footer/phone-icon.png" alt="mobile-icon">
</a>
<p>Get the Dealsy Mobile App and Save more</p>
</div>
<div class="download-btn d-flex my-3">
<a href="#"><img src="images/apps/google-play-store.png" class="img-fluid" alt=""></a>
<a href="#" class=" ml-3"><img src="images/apps/apple-app-store.png" class="img-fluid" alt=""></a>
</div>
</div>
</div>
</div>
</div>
<!-- Container End -->
</footer>
<!-- Footer Bottom -->
<footer class="footer-bottom">
<!-- Container Start -->
<div class="container">
<div class="row">
<div class="col-sm-6 col-12">
<!-- Copyright -->
<div class="copyright">
<p>Copyright © <script>
var CurrentYear = new Date().getFullYear()
document.write(CurrentYear)
</script>. All Rights Reserved, theme by <a class="text-primary" href="https://themefisher.com" target="_blank">themefisher.com</a></p>
</div>
</div>
<div class="col-sm-6 col-12">
<!-- Social Icons -->
<ul class="social-media-icons text-right">
<li><a class="fa fa-facebook" href="https://www.facebook.com/themefisher" target="_blank"></a></li>
<li><a class="fa fa-twitter" href="https://www.twitter.com/themefisher" target="_blank"></a></li>
<li><a class="fa fa-pinterest-p" href="https://www.pinterest.com/themefisher" target="_blank"></a></li>
<li><a class="fa fa-vimeo" href=""></a></li>
</ul>
</div>
</div>
</div>
<!-- Container End -->
<!-- To Top -->
<div class="top-to">
<a id="top" class="" href="#"><i class="fa fa-angle-up"></i></a>
</div>
</footer>
<!-- JAVASCRIPTS -->
<script src="plugins/jQuery/jquery.min.js"></script>
<script src="plugins/bootstrap/js/popper.min.js"></script>
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/bootstrap/js/bootstrap-slider.js"></script>
<!-- tether js -->
<script src="plugins/tether/js/tether.min.js"></script>
<script src="plugins/raty/jquery.raty-fa.js"></script>
<script src="plugins/slick-carousel/slick/slick.min.js"></script>
<script src="plugins/jquery-nice-select/js/jquery.nice-select.min.js"></script>
<script src="plugins/fancybox/jquery.fancybox.pack.js"></script>
<script src="plugins/smoothscroll/SmoothScroll.min.js"></script>
<!-- google map -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCcABaamniA6OL5YvYSpB3pFMNrXwXnLwU&libraries=places"></script>
<script src="plugins/google-map/gmap.js"></script>
<script src="js/script.js"></script>
<!-- JQuery -->
<script>
//Load all product while page on load
$(window).on('load', function() { //run jqueery on page
$.ajax({
type: "POST",
url: "process_product.php",
data: {
display_all_product : 1,
},
success: function(respond){
$("#filterProduct").hide();
$("#allProduct").html(respond).show();
$("#btnBack").hide();
}
});
});
$("document").ready(function(){ //run code simultinouly when page loaded
$("#btnSearch").click( function(){
var search_name = $("#inputtext4").val().trim();
if(search_name == ""){
location.reload();
}else{
$.ajax({
type: "POST",
url: "process_product.php",
data: {
display_product : 1,
product_name : search_name
},
success: function(respond){
$("#btnBack").show();
$("#allProduct").hide();
$("#filterProduct").html(respond).show();
}
});
}
});
$("#btnBack").click( function(){
location.reload();
$("#btnBack").hide();
});
$("#catlist").find(".btnCategory").click(function () {
var catvalue = $(this).attr("value");
$.ajax({
type: "POST",
url: "process_product.php",
data: {
get_product_with_category : 1,
cat_name : catvalue
},
success: function(respond){
$("#btnBack").show();
$("#allProduct").hide();
$("#filterProduct").html(respond).show();
}
});
});
$("select.priceDesc").change(function(){
var selecteddesc = $(this).children("option:selected").val();
$.ajax({
type: "POST",
url: "process_product.php",
data: {
arrange_product : 1,
product_price : selecteddesc
},
success: function(respond){
$("#btnBack").show();
$("#allProduct").hide();
$("#filterProduct").html(respond).show();
}
});
});
$('.slider').on('slide', function (ev) {
console.log($('#slider1').val());
});
$("#btnGet").click( function(){
var value = $('#slider1').val();
$.ajax({
type: "POST",
url: "process_product.php",
data: {
get_product_with_price : 1,
product_price_range : value
},
success: function(respond){
$("#btnBack").show();
$("#allProduct").hide();
$("#filterProduct").html(respond).show();
}
});
});
});
</script>
</body>
</html>
<?php
mysqli_close($db);
exit();
?>