<?php include('include/head.php'); ?>

<body>

    <?php include('include/header.php'); ?>


    <!-- Header Start -->
    <!-- <div class="container-fluid bg-primary page-header">
        <div class="container ">
            <div class="row justify-content-center">
                <div class="col-lg-10 text-center">
                    <h1 class=" text-white animated slideInDown">Blog</h1>
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb justify-content-center">
                            <li class="breadcrumb-item"><a class="text-white" href="#">Home</a></li>
                            <li class="breadcrumb-item"><a class="text-white" href="#">Pages</a></li>
                            <li class="breadcrumb-item text-white active" aria-current="page">Blog</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div> -->
    <!-- Header End -->

<?php 
$slug = $_GET['slug'];

$blog = mysqli_query($conn, "SELECT * FROM `blogs` where slug='$slug'");
while($rok = mysqli_fetch_array($blog))
                {
                    $name = $rok['name'];
                    $banner = $rok['banner'];
                    $short_description = $rok['short_description'];
                    $created_at = $rok['created_at'];
                    $slug = $rok['slug'];
                    $description = $rok['description'];
                }
?>

    <!-- ===== blog detail section start ==== -->

  <section class="blog-detail">
        <div class="container">

            <!-- <div class="text-center mt-3">
                <h5 class="section-title ff-secondary text-center text-primary fw-normal">Blog Details</h5>
                <h1 class="">Our Blog Details</h1>
            </div> -->

            <div class="row mt-5">

                <div class="col-md-8">

                    <div class="detail-text" style="padding: 10px;">

                        <h1><?php echo $name; ?></h1>
                        <p><?php echo $short_description; ?></p>

                        <img src="<?php path() ?>/admin/assets/images/blog-image/<?php echo $banner; ?>" alt="" >

                        <br> <br>

                        <p><?php echo $description; ?></p>

                    </div>

                </div>

                <div class="col-md-4" style="padding: 10px;">

                    <h5 class="">Latest Post</h5>
                    <!-- <h1 class="mb-4">Latest Post</h1> -->

                    <div class="row">
                       <?php
                $blog = mysqli_query($conn, "SELECT * FROM `blogs`");
                while($rok = mysqli_fetch_array($blog))
                {
                    $name = $rok['name'];
                    $banner = $rok['banner'];
                    $short_description = $rok['short_description'];
                    $created_at = $rok['created_at'];
                    $slug = $rok['slug'];
                ?>
                        <div class=" latestside-box  row mt-3 ">

                            <div class="col-md-12">

                                <a href="#">
                                    <h5 class=""><?php echo $name; ?> </h5>
                                </a>

                                <div class="row">
                                    <div class="col-md-5 col-5">
                                        <p>By Admin</p>
                                    </div>

                                    <div class="col-md-6 col-6">
                                        <p><?php echo $created_at; ?> </p>
                                    </div>
                                </div>

                            </div>

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

            </div>
        </div>
    </section>
    <!-- ===== blog detail section end ==== -->




    <?php include('include/footer.php'); ?>

</body>

</php>