<?php

include("admin/connection.php");
include('include/header.php');
?>
<?php
$slug = $_GET['slug'];
$loc = mysqli_query($con, "SELECT * FROM `locations` where slug='$slug'");
while ($row = mysqli_fetch_array($loc)) {
    $location_name = $row['location_name'];
    $slug = $row['slug'];
    $Image = $row['Image'];
    $id = $row['id'];
    $description = $row['description'];
}
?>

<section class="page-header">
    <div class="bg-img" data-background="<?php path() ?>assets/img/bg-img/page-header-bg.jpg"></div>
    <div class="overlay"></div>
    <div class="shapes">
        <div class="shape shape-1"><img src="<?php path() ?>assets/img/shapes/pager-header-shape-1.png" alt="shape"></div>
        <div class="shape shape-2"><img src="<?php path() ?>assets/img/shapes/pager-header-shape-2.png" alt="shape"></div>
    </div>
    <div class="container">
        <div class="page-header-content">
            <h1 class="title"><?php echo $location_name; ?></h1>
            <h4 class="sub-title">
                <span class="home">
                    <a href="https://www.epperporta.com/">
                        <span>Home</span>
                    </a>
                </span>
                <span class="icon">/</span>
                <span class="inner">
                    <span><?php echo $location_name; ?></span>
                </span>
            </h4>
        </div>
    </div>
</section>
<!-- ./ page-header -->

<section class="service-details pt-120 pb-120">
    <div class="container">
        <div class="row">
            <div class="col-lg-8">
                <div class="service-details-content">
                    <?php
                        // Fetch service details by ID (make sure $id is defined earlier)
                       $loc = mysqli_query($con, "SELECT * FROM `locations` WHERE  id = '$id'");
                        if ($row = mysqli_fetch_array($loc)) {
                            $Image = $row['Image'];
                            // $location_name = $row['location_name'];
                          
                            $description = $row['description'];
                        ?>
                        <div class="service-details-img img-reveal">
                            <div class="img-overlay"></div>
                            <img src="<?php path(); ?>admin/assets/images/location/<?php echo htmlspecialchars($Image); ?>" alt="img">
                        </div>
                        <br>
                        <!-- <h3><?php echo htmlspecialchars($location_name); ?></h3> -->
                        <p style="text-align: justify;"><?php echo $description; ?></p>

                        
                    <?php
                    }
                    ?>
                </div>
            </div>
            <div class="col-lg-4">
                <?php include "location-sidebar.php" ?>
            </div>
        </div>
    </div>
</section>
<!-- ./ footer-section -->

<?php
include("include/footer.php");
?>