| Current Path : /home/happyrenas/myreco.online/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/myreco.online/hebergements_proches.php |
<?
include("configuration.php");
include("includes/fonctions.php");
$page="hebergements_proches.php";
?>
<html class="no-js" lang="<?echo $country_code;?>">
<head>
<?include("includes/google_head.php");?>
<meta charset="utf-8">
<title>MyReco.Online</title>
<meta name="description" content="">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://www.myreco.online/img/icone.png" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://www.myreco.online/css/custom.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js"></script>
<style>
</style>
</head>
<body>
<?include("includes/google_body.php");?>
<nav class="navbar fixed-top navbar-light bg-light">
<div class="container d-flex justify-content-between align-items-center">
<!-- Logo (aligné à gauche) -->
<div>
<img src="img/logo_myreco.png" alt="Logo" class="d-none d-md-block" style="height: 40px;">
<img src="img/logo_myreco.png" alt="Logo Mobile" class="d-md-none" style="height: 15px;">
</div>
<div class="">
</div>
</div>
</nav>
<div class="mt-3 mb-3"> </div>
<div class="container mycards">
<div class="row">
<div class="col-sm-6 py-2 mb-2">
<div class="card h-100">
<div class="description card-body text-center">
<h3 class="card-title">**</h3>
<h4 class="card-subtitle"><span style="font-size:16px;">**</h4>
<?
// ➤ Extraction de la ville et du code pays
$parts = explode(',', $ville_input);
$ville = trim($parts[0]);
$pays = strtoupper(trim($parts[1] ?? ''));
$tableau_liste = rechercherHebergementsProches($_GET['ville'], $db);
?>
<h3 class='mb-4'>Hébergements proches de <strong>$ville ($pays)</strong></h3>
<div class='container'>
<?php foreach ($tableau_liste as $lieu): ?>
<div class="card mb-3">
<div class="row no-gutters">
<!-- Colonne image -->
<div class="col-md-4">
<img src="<?= $lieu['chemin'] ?>" class="card-img" style="height:100%; object-fit:cover;" alt="Photo hébergement">
</div>
<!-- Colonne texte -->
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title mb-1"><?= htmlspecialchars($lieu['name']) ?></h5>
<p class="mb-2 text-muted"><?= htmlspecialchars($lieu['city']) ?></p>
<?php if (!empty($equipements)): ?>
<p class="mb-1"><strong>Équipements :</strong> <?= implode(' · ', $equipements) ?></p>
<?php endif; ?>
<p class="mb-1"><strong>Parking :</strong> <?= $parking ?></p>
<?php if (!empty($activites)): ?>
<p class="mb-1"><strong>Activités :</strong> <?= implode(' · ', $activites) ?></p>
<?php endif; ?>
<p class="mt-2 mb-2">
<span class="badge badge-success" style="font-size: 1em;"><?= $prix ?> €</span> / nuit
</p>
<a href="contacter.php?heb_id=<?= $lieu['id'] ?>" class="btn btn-primary btn-sm">Contacter l’hôte</a>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<div class="col-sm-6 py-2 mb-2">
<div id="map" style="height: 500px; margin-bottom: 30px;"></div>
</div>
</div>
</div>
<div class="mt-3 mb-3"> </div>
<nav class="navbar fixed-bottom navbar-light bg-light">
<a class="btn btn-secondary text-white <?if ($categorie=="a_voir") {?> active<?}?>" href="fiche.php?token=<?echo $token;?>&categorie=a_voir"><?echo $trad['A voir'] ?? '⚠️';?></a>
<a class="btn btn-secondary text-white <?if ($categorie=="restaurant") {?> active<?}?>" href="fiche.php?token=<?echo $token;?>&categorie=restaurant"><?echo $trad['Restaurant'] ?? '⚠️';?></a>
<a class="btn btn-secondary text-white <?if ($categorie=="ludique") {?> active<?}?>" href="fiche.php?token=<?echo $token;?>&categorie=ludique"><?echo $trad['Ludique'] ?? '⚠️';?></a>
<a class="btn btn-secondary text-white <?if ($categorie=="soiree") {?> active<?}?>" href="fiche.php?token=<?echo $token;?>&categorie=soiree"><?echo $trad['En soirée'] ?? '⚠️';?></a>
<a class="mt-3 btn btn-block btn-secondary text-white <?if ($categorie=="reco") {?> active<?}?>" href="fiche.php?token=<?echo $token;?>&categorie=reco"><?echo $trad['Les recos du proprio'] ?? '⚠️';?></a>
</nav>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<?php
$points = [];
foreach ($tableau_liste as $lieu) {
$fiche = $db->get_row("SELECT * FROM heb WHERE id = " . intval($lieu['id']));
$points[] = [
'nom' => $lieu['name'],
'ville' => $lieu['ville'],
'tarif' => $lieu['tarif_nuit'],
'lat' => floatval($lieu['latitude']),
'lon' => floatval($lieu['longitude']),
'id' => $lieu['id']
];
}
?>
<script>
const hebPoints = <?= json_encode($points); ?>;
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
if (!hebPoints.length) return;
const map = L.map('map').setView([hebPoints[0].lat, hebPoints[0].lon], 8);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap',
maxZoom: 18,
}).addTo(map);
hebPoints.forEach(p => {
const marker = L.marker([p.lat, p.lon]).addTo(map);
marker.bindPopup(`
<strong>${p.nom}</strong><br>
${p.ville}<br>
${p.tarif}€/nuit<br>
<a href='contacter.php?heb_id=${p.id}' class='btn btn-sm btn-link'>Contacter</a>
`);
});
});
</script>
<script type="text/javascript" src="https://www.myreco.online/js/notify.js"></script>
<script>
$(document).ready( function(){
});
</script>
</body>
</html>