-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategories.php
executable file
·159 lines (149 loc) · 6.6 KB
/
categories.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
<?php
require('top.php');
if(!isset($_GET['id']) && $_GET['id']!=''){
?>
<script>
window.location.href='index.php';
</script>
<?php
}
$cat_id=mysqli_real_escape_string($con,$_GET['id']);
$sub_categories='';
if(isset($_GET['sub_categories'])){
$sub_categories=mysqli_real_escape_string($con,$_GET['sub_categories']);
}
$price_high_selected="";
$price_low_selected="";
$new_selected="";
$old_selected="";
$sort_order="";
$sort_rating="";
$sort_rating_low="";
if(isset($_GET['sort'])){
$sort=mysqli_real_escape_string($con,$_GET['sort']);
if($sort=="price_high"){
$sort_order=" order by product.price desc ";
$price_high_selected="selected";
}if($sort=="price_low"){
$sort_order=" order by product.price asc ";
$price_low_selected="selected";
}if($sort=="new"){
$sort_order=" order by product.id desc ";
$new_selected="selected";
}if($sort=="old"){
$sort_order=" order by product.id asc ";
$old_selected="selected";
}if($sort=="rate_high"){
$sort_order=" order by product.Rating desc ";
$sort_rating="selected";
}if($sort=="rate_low"){
$sort_order=" order by product.Rating asc ";
$sort_rating_low="selected";
}
}
if($cat_id>0 && ($sub_categories!='' && $sub_categories>=0)){
$get_product=get_product($con,'',$cat_id,'','',$sort_order,'',$sub_categories);
}else{
?>
<script>
window.location.href='index.php';
</script>
<?php
}
?>
<!-- <div class="body__overlay"></div> -->
<!-- Start Bradcaump area -->
<div class="ht__bradcaump__area" style="background: rgba(0, 0, 0, 0) url(images/bg/4.jpg) no-repeat scroll center center / cover ;">
<div class="ht__bradcaump__wrap">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="bradcaump__inner">
<nav class="bradcaump-inner">
<a class="breadcrumb-item" href="index.php">Home</a>
<span class="brd-separetor"><i class="zmdi zmdi-chevron-right"></i></span>
<span class="breadcrumb-item active">Products</span>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Bradcaump area -->
<!-- Start Product Grid -->
<section class="htc__product__grid bg__white ptb--100">
<div class="container">
<div class="row">
<?php if(count($get_product)>0){?>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="htc__product__rightidebar">
<div class="htc__grid__top">
<div class="htc__select__option">
<select class="ht__select" onchange="sort_product_drop('<?php echo $cat_id?>','<?php echo $sub_categories?>','<?php echo SITE_PATH?>')" id="sort_product_id">
<option value="">Default softing</option>
<option value="price_low" <?php echo $price_low_selected?>>Sort by price low to hight</option>
<option value="price_high" <?php echo $price_high_selected?>>Sort by price high to low</option>
<option value="new" <?php echo $new_selected?>>Sort by new first</option>
<option value="old" <?php echo $old_selected?>>Sort by old first</option>
<option value="rate_high" <?php echo $sort_rating?>>Sort by Rating high to low</option>
<option value="rate_low" <?php echo $sort_rating_low?>>Sort by Rating low to high</option>
</select>
</div>
</div>
<!-- Start Product View -->
<div class="row">
<div class="shop__grid__view__wrap">
<div role="tabpanel" id="grid-view" class="single-grid-view tab-pane fade in active clearfix">
<?php
foreach($get_product as $list){
$rating = $list['Rating'];
?>
<!-- Start Single Category -->
<div class="col-md-4 col-lg-3 col-sm-4 col-xs-12">
<div class="category">
<div class="ht__cat__thumb">
<a href="product.php?id=<?php echo $list['id']?>">
<img src="<?php echo PRODUCT_IMAGE_SITE_PATH.$list['image']?>" alt="product images">
</a>
</div>
<div class="fr__hover__info">
<ul class="product__action">
<li><a href="javascript:void(0)" onclick="wishlist_manage('<?php echo $list['id']?>','add')"><i class="icon-heart icons"></i></a></li>
<li><a href="javascript:void(0)" onclick="manage_cart('<?php echo $list['id']?>','add')"><i class="icon-handbag icons"></i></a></li>
</ul>
</div>
<div class="fr__product__inner">
<h4><a href="product.php?id=<?php echo $list['id']?>"><?php echo $list['name']?></a></h4>
<ul class="fr__pro__prize">
<li class="old__prize"><?php echo $list['mrp']?></li>
<li><?php echo $list['price']?></li>
</ul>
</div>
<h4>Rating: </h4>
<ul class="rating">
<?php
for ($i=0; $i < $rating; $i++) {
echo '<li><i class="icon-star icons"></i></li>';
}
for ($i=0; $i < 5-$rating; $i++) {
echo '<li class="old"><i class="icon-star icons"></i></li>';
} ?>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php } else {
echo "Data not found";
} ?>
</div>
</div>
</section>
<!-- End Product Grid -->
<!-- End Banner Area -->
<input type="hidden" id="qty" value="1"/>
<?php require('footer.php')?>