Repository navigation
Expand file tree
/
Copy pathcategories.php
More file actions
75 lines (55 loc) · 2.59 KB
/
Copy pathcategories.php
File metadata and controls
75 lines (55 loc) · 2.59 KB
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
<?php include("partials-front/menu-front.php") ?>
<!-- CAtegories Section Starts Here -->
<div class="blur-food">
<div class="all-foods" >
<div class="title-all-food">
<h2>CATEGORIES</h2>
</div>
<div class="all-foods2">
<div class="border-foods background-none" style="padding:0;border: none">
<?php
$sql="SELECT * from tbl_category where tbl_category.active='Yes' ";
$stmt=$db->prepare($sql);
$stmt->execute();
$row2=$stmt->fetchAll();
if (count($row2)>0) {
foreach ($row2 as $row ) {
$title=$row["title"];
$id=$row["id"];
if ($row['image_name']=="" or $row['image_name']==null ) {
$image_name="images/category-image/no-image.webp";
}
else {
$image_name="images/category-image/".$row['image_name'];
if (file_exists($image_name)) {
$image_name=$image_name;
}
else {
$image_name="images/category-image/no-image.webp";
}
}
echo '
<div class="box1-Categories space-box1-Categories" style="background-image: url('.$image_name.');">
<div class="border-categories border-categories-all">
<h2>'.$title.'</h2>
<a href="category-foods?id='.$id.'" class="btn">
CHEK CATEGORIES
</a>
</div>
</div>
';
}
}
else {
echo '
<div class="nope">
Nothing
</div>
';
}
?>
</div>
</div>
</div>
</div>
<?php include("partials-front/footer-front.php") ?>