<?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,catName,blogDname,catDesc,catID,catDesc1,banner1,blog_written,pageTitle,pageKeywords,pageDescription from blog_tbl where catName='$blog_name'AND status = 'Y'");
$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']);
$blog_query1 = mysqli_query($GLOBALS['dbconn'], "select catImage,catName,blogDname,catDesc,blog_written from blog_tbl WHERE status = 'Y'");
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <?php include "app_top.php"; ?>
    <script
        src="https://platform-api.sharethis.com/js/sharethis.js#property=5feda5b40b50bc00198f4285&product=inline-share-buttons"
        async="async"></script>
</head>

<body>

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

    <section class="heading_banner" style="background-image: url(<?= site_url; ?>/designer/images/bannersmalls1.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"><?=$blogdisplay;?></h1>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </section>

    <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><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="title_2 text-white"><?=$blogdisplay;?>
            </div>
            <div class="clearfix"></div>
            <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_left blog_details">
                        <ul>
                            <li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    viewBox="0 0 16 16">
                                    <path
                                        d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z">
                                    </path>
                                </svg> By: <?=$res_latest['blog_written'];?></li>

                        </ul>


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


                            <div class="facebook_comment">
                                <div id="fb-root"></div>
                                <script async defer crossorigin="anonymous"
                                    src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.2"></script>

                                <div class="fb-comments" data-href="https://www.facebook.com/webpulsesolution/"
                                    data-width="1000px" data-numposts="5"></div>
                            </div>

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


    <div class="homeBlog bg-dark">
        <div class="container">
            <div class="w-75 mx-auto text-center text-white mb-4">
                <div class="h2_title_1 wow fadeInDown" data-wow-delay=".1s">Latest Blogs</div>
                <p>
                    Stay updated with the latest insights and innovations in carbon technology and advanced materials.
                    Our blogs explore industry trends, product applications, and expert tips to help you make informed
                    decisions. Dive into topics that highlight durability, efficiency, and cutting-edge solutions
                    designed to optimize performance across various sectors. Discover knowledge that empowers your next
                    project.
                </p>
            </div>


            <div class="clearfix"></div>
            <div class="row g-3">
                <?php $blog_query1 = mysqli_query($GLOBALS['dbconn'], "select catImage,catName,blogDname,catDesc,blog_written from blog_tbl where catID!='$blog_ID' AND status = 'Y' order by catID Desc");

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

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

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

                                $blog_img = NO_IMG_URL;
                            }

                            ?>
                <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12">
                    <div class="singleBlog">
                        <a href="<?=site_url;?>/blog/<?=getValidFileName($blog_res1['catName']);?>.htm"
                            title="<?= $blog_res1['catName']; ?>">
                            <div class="image">
                                <img src="<?=$blog_img;?>" alt="<?= $blog_res1['catName']; ?>"
                                    title="<?= $blog_res1['catName']; ?>">
                            </div>
                            <div class="entry">
                                <!-- <div class="date-wrapper">
                                    <div class="date">
                                        <span>Apr</span>
                                        <strong>22</strong>
                                        <span>2025</span>
                                    </div>
                                </div> -->
                                <div class="blogTitle"><?= $blog_res1['blogDname']; ?>
                                </div>
                            </div>


                        </a>
                    </div>
                </div>
                <?php } ?>



            </div>
        </div>
    </div>
    <?php include "app_footer.php"; ?>
    <?php include "app_bottom.php"; ?>
    <script>
    (function() { // Wrap in an IIFE to encapsulate variables
        document.addEventListener("DOMContentLoaded", function() {
            const images = document.querySelectorAll("img");

            images.forEach(function(img) {
                const altText = img.getAttribute("alt");

                // If image has alt and no title, then set title from alt
                if (altText && !img.hasAttribute("title")) {
                    img.setAttribute("title", altText);
                }
            });
        });
    })(); // End of IIFE
    </script>
</body>

</html>