-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathleft_side.php
155 lines (121 loc) · 5.11 KB
/
left_side.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
<div class="left-sidebar">
<h2>Category</h2>
<div class="panel-group category-products" id="accordian"><!--category-productsr-->
<div class="panel panel-default">
<?php
//Category accessed
$statement1=$db->prepare('select * from tbl_products_category');
$statement1->execute();
$result1=$statement1->fetchAll(PDO::FETCH_ASSOC);
foreach($result1 as $row1)
{
$statement2 = $db->prepare("SELECT DISTINCT p_cat_id FROM tbl_products_subcategory");
$statement2->execute();
$result2 = $statement2->fetchAll(PDO::FETCH_ASSOC);
foreach ($result2 as $row2) {
if($row1['p_cat_id'] == $row2['p_cat_id']){
?>
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordian" href="#sportswear<?php echo $row1['p_cat_id']; ?>">
<span class="badge pull-right"><i class="fa fa-plus"></i></span>
<?php echo $row1['p_cat_name']; ?>
</a>
</h4>
</div>
<div id="sportswear<?php echo $row1['p_cat_id']; ?>" class="panel-collapse collapse">
<div class="panel-body">
<ul>
<?php
$statement3=$db->prepare('select * from tbl_products_subcategory where p_cat_id=?');
$statement3->execute(array($row2['p_cat_id']));
$result3=$statement3->fetchAll(PDO::FETCH_ASSOC);
foreach($result3 as $row3)
{
?>
<li><a href="subcat_product.php?cat_id=<?php echo $row2['p_cat_id'];?> & subcat_id=<?php echo $row3['p_subcat_id'];?>"><?php echo $row3['p_subcat_name']; ?></a></li>
<?php
}
?>
</ul>
</div>
</div>
<?php
}
}
}
?>
<div class="panel-heading">
<?php
$statement4 = $db->prepare("SELECT * FROM tbl_products_category WHERE p_cat_id NOT IN(SELECT DISTINCT p_cat_id FROM tbl_products_subcategory)");
$statement4->execute();
$result4 = $statement4->fetchAll(PDO::FETCH_ASSOC);
foreach ($result4 as $row4) {
?>
<h4 class="panel-title">
<a href="cat_product.php?c_id=<?php echo $row4['p_cat_id']; ?>">
<?php echo $row4['p_cat_name']; ?>
</a>
</h4>
<?php
}
?>
</div>
</div><!--/category-products-->
<div class="brands_products"><!--brands_products-->
<h2>Brands</h2>
<div class="brands-name">
<ul class="nav nav-pills nav-stacked">
<?php
$brand_statement=$db->prepare("select * from tbl_products_brand ");
$brand_statement->execute();
$brand_result=$brand_statement->fetchAll(PDO::FETCH_ASSOC);
foreach($brand_result as $brandrow)
{
?>
<li><a href="brand_product.php?b_id=<?php echo $brandrow['p_brand_id'];?>"> <span class="pull-right"><?php
$product_count=$db->prepare("select COUNT(*) as count from tbl_products where p_brand_id=?");
$product_count->execute(array($brandrow['p_brand_id']));
$count_result=$product_count->fetch();
?><?php echo "(".$count_result['count'].")" ; ?></span><?php echo $brandrow['p_brand_name'] ?></a>
</li>
<?php
}
?>
</ul>
</div>
</div><!--/brands_products-->
<div class="price-range"><!--price-range-->
<h2>Price Range</h2>
<?php
$a=1;
$b=1000;
?>
<div class="well text-center" style="padding:20px">
<ul class="nav nav-pills nav-stacked">
<?php
for($i=0;$i<5;$i++)
{
?>
<li><a href="product_by_price.php?a=<?php echo $a;?> & b=<?php echo $b; ?>">$<?php echo $a;?> - $<?php echo $b; ?></a></li>
<?php
$a=$a+1000;
$b=$b+1000;
}
if($i==5)
{
?>
<li><a href="product_by_price.php?a=<?php echo $a;?> & b=<?php
$b=$b+20000;
echo $b; ?>">$<?php echo $a;?> - $Above</a></li>
<?php
}
?>
</ul>
</div>
</div><!--/price-range-->
<div class="shipping text-center"><!--shipping-->
<img src="images/home/shipping.jpg" alt="" />
</div><!--/shipping-->
</div>
</div>