<?php include_once("include/main.inc.php");
$admin_res=getAdminDetails();
$pg= "blog";
@extract($_GET);
if (preg_match('webpulse\.co$/', $_SERVER['HTTP_HOST'], $match)) {
	$match1=$match[1];
	$vanity_url='http://'.$_SERVER['HTTP_HOST'];
}
$actual_link = "$_SERVER[REQUEST_URI]";
$ee=explode('/',$actual_link);
$mm=$ee[3];
$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($dbconn,"select * from blog_tbl where catName='$blog_name'");
$res_latest=mysqli_fetch_array($sql_latest);
$blogdisplay=$res_latest['blogDname'];
$page_metatitle=$res_latest['pageTitle'];
$page_metakey=$res_latest['pageKeywords'];
$page_metadesc=$res_latest['pageDescription'];
?>
<!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">
  	<?php if($page_metatitle!=''){ ?>
    <title><?php echo $page_metatitle;?></title>  
     <meta name=description content="<?php echo $page_metadesc;?>" /> 
    <meta name=keywords content="<?php echo $page_metakey;?>" />
    <?php } else { ?>
<title><?=$blogdisplay;?></title>
    <meta name="keywords" content="<?=$blogdisplay;?>" />
    <meta name="description" content="<?=$blogdisplay;?>" />
    <?php } ?>
    <?php include 'components/top_header.php';?>
</head>

<body>
    <div class="webpulse-main-wrapper">
        <!-- Header -->
        <?php include 'components/header.php';?>



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

        <!-- Breadcrumb -->
        <div class="inner_breadcrumb hidden-xs">
            <div class="container">
                <div class="row">
                    <div class="col-lg-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 bg-white">
            <div class="container">
                <div class="row">
                    <div class="col-md-9">
                        <div class="blog_left blog_details">
                            <h2 class="bg-title"><?=$blogdisplay?></h2>
                            <ul>
                                <li><i class="fa fa-user"></i> By: <?=$res_latest['blog_written']?></li>
                                <li><i class="fa fa-clock-o"></i> <?=date('M d, Y',strtotime($res_latest['blogDate']))?></li>
                            </ul>

                            <span class='st_facebook'></span>
                            <span class='st_twitter'></span>
                            <span class='st_googleplus'></span>
                            <span class='st_pinterest'></span>
                            <span class='st_linkedin'></span>
                            <span class='st_email'></span>
                            <span class='st_whatsapp'></span>
                            <script>
                            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">
                                  <img class="img-responsive" src="<?=site_url?>/uploaded-files/blog/images/<?=$res_latest['catImage']?>" alt="<?=$blogdisplay?>" title="<?=$blogdisplay?>">
                                 <?=$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-md-3">
                        <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 'components/app_testi_client.php';?>
        <!-- Footer -->
        <?php include 'components/footer.php';?>
    </div>
    <?php include 'components/bottom_footer.php';?>
</body>

</html>