<?php 
error_reporting(0);
	include("../include/config.php");
	
 $ptitle = "All Blogs";
    $pkeywords = "All Blogs";
    $pdesc = "All Blogs";
	include("../include/header.php");
?>
<section class="page-banner-wrap d-flex align-items-center">
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="page-banner">
					<h2>All Blog</h2>
					<ul>
						<li><a href="<?php echo $base_url;?>">home</a></li>
						<li><a href="javascript:void(0);">blog</a></li>
<!--						<li><a href="#">title</a></li>-->
					</ul>
				</div>
			</div>
		</div>
	</div>
</section> <!-- /.page-banner-wrap -->


	<!-- blog section -->
	<section class="blog-section section-padding" id="myBlog">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="utf-section-heading utf-page-heading">
						<h2 class="utf-section-title">Blog <span class="featured"><span>News</span></span></h2>
						<div class="animated-bar"></div>
						<p class="text-max-700">Here I’ll Share Some of My Work Experience and also Some Tips & Tricks.</p>
					</div>
				</div>
			</div>
			
			<div class="row">
			<?php
				 $sqlblogs = "select * from `blog` WHERE `status` = 'active' ORDER BY `blog`.`id` DESC;";
    $resultblogs = mysqli_query($conn, $sqlblogs);											
    if (mysqli_num_rows($resultblogs) > 0) {
		$countblogs=mysqli_num_rows($resultblogs);
        $i=1;
        while($rowblog = mysqli_fetch_assoc($resultblogs)) {
            $det_det_id = $rowblog['id'];
			$blogs_categ_id = $rowblog['blogs_categ_id'];
            $det_title = $rowblog['title'];
            $deg_title1=substr($det_title,0,70);
            //  $deg_title1;
            $det_blogs_details = $rowblog['blogs_details'];
            $det_post_by = $rowblog['post_by'];
			$date_add = $rowblog['date_add'];
            $det_picture = $rowblog['picture'];
			$det_keyword = $rowblog['keyword'];
			$det_url = $rowblog['url'];
			$det_description = $rowblog['description'];  
			
			?>
				<div class="col-lg-4 col-md-6 col-sm-12">
					<div class="single-blog blog-one">
						<div class="featured-img" style="background-image: url('<?php echo $base_url . 'admin/blogs/blogs-files/' .$det_picture;?>');"></div>
						<div class="blog-content-box">
							<div class="post-date"><?php echo $date_add;?></div>
							<h3><a href="<?php echo $base_url . 'blogs/' .$det_url; ?>"><?php echo $deg_title1;?>&nbsp;...</a></h3>

							<a href="<?php echo $base_url . 'blogs/' .$det_url; ?>" class="read-more-btn">+ Read More</a>
						</div>
					</div>
				</div> <!-- /.single-blog -->
				<?php }}else{?>
				<h4>There is no records in database.</h4>
				<?php }?>
			</div>
		</div>
	</section>




<?php 
	include("../include/footer.php");
?>
