

<?php 


ob_start(); 

include('include/head.php');


?>



<body>
    <!-- Spinner Start -->
    <div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
        <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
            <span class="sr-only">Loading...</span>
        </div>
    </div>
    <!-- Spinner End -->


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


    
    <!-- ===== 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-7">
                <?php $slug=$_GET['slug'];
                $statement = $pdo->prepare("SELECT * FROM blogs where slug ='$slug'");
                $statement->execute();
                $result = $statement->fetchAll(PDO::FETCH_ASSOC);
                // print_r($result);
                if (empty($result)) {
                    header("Location: " . get404Url());
                    exit();
                }
                ob_end_flush();

                    foreach ($result as $row) {
                        //print_r($row);
                     ?>
                        <div class="detail-text">
    
                            <h1><?php echo $row['name']; ?></h1>
                            <!--<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit</p>-->
    
                            <img src="<?php path(); ?>admin/img/blogs/<?php echo $row['banner']; ?>" alt="" width="100%">
    
                            <br> <br>
    
                            <p><?php echo $row['short_description']; ?></p>
    
                            <p><?php echo $row['description']; ?>.</p>
    
                            <!--<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptates quae velit facilis-->
                            <!--    aut sint, aperiam accusamus itaque dolor reiciendis accusantium voluptatem esse.-->
                            <!--    Nesciunt reiciendis maiores quis tempora, est quia sapiente.</p>-->
    
                        </div>
                        <?php } ?>
                
                </div>



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

                    <h4 class="mb-4">Latest Post</h4>

                    <div class="row">

 <?php   
$statement = $pdo->prepare("SELECT id,name,updated_at,slug FROM blogs");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
?>
                        <div class=" latestside-box  row mt-3 ">

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

                                <a href="<?php path(); ?>blogs/<?php echo $row['slug']  ?>">
                                    <h5 class=""><?php echo $row['name']; ?> </h5>
                                </a>

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

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

                            </div>

                            <!--<div class="col-md-3 col-3 ">-->
                            <!--    <img src="<?php path(); ?>admin/img/blogs/<?php //echo $row['banner']; ?>" alt="" width="100%">-->
                            <!--</div>-->

                        </div>
<?php } ?>



                        <!--<div class=" latestside-box  row mt-3 ">-->

                        <!--    <div class="col-md-9">-->

                        <!--        <a href="#">-->
                        <!--            <h5 class="">lorem ipsum lorem lorem ipsum lorem lorem ipsum </h5>-->
                        <!--        </a>-->

                        <!--        <div class="row">-->
                        <!--            <div class="col-md-6">-->
                        <!--                <p>Rachel Roth</p>-->
                        <!--            </div>-->

                        <!--            <div class="col-md-6">-->
                        <!--                <p>26 Feb 2024 </p>-->
                        <!--            </div>-->
                        <!--        </div>-->

                        <!--    </div>-->

                        <!--    <div class="col-md-3">-->
                        <!--        <img src="img/team-2.jpg" alt="" width="100%">-->
                        <!--    </div>-->

                        <!--</div>-->



                        <!--<div class=" latestside-box  row mt-3 ">-->

                        <!--    <div class="col-md-9">-->

                        <!--        <a href="#">-->
                        <!--            <h5 class="">lorem ipsum lorem lorem ipsum lorem lorem ipsum </h5>-->
                        <!--        </a>-->

                        <!--        <div class="row">-->
                        <!--            <div class="col-md-6">-->
                        <!--                <p>Rachel Roth</p>-->
                        <!--            </div>-->

                        <!--            <div class="col-md-6">-->
                        <!--                <p>26 Feb 2024 </p>-->
                        <!--            </div>-->
                        <!--        </div>-->

                        <!--    </div>-->

                        <!--    <div class="col-md-3">-->
                        <!--        <img src="img/team-2.jpg" alt="" width="100%">-->
                        <!--    </div>-->

                        <!--</div>-->


                        <!--<div class=" latestside-box  row mt-3 ">-->

                        <!--    <div class="col-md-9">-->

                        <!--        <a href="#">-->
                        <!--            <h5 class="">lorem ipsum lorem lorem ipsum lorem lorem ipsum </h5>-->
                        <!--        </a>-->

                        <!--        <div class="row">-->
                        <!--            <div class="col-md-6">-->
                        <!--                <p>Rachel Roth</p>-->
                        <!--            </div>-->

                        <!--            <div class="col-md-6">-->
                        <!--                <p>26 Feb 2024 </p>-->
                        <!--            </div>-->
                        <!--        </div>-->

                        <!--    </div>-->

                        <!--    <div class="col-md-3">-->
                        <!--        <img src="img/team-2.jpg" alt="" width="100%">-->
                        <!--    </div>-->

                        <!--</div>-->


                        <!--<div class=" latestside-box  row mt-3 ">-->

                        <!--    <div class="col-md-9">-->

                        <!--        <a href="#">-->
                        <!--            <h5 class="">lorem ipsum lorem lorem ipsum lorem lorem ipsum </h5>-->
                        <!--        </a>-->

                        <!--        <div class="row">-->
                        <!--            <div class="col-md-6">-->
                        <!--                <p>Rachel Roth</p>-->
                        <!--            </div>-->

                        <!--            <div class="col-md-6">-->
                        <!--                <p>26 Feb 2024 </p>-->
                        <!--            </div>-->
                        <!--        </div>-->

                        <!--    </div>-->

                        <!--    <div class="col-md-3">-->
                        <!--        <img src="img/team-2.jpg" alt="" width="100%">-->
                        <!--    </div>-->

                        <!--</div>-->


                        <!--<div class=" latestside-box  row mt-3 ">-->

                        <!--    <div class="col-md-9">-->

                        <!--        <a href="#">-->
                        <!--            <h5 class="">lorem ipsum lorem lorem ipsum lorem lorem ipsum </h5>-->
                        <!--        </a>-->

                        <!--        <div class="row">-->
                        <!--            <div class="col-md-6">-->
                        <!--                <p>Rachel Roth</p>-->
                        <!--            </div>-->

                        <!--            <div class="col-md-6">-->
                        <!--                <p>26 Feb 2024 </p>-->
                        <!--            </div>-->
                        <!--        </div>-->

                        <!--    </div>-->

                        <!--    <div class="col-md-3">-->
                        <!--        <img src="img/team-2.jpg" alt="" width="100%">-->
                        <!--    </div>-->

                        <!--</div>-->

                    </div>
                </div>

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

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



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


</body>

</html>