36214-vm/tour-details.php
Flatlogic Bot bec9c2de3b 12
2025-11-24 17:15:40 +00:00

85 lines
2.5 KiB
PHP

<?php
require_once 'db/config.php';
$tour_id = $_GET['id'] ?? null;
if (!$tour_id) {
header("Location: tours.php");
exit;
}
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM tour_packages WHERE id = :id");
$stmt->bindParam(':id', $tour_id);
$stmt->execute();
$tour = $stmt->fetch();
} catch (PDOException $e) {
echo 'Failed to fetch tour details: ' . $e->getMessage();
$tour = null;
}
if (!$tour) {
echo "Tour not found.";
exit;
}
$page_title = $tour['name'];
require_once 'partials/header.php';
?>
<main id="main">
<!-- ======= Breadcrumbs ======= -->
<section class="breadcrumbs">
<div class="container">
<ol>
<li><a href="index.php">Home</a></li>
<li><a href="tours.php">Tours</a></li>
<li><?php echo htmlspecialchars($tour['name']); ?></li>
</ol>
<h2><?php echo htmlspecialchars($tour['name']); ?></h2>
</div>
</section><!-- End Breadcrumbs -->
<!-- ======= Tour Details Section ======= -->
<section id="tour-details" class="tour-details">
<div class="container">
<div class="row gy-4">
<div class="col-lg-8">
<div class="tour-details-slider swiper">
<div class="swiper-wrapper align-items-center">
<div class="swiper-slide">
<img src="<?php echo htmlspecialchars($tour['image_url']); ?>" alt="">
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="col-lg-4">
<div class="tour-info">
<h3>Tour information</h3>
<ul>
<li><strong>Category</strong>: <?php echo ucfirst(htmlspecialchars($tour['category'])); ?></li>
<li><strong>Location</strong>: <?php echo htmlspecialchars($tour['location']); ?></li>
<li><strong>Duration</strong>: <?php echo htmlspecialchars($tour['duration_days']); ?> days</li>
<li><strong>Price</strong>: ₹<?php echo number_format($tour['price'], 2); ?></li>
</ul>
</div>
<div class="tour-description">
<h2>Description</h2>
<p>
<?php echo nl2br(htmlspecialchars($tour['description'])); ?>
</p>
</div>
</div>
</div>
</div>
</section><!-- End Tour Details Section -->
</main><!-- End #main -->
<?php require_once 'partials/footer.php'; ?>