<?php 
include_once("include/main.inc.php");
@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[5];

$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 * from blog_tbl where catName='$blog_name'");
$blog_num_rows = mysqli_num_rows($sql_latest);
$res_latest=mysqli_fetch_array($sql_latest);
$blogdisplay=$res_latest['blogDname'];
if($blog_num_rows>0){
?>
<!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><?=$blogdisplay;?></title>
    <meta name="description" content="<?=$blogdisplay;?>" />
    <meta name="keywords" content="<?=$blogdisplay;?>" />
   
    <?php include "app_top.php";?>
</head>

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


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


    <!-- Breadcrumb-->
    <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="Blog">Blog</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-9 col-xl-9 col-lg-9 col-md-9 col-sm-9 col-12">
                    <div class="blog_left blog_details">
                        <h2><?=$blogdisplay;?></h2>
                        <ul>
                            <li><i class="fa fa-user"></i> By: <?=$res_latest['blog_written'];?></li>
                            <li><i class="fa fa-clock-o"></i> <?=$res_latest['blogDate'];?></li>
                        </ul>

         <span class='st_facebook' displayText='Facebook'></span>
                        <span class='st_twitter' displayText='Tweet'></span>
                        <span class='st_googleplus' displayText='Google +'></span>
                        <span class='st_pinterest' displayText='Pinterest'></span>
                        <span class='st_linkedin' displayText='LinkedIn'></span>
                        <span class='st_email' displayText='Email'></span>
                        <span class='st_whatsapp' displayText='whatsapp'></span>
                 
                        <script type="text/javascript">
                            var switchTo5x = true;
                        </script>
                        <script  id="st_insights_js" src="http://w.sharethis.com/button/buttons.js?publisher=c753f626-1376-4cf4-9b90-03d3c1fcf65e&product=widget"></script>
                        <script>
                            stLight.options({
                                publisher: "c753f626-1376-4cf4-9b90-03d3c1fcf65e",
                                doNotHash: false,
                                doNotCopy: false,
                                hashAddressBar: false
                            });
                        </script>
                        <div class="blog_details1">
                            <div class="blog_details_img">
                                <img class="img-responsive" src="<?=site_url;?>/uploaded-files/blog/images/<?php echo $res_latest['catImage']; ?>" alt="<?=$blogdisplay;?>" title="<?=$blogdisplay;?>">
                            </div>
                            <?php echo html_entity_decode($res_latest['catDesc1']); ?>

                            <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 class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-12">
                    <div class="left_sidebar">
                        <div class="left_title1">Popular Post</div>
                        <?php $blog_query2 = mysqli_query($GLOBALS['dbconn'], "select * from blog_tbl"); 
while ($blog_res2 = mysqli_fetch_array($blog_query2)) {
?>

                        <div class="right_news">
                            <a href="<?=site_url;?>/blog/<?=getValidFileName($blog_res2['catName']);?>.htm">
                                <div class="image">
                                    <img class="img-responsive" src="<?= getImage($blog_res2['catImage'], 274, 352, $blog_res2['catName'], "/uploaded-files/blog/images/"); ?>" alt="Milk man">
                                </div>
                            </a>
                            <h4><a href="<?=site_url;?>/blog/<?=getValidFileName($blog_res2['catName']);?>.htm"><?=$blog_res2['blogDname'];?></a></h4>
                        </div>
                        <?php } ?>

                      

                       


                    </div>
                </div>


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


    <!-- Home Testimonials -->
       <section class="home_testimonials_webpulse">
    <?php include "testimonial.php";?>
    </section>


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

</html>
<?php } else { 
    header("Location: ".site_url);

    exit;
} ?>