<?php include 'header.php'; ?>
<?php include("admin/conn.php");
    // Prepare and execute the SQL query
    $stmt = $conn->prepare("SELECT * FROM add_adver WHERE id='" . $_GET['category'] . "'");
    $stmt->execute();
    $result = $stmt->get_result();
   
    while ($row = $result->fetch_assoc()):
        ?>

 <section class="hero-wrap hero-wrap-2 js-fullheight" style="background-image: url('admin/pic/<?= $row['product_img']; ?>');">
  <div class="overlay"></div>
  <div class="container">
    <div class="row no-gutters slider-text js-fullheight align-items-end justify-content-center">
    <div class="col-md-9 ftco-animate pb-5 text-center d-flex flex-column align-items-center justify-content-center">
     <p class="breadcrumbs"><span class="mr-2"><a href="home.php">Home <i class="fa fa-chevron-right"></i></a></span> <span class="mr-2"><a href="home.php">Destination <i class="fa fa-chevron-right"></i></a></span> </p>
     <h1 class="mb-0 bread"><?= $row['country']; ?></h1>
     </div>
   </div>
 </div>
</section>
<?php endwhile; ?>
<section class="ftco-section ftco-no-pt ftco-no-pb">
<?php include("admin/conn.php");
    // Prepare and execute the SQL query
    $stmt = $conn->prepare("SELECT * FROM add_adver WHERE id='" . $_GET['category'] . "'");
    $stmt->execute();
    $result = $stmt->get_result();
   
    while ($row = $result->fetch_assoc()):
        $description = $row['description'];
        $words = explode(" ", $description);
        $wordCount = count($words);
        $wordsPerLine = ceil($wordCount / 2); // Divide into 3 parts for 2 breaks
        $currentWord = 0;
    ?>
  <div class="container">
    <div class="row">
      <div class="col-lg-12 ftco-animate py-md-5 mt-md-5 text-center">
        <h2 class="mb-3 font-weight-bold"><?= $row['title']; ?></h2>
     
        <img src="admin/pic/<?= $row['product_img']; ?>" alt="" class="img-fluid">
        </p>
        <p>
          <?php 
          for ($i = 0; $i < $wordCount; $i++) {
              echo $words[$i] . " ";
              if (($i + 1) % $wordsPerLine == 0 && $i + 1 < $wordCount) {
                  echo "<br><br>";
              }
          }
          ?>
        </p>
        <div class="tag-widget post-tag-container mb-5 mt-5">
          <div class="tagcloud">
            <a href="#" class="tag-cloud-link">Travel</a>
            <a href="#" class="tag-cloud-link">Tour</a>
            <a href="#" class="tag-cloud-link">Adventure</a>
            <a href="#" class="tag-cloud-link">Vacation</a>
            <a href="#" class="tag-cloud-link">Holiday</a>
            <a href="#" class="tag-cloud-link">Explore</a>
            <a href="#" class="tag-cloud-link">Journey</a>
            <a href="#" class="tag-cloud-link">Destination</a>
            <a href="#" class="tag-cloud-link">Nature</a>
            <a href="#" class="tag-cloud-link">Culture</a>
          </div>
        </div>

      </div> <!-- .col-md-8 -->
    </div>
  </div>
  
  <?php endwhile; ?>
</section> <!-- .section -->



<?php include 'footer.php'; ?>
<!-- END footer -->