-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.php
56 lines (43 loc) · 1.84 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
<div class="page-header">
<h1>Categories</h1>
<p>List of most <br>by our users. Check whats going on in the city now.</p>
</div><!-- /.page-header -->
<div class="block background-white fullwidth mt80 mb-80">
<div class="categories">
<ul>
<?php
$sqlQuery = "select feat.category, biz.business_name, biz.about, biz.logo
from featured as feat,
add_business as biz
where
biz.id = feat.bussID";
$query1 = mysqli_query($conn, $sqlQuery);
while($result1 = mysqli_fetch_assoc($query1)){
?>
<li>
<a href="#" class="categories-action">Submit</a>
<a href="category.php?list=<?php echo $result1['category']; ?>" class="categories-link"><i class="fa fa-suitcase"></i><?php echo $result1['category']; ?></a>
<ul>
<?php
$current_category = $result1['category'];
$categoryQuery = "select subcategory_name from subcategories where category_id in (select category_id from category where category_name = '$current_category')";
$queryCat = mysqli_query($conn, $categoryQuery);
while($catresult = mysqli_fetch_assoc($queryCat)){
?>
<li><a href="#"><?php echo $catresult['subcategory_name']; ?></a>,</li>
<?php
}
?>
<li><a href="#"><?php echo $result1['business_name']; ?></a>,</li>
<li class="all"><a href="#"><?php
$text = $result1['about'];
if(strlen($text) > 40){ $text = substr($text, 0, 30);
echo $text;
}
?> <i class="fa fa-chevron-right"></i></a></li>
</ul>
</li>
<?php } ?>
</ul>
</div><!-- /.categories -->
</div>