<?php

include_once("include/main.inc.php");


$hover == 'blog';

@extract($_GET);

@extract($_POST);

@extract($_REQUEST);

if (preg_match('webpulse\.co$/', $_SERVER['HTTP_HOST'], $match)) {

    $match1 = $match[1];

    $vanity_url = 'http://' . $_SERVER['HTTP_HOST'];
}

$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

$mm = $ee[4];

$ss = explode('.', $mm);

$cc = $ss[0];

$cat = str_replace("-", " ", $cc);

$cats = ucfirst($cat);

$catss = ucwords($cat);

$blog_name = ucwords(str_replace('-', ' ', $blog_name));

$sql_latest = mysqli_query($GLOBALS['dbconn'], "select catImage,pageTitle, pageKeywords, pageDescription,catName,blogDname,catDesc,catDesc1,banner1,blog_written,blogDate,catID from blog_tbl where catName='$blog_name' ");

$res_latest = mysqli_fetch_array($sql_latest);

$blogdisplay = $res_latest['blogDname'];

$blog_ID = $res_latest['catID'];

$page_metatitle = $res_latest['pageTitle'] != '' ? $res_latest['pageTitle'] : $res_latest['blogDname'];

$page_metakey = $res_latest['pageKeywords'] != '' ? $res_latest['pageKeywords'] : $res_latest['blogDname'];

$page_metadesc = $res_latest['pageDescription'] != '' ? $res_latest['pageDescription'] : $res_latest['blogDname'];

$blog_desc = str_ireplace('{companyName}', $admin_res['companyName'], $res_latest['catDesc1']);

$date = new DateTime($res_latest['blogDate']);

$day = $date->format('d');

$month = $date->format('M');

$year = $date->format('Y');

if (mysqli_num_rows($sql_latest) > 0) {
} else {

    header("Location: " . site_url);

    exit;
}

?>

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

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <?php include "app_top.php"; ?>
</head>

<body>

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


    <div class="heading_banner" style="background-image: url(<?= site_url; ?>/designer/images/about-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">
                    <div class="cat_title"><?= $blogdisplay; ?></div>
                </div>
            </div>
        </div>
    </div>

    <div class="breadcrumbSection 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><a href="<?= site_url; ?>/blogs.htm" title="Blogs">Blogs</a></li>
                        <li class="active"><?= $blogdisplay; ?></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>


    <section class="blog_page">
        <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">
                    <div class="blog_details">
                        <h1><?= $blogdisplay; ?></h1>
                        

                        <div class="blog_details1">
                            <div class="blog_details_img">
                                <img src="<?= getImage($res_latest['catImage'], 800, 600, $res_latest['catName'], "/uploaded-files/blog/images/"); ?>" alt="<?= $res_latest['blogDname']; ?>" title="<?= $res_latest['blogDname']; ?>">
                            </div>
                            <?php echo html_entity_decode($blog_desc); ?>

                            <div class="you_may">You May Also Like These</div>
                            <div class="row g-4">

                                <?php $blog_query1 = mysqli_query($GLOBALS['dbconn'], "select catImage,catName,blogDname,catDesc,blog_written,blogDate from blog_tbl where catID!='$blog_ID' order by catID DESC");
                                ?>

                                <?php while ($blog_res1 = mysqli_fetch_assoc($blog_query1)) {

                                    if ($blog_res1['catImage'] != '') {

                                        $blog_img =  getImage($blog_res1['catImage'], 276, 282, $blog_res1['catName'], "/uploaded-files/blog/images/");
                                    } else {

                                        $blog_img = NO_IMG_URL;
                                    }
                                    $blog_shortdesc = str_ireplace('{companyName}', $admin_res['companyName'], $blog_res1['catDesc']);
                                ?>
                                    <div class="col-lg-4 col-md-6 col-12">
                                        <div class="singleBlog">
                                            <div class="image-box">
                                                <figure class="image">
                                                    <a href="<?= site_url; ?>/blog/<?= getValidFileName($blog_res1['catName']); ?>.htm" title="<?= $blog_res1['blogDname']; ?>">
                                                        <img src="<?= $blog_img ?>" alt="<?= $blog_res1['blogDname']; ?>" title="<?= $blog_res1['blogDname']; ?>">
                                                    </a>
                                                </figure>
                                                <!-- <span class="date">
                                                <strong>03</strong>
                                                <span>Feb 2025</span>
                                            </span> -->
                                            </div>
                                            <div class="blogInfo">
                                                <div class="blogTitle"><a href="<?= site_url; ?>/blog/<?= getValidFileName($blog_res1['catName']); ?>.htm" title="<?= $blog_res1['blogDname']; ?>"><?= $blog_res1['blogDname']; ?></a></div>
                                                <a class="readBtn_1" href="<?= site_url; ?>/blog/<?= getValidFileName($blog_res1['catName']); ?>.htm" title="Read More">Read More <i class="icon fa fa-long-arrow-right"></i></a>
                                            </div>
                                        </div>
                                    </div>
                                <?php } ?>

                            </div>

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

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

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

</html>