-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcategories.php
45 lines (42 loc) · 2.24 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
<?php include( "./partials-front/menu.php" ) ?>;
<!-- CAtegories Section Starts Here -->
<section class ="categories">
<div class="container">
<h2 class="text-center">Explore Foods</h2>
<?php
$sql = "SELECT * FROM resto_category WHERE active = 'yes'";
$result = mysqli_query( $conn, $sql );
$rows = mysqli_num_rows($result);
if( $rows ) {
while( $row = mysqli_fetch_assoc( $result ) ) {
$id = isset( $row['ID'] ) ? $row['ID'] : '';
$title = isset( $row['title'] ) ? $row['title']: '';
$image_name = isset( $row['image_name'] ) ? $row['image_name'] : '';
$featured = isset( $row['featured'] ) ? $row['featured'] : '';
$active = isset( $row['active'] ) ? $row['active'] : '';
?>
<a href="<?php echo SITE_URL.'category-foods.php?category_id='.$id; ?>">
<div class="box-3 float-container box-3-text zoom-in">
<?php
if( !empty( $image_name ) ) {
?>
<img src="<?php echo SITE_URL.'images/category/'.$image_name; ?>" alt="<?php echo $title; ?>" class="img-responsive img-curve">
<?php
} else {
echo '<div class="error">Image Not Found</div>';
}
?>
<h3 class="float-text text-white"><?php echo $title; ?></h3>
</div>
</a>
<?php
}
} else {
echo '<div class="error">Category Not Found</div>';
}
?>
<div class="clearfix"></div>
</div>
</section>
<!-- Categories Section Ends Here -->
<?php include( "./partials-front/footer.php" ) ?>;