<?php include_once("include/main.inc.php");
$admin_res=getAdminDetails();
$pg= "blog";
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?=$admin_res['companyName']?> - Blog</title>
    <meta name="description" content="<?=$admin_res['companyName']?>  - Blog" >
    <meta name="keywords" content="<?=$admin_res['companyName']?>  - Blog" >
    <?php include "app_top.php"; ?>
</head>

<body>
    <?php include 'app_header.php';?>

    <!-- Heading Banner--->
    <section class="heading_banner" style="background-image: url(<?=theme_url?>images/blog-banner.jpg)">
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 text-center">
                    <h1 class="cat_title">Blogs</h1>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </section>

    <!-- Breadcrumb--->
    <section class="inner_breadcrumb hidden_xs">
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <ul class="breadcrumb">
                        <li><a href="<?=site_url?>" title="Home">Home</a></li>
                        <li class="active">Blogs</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>


    <!-- Home About--->
    <section class="blog_page">
        <div class="container">
            <div class="row">
                <div class="col-xxl-9 col-xl-9 col-lg-9 col-md-9 col-sm-9 col-12">
                    <div class="blog_left">
                        <h2 class="left_title1">Our Blogs</h2>
                        <div class="clearfix"></div>
                        <div class="row">
                            <?php   $sql_blog=mysqli_query($dbconn,"select * from blog_tbl order by blogDate desc");
                while($res_blog=mysqli_fetch_array($sql_blog)) { ?>
                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
                                <div class="blog-item">
                                    <div class="blog__img">
                                        <a href="<?=site_url;?>/blog/<?=getValidFileName($res_blog['catName']);?>.htm" title="<?=$res_blog['blogDname']?>">
                                            <img src="<?=getImage($res_blog['catImage'], 436, 290, $res_blog['catName'],"/uploaded-files/blog/images/");?>" alt="<?=$res_blog['blogDname']?>" title="<?=$res_blog['blogDname']?>">
                                        </a>
                                    </div>
                                    <div class="blog__content">
                                        <div class="blog__meta">
                                            <!--<span class="blog__meta-date"><i class="fa fa-calendar"></i> <?=date('M d, Y',strtotime($res_blog['blogDate']))?></span>-->
                                            <div class="blog__meta-cat">
                                                <a href="javascript:void(0);" title="<?=$res_latest['blog_written']?>"><i class="fa fa-user"></i> <?=$res_blog['blog_written']?></a>
                                            </div>
                                        </div>
                                        <h4 class="blog__title"><a href="<?=site_url;?>/blog/<?=getValidFileName($res_blog['catName']);?>.htm" title="<?=$res_blog['blogDname']?>"><?=$res_blog['blogDname'];?></a></h4>
                                        <p class="blog__desc"><?=substr($res_blog['pageDescription'],0,200)?>...
                                        </p>
                                        <a href="<?=site_url;?>/blog/<?=getValidFileName($res_blog['catName']);?>.htm" class="read_more_btn" title="Read More">Read More</a>
                                    </div>
                                </div>
                            </div>
                            <?php  } ?>

                        </div>
                    </div>
                </div>

                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-12 col-12">
                    <div class="left_sidebar">
                        <div class="left_title1">Popular Post</div>
                        <?php 
 $sql_blog=mysqli_query($dbconn,"select * from blog_tbl");
   while($res_blog=mysqli_fetch_array($sql_blog)) { ?>
                        <div class="right_news">
                            <a href="<?=site_url;?>/blog/<?=getValidFileName($res_blog['catName']);?>.htm" title="<?php echo ($res_blog['blogDname']);?>">
                                <div class="image">
                                    <img src="<?=getImage($res_blog['catImage'], 268, 140, $res_blog['catName'],"/uploaded-files/blog/images/");?>" title="<?php echo ($res_blog['blogDname']);?>" alt="<?php echo ($res_blog['blogDname']);?>">
                                </div>
                            </a>
                            <h5><a href="<?=site_url;?>/blog/<?=getValidFileName($res_blog['catName']);?>.htm" title="<?php echo ($res_blog['blogDname']);?>"><?php echo ($res_blog['blogDname']);?></a></h5>
                        </div>
                        <?php  } ?>

                    </div>

                </div>
            </div>
        </div>
    </section>

    <?php include "app_footer.php";?>
    <?php include "app_bottom.php";?>
</body>

</html>
