prepare("SELECT * FROM tour_packages WHERE id = ?"); $stmt->execute([$tour_id]); $tour = $stmt->fetch(PDO::FETCH_ASSOC); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $customer_name = $_POST['customer_name'] ?? ''; $customer_email = $_POST['customer_email'] ?? ''; $customer_phone = $_POST['customer_phone'] ?? ''; $tour_date = $_POST['tour_date'] ?? ''; $num_people = $_POST['num_people'] ?? 1; $status = 'pending'; if ($tour_id && !empty($customer_name) && !empty($customer_email) && !empty($tour_date)) { $stmt = db()->prepare("INSERT INTO tour_bookings (tour_package_id, customer_name, customer_email, customer_phone, tour_date, num_people, status) VALUES (?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([$tour_id, $customer_name, $customer_email, $customer_phone, $tour_date, $num_people, $status]); $booking_id = db()->lastInsertId(); echo '
Thank you! Your tour booking has been received. We will contact you shortly.
'; } else { echo '
Please fill in all required fields.
'; } } if (!$tour) { echo '
Tour package not found.
'; require_once 'includes/footer.php'; exit; } ?>

Book Tour:

<?php echo htmlspecialchars($tour['name']); ?>

Duration:

Itinerary:

Price: Rp / person