-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullblog.php
96 lines (68 loc) · 2.88 KB
/
fullblog.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
<?php
include('partial-front/menu.php');
?>
<br>
<br>
<br>
<nr>
<!-- blog sEARCH Section Starts Here -->
<section class="blog-search text-center">
<div class="container">
<form action="<?php echo SITEURL;?>blog-search.php" method="POST">
<input class="search_option" type="search" name="search" placeholder="Search for content.." required>
<input type="submit" name="submit" value="Search" class="btn btn-primary">
</form>
</div>
</section>
<!-- blog sEARCH Section Ends Here -->
<!-- blog MEnu Section Starts Here -->
<section class="blog-menu" >
<div class="container">
<h2 class="text-center">Blogs</h2>
<?php
//display blog that are active
$sql = "SELECT *FROM tbl_blog WHERE active ='yes'";
$res=mysqli_query($conn,$sql);
$count = mysqli_num_rows($res);
if($count>0){
while($row=mysqli_fetch_assoc($res)){
$id=$row['id'];
$title=$row['title'];
$discription=$row['discription'];
$image_name=$row['image_name'];
?>
<div class="blog-menu-box" style="width: 80%;" >
<div class="blog-menu-img" >
<?php
if($image_name==""){
//image not available
echo "<div class='error'>image not available<?div>";
}else{
?>
<img src="<?php echo SITEURL?>images/blog/<?php echo $image_name?>" alt="image" class=" img-curve" style="margin-left: 200px; margin-top:20px;">
<?php
}
?>
</div>
<div class="blog-menu-desc" style="margin: 30px;" >
<h4 style=" text-align:center;"><?php echo $title;?></h4>
<p class="blog-detail">
<?php echo $discription;?>
</p>
<br>
<a href="<?php echo SITEURL;?>fullblog.php" class="btn btn-primary">Know more</a>
</div>
</div>
<?php
}
}else{
echo "<div class='error'>blog not found</div>";
}
?>
<div class="clearfix"></div>
</div>
</section>
<!-- blog Menu Section Ends Here -->
<?php
include('partial-front/footer.php');
?>