$titre_page = tr("Umrah Guide"); include 'include/header.php'; require_once 'config-guides.php'; $slug = isset($_GET['slug']) ? trim($_GET['slug']) : ''; if (empty($slug)) { header("Location: /nosguides"); exit; } $sql = "SELECT * FROM guides WHERE slug = :slug AND is_active = 1 LIMIT 1"; $stmt = $conn->prepare($sql); $stmt->execute(['slug' => $slug]); $guide = $stmt->fetch(PDO::FETCH_ASSOC); if (!$guide) { header("Location: /nosguides"); exit; } // AUTO-RETRIEVE trips via guide_id in multi_sejours $sejours = []; try { $sql = "SELECT id, titre, prix_base as prix_reel, CASE WHEN image_sejour IS NULL OR image_sejour = '' THEN NULL WHEN image_sejour LIKE '/uploads/%' THEN CONCAT('https://click-and-travel.com', image_sejour) WHEN image_sejour LIKE 'http%' THEN image_sejour ELSE CONCAT('https://click-and-travel.com/-image/sejours/', id, '/', image_sejour) END as image, statut as etat, date_depart as date_debut, date_retour as date_fin, description_generale as description_courte, places_restantes FROM multi_sejours WHERE guide_id = :guide_id AND publication IN (1, 2) ORDER BY date_depart DESC"; $stmt = $conn->prepare($sql); $stmt->execute(['guide_id' => $guide['id']]); $sejours = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { error_log("Error retrieving guide trips: " . $e->getMessage()); } // RETRIEVE hotels liked by the guide (if user_id is linked) $recommended_hotels = []; if (!empty($guide['user_id'])) { try { // Vérifier que la connexion existe if (isset($conn) && $conn instanceof PDO) { $sql = "SELECT h.id, h.libelle as nom, h.ville, h.stars, h.latitude, h.longitude, h.google_rating, h.google_reviews_count, h.devise, MIN(ht.tarifs) as prix_min, hi.image as image FROM hotels h INNER JOIN package_likes pl ON h.id = pl.package_id AND pl.package_type = 'hotel' LEFT JOIN hotels_tarifs ht ON h.id = ht.idHotel LEFT JOIN hotels_img hi ON h.id = hi.idHotel AND hi.une = 1 WHERE pl.user_id = :user_id GROUP BY h.id ORDER BY pl.created_at DESC LIMIT 6"; $stmt = $conn->prepare($sql); $stmt->execute(['user_id' => $guide['user_id']]); $recommended_hotels = $stmt->fetchAll(PDO::FETCH_ASSOC); } } catch (PDOException $e) { // Ne pas crasher, juste logger l'erreur error_log("Error retrieving guide hotels: " . $e->getMessage()); $recommended_hotels = []; } catch (Exception $e) { error_log("Unexpected error retrieving guide hotels: " . $e->getMessage()); $recommended_hotels = []; } } function getYoutubeId($url) { if (empty($url)) return null; if (preg_match('/^[a-zA-Z0-9_-]{11}$/', $url)) return $url; $patterns = [ '/youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11})/', '/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/', '/youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/', '/youtu\.be\/([a-zA-Z0-9_-]{11})/', ]; foreach ($patterns as $pattern) { if (preg_match($pattern, $url, $match)) return $match[1]; } return null; } $youtubeId = getYoutubeId($guide['youtube_id']); $titre_page = $guide['full_name'] . " - " . tr("Umrah Guide"); ?>
Back to guides

Umrah Guide

✈️ Trips

No trips scheduled at the moment

View all our trips

✨ Book Your Umrah

Travel with peace of mind with an experienced guide

View our trips
🎁

Wait! Don't Leave Yet!

Get an exclusive discount on your first booking

-50€
On your first Umrah or Hajj booking
Instant discount code
Exclusive offers
No spam, unsubscribe anytime

Your data is 100% secure. We respect your privacy.

Thank You! 🎉

Your discount code has been sent to your email.
Check your inbox in the next few minutes!

Discount Code: WELCOME50