<?php 
include_once("include/main.inc.php");
$blog_res = mysqli_query($dbconn, "select * from blog_tbl");
$blog = mysqli_query($dbconn, "select * from blog_tbl");
$page_metatitle="Blog - Steel Overseas";
$page_metakey="Blog - Steel Overseas";
$page_metadesc="Blog - Steel Overseas";


?>

<!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'; ?>
    <section class="heading_banner" style="background-image: url(<?=theme_url;?>/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">Our Blog</h1>
                </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 class="active">Our Blog</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="title_h2">Our Blog</h2>
                        <div class="clearfix"></div>
                        <div class="row">

                            <?php while ($blog_sql = mysqli_fetch_array($blog_res)) { ?>


                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
                                <div class="blog-item">
                                    <div class="blog__img">
                                        <a href="<?=site_url;?>/blog/<?=getValidFileName($blog_sql['catName']);?>.htm"
                                            title="<?php echo $blog_sql['blogDname'];?>"> <img
                                                src="<?= getImage($blog_sql['catImage'], 471, 300, $blog_sql['catName'], "/uploaded-files/blog/images/"); ?>"
                                                title="<?php echo $blog_sql['blogDname'];?>"
                                                alt="<?php echo $blog_sql['blogDname'];?>"></a>
                                    </div>
                                    <div class="blog__content">
                                        <h3 class="blog__title"><a
                                                href="<?=site_url;?>/blog/<?=getValidFileName($blog_sql['catName']);?>.htm"
                                                title="<?php echo $blog_sql['blogDname'];?>"><?php echo $blog_sql['blogDname'];?></a>
                            </h3>

                                                        <p class="blog__desc">
                                                            <?php echo html_entity_decode($blog_sql['pageDescription']); ?>
                                                        </p>
                                                        <a href="<?=site_url;?>/blog/<?=getValidFileName($blog_sql['catName']);?>.htm"
                                                            class="read_more_btn" 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 while ($blog_sqls = mysqli_fetch_array($blog)) { ?>

                        <div class="right_news">
                            <a href="<?=site_url;?>/blog/<?=getValidFileName($blog_sqls['catName']);?>.htm">
                                <div class="image"> <img src="<?= getImage($blog_sqls['catImage'], 304, 228, $blog_sqls['blogDname'],"/uploaded-files/blog/images/"); ?>" alt="<?php echo $blog_sqls['blogDname'];?>" title="<?php echo $blog_sqls['blogDname'];?>">
                                </div>
                            </a>
                            <h4 class="title_h4"><a href="<?=site_url;?>/blog/<?=getValidFileName($blog_sqls['catName']);?>.htm" title= "<?php echo $blog_sqls['blogDname'];?>"><?php echo $blog_sqls['blogDname'];?></a></h4>
                        </div>

                        <?php } ?>

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

</html>