<?php
include('include/main.inc.php');
$web_det_query = "Select * from admin_details where slno = '1'";
$res_web = $dbconn->query($web_det_query);
$web_details = $res_web->fetch_assoc();
$page_metatitle = $web_details['companyName'].' - Blogs';
$page_metadesc = $web_details['companyName'].' - Blogs';
$page_metakey = $web_details['companyName'].' - Blogs';

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?= $page_metatitle; ?></title>
    <meta name="description" content="<?= $page_metadesc; ?>">
    <meta name="keywords" content="<?= $page_metakey; ?>" >
    <?php include "app_top.php"; ?>
</head>

<body>

    <?php include "app_header.php"; ?>

    <div class="heading_banner" style="background-image: url(<?= site_url; ?>/designer/images/category-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">Our Blogs</h1>
                    <div class="clearfix"></div>
                    <div class="cat_title2">We Are Available For You</div>
                </div>
            </div>
        </div>
    </div>

    <div 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">Our Blogs</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <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="catTitle_22">Our Blogs</h2>
                        <div class="clearfix"></div>
                        <div class="row">
                            <?php
                                $sel_blog_query = "select * from blog_tbl order by catID desc";
                                $res_blog = $dbconn->query($sel_blog_query);
                                if($res_blog->num_rows > 0){
                                    $sno = 1;
                                    while($blogs = $res_blog->fetch_assoc()){
                                    $blog_href = str_ireplace(" ", "-", $blogs['catName']);
                                    $sno++;
                            ?>
                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-12">
                                <div class="single-post2 wow fadeInLeft" data-wow-delay=".<?= $sno; ?>s">
                                    <div class="blog-thumb2">
                                        <a href="<?= site_url; ?>/blog/<?= strtolower($blog_href); ?>.htm" title="<?= $blogs['blogDname']; ?>"><img src="<?= site_url; ?>/uploaded-files/blog/images/<?= $blogs['catImage']; ?>" alt="<?= $blogs['blogDname']; ?>" title="<?= $blogs['blogDname']; ?>"></a>
                                    </div>
                                    <div class="blog-content2">
                                        <div class="b-meta">
                                            <div class="meta-info">
                                                <ul>
                                                    <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                                            <path d="M10.854 7.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 9.793l2.646-2.647a.5.5 0 0 1 .708 0z" />
                                                            <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z" />
                                                        </svg> <?= date('jS M Y', strtotime($blogs['blogDate'])); ?></li>

                                                </ul>
                                            </div>
                                        </div>
                                        <h3 class="titleBlog"><a href="<?= site_url; ?>/blog/<?= strtolower($blog_href); ?>.htm" title="<?= $blogs['blogDname']; ?>"><span><?= $blogs['blogDname']; ?></span></a></h3>
                                        <p><?= substr_replace($blogs['catDesc'], '...', 200); ?></p>
                                        <a href="<?= site_url; ?>/blog/<?= strtolower($blog_href); ?>.htm" class="read_more_1 bg_btn_1" 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
                                $sel_blog_query = "select * from blog_tbl order by rand()";
                                $res_blog = $dbconn->query($sel_blog_query);
                                if($res_blog->num_rows > 0){
                                    $sno = 1;
                                    while($blogs = $res_blog->fetch_assoc()){
                                    $blog_href = str_ireplace(" ", "-", $blogs['catName']);
                                    $sno++;
                            ?>
                        <div class="right_news">
                            <a href="<?= site_url; ?>/blog/<?= strtolower($blog_href); ?>.htm" title="<?= $blogs['blogDname']; ?>">
                                <div class="image">
                                    <img src="<?= site_url; ?>/uploaded-files/blog/images/<?= $blogs['catImage']; ?>" alt="<?= $blogs['blogDname']; ?>" title="<?= $blogs['blogDname']; ?>">
                                </div>
                            </a>
                            <h5><a href="<?= site_url; ?>/blog/<?= strtolower($blog_href); ?>.htm" title="<?= $blogs['blogDname']; ?>"><?= $blogs['blogDname']; ?></a></h5>
                        </div>
                        <?php } } ?>
                    </div>

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

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

</html>