145 lines
4.8 KiB
PHP
145 lines
4.8 KiB
PHP
<?php
|
|
// traduccion de los meses
|
|
$meses = [
|
|
"January" => "Enero", "February" => "Febrero", "March" => "Marzo",
|
|
"April" => "Abril", "May" => "Mayo", "June" => "Junio",
|
|
"July" => "Julio", "August" => "Agosto", "September" => "Septiembre",
|
|
"October" => "Octubre", "November" => "Noviembre", "December" => "Diciembre"
|
|
];
|
|
// Obtener el destino desde la URL
|
|
$destino_nombre = $_GET["destino"] ?? null;
|
|
|
|
if (!$destino_nombre) {
|
|
echo "<p>Destino no indicado.</p>";
|
|
exit;
|
|
}
|
|
|
|
// Ruta al JSON dentro del directorio del destino
|
|
$json_path = "destinos/" . $destino_nombre . "/" . "destino.json";
|
|
|
|
if (!file_exists($json_path)) {
|
|
echo "<p>Destino no encontrado.</p>";
|
|
exit;
|
|
}
|
|
|
|
// Leer el JSON del destino
|
|
$json = file_get_contents($json_path);
|
|
$destino_seleccionado = json_decode($json, true);
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title><?= $destino_seleccionado["Destino"]; ?></title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
|
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap" rel="stylesheet">
|
|
|
|
<link rel="stylesheet" href="css/detalle.css" />
|
|
|
|
</head>
|
|
|
|
<body class="container mt-5">
|
|
<h1 style="font-family: 'Caveat', cursive; font-size: 48px;"><?= $destino_seleccionado["Destino"]; ?></h1>
|
|
|
|
<?php
|
|
$fecha = date("d F Y", strtotime($destino_seleccionado['Fecha_Visita']));
|
|
foreach ($meses as $ingles => $espanol) {
|
|
$fecha = str_replace($ingles, $espanol, $fecha);
|
|
}
|
|
echo "<p class='text-muted'>📅 Visitado el $fecha</p>";
|
|
?>
|
|
|
|
<p>
|
|
<a href="index.php" class="btn btn-secondary">🔙 Volver a la página principal</a>
|
|
<br>
|
|
</p>
|
|
|
|
<div class="polaroid-grande">
|
|
<img src="destinos/<?= $destino_nombre; ?>/<?= $destino_seleccionado['Foto_Principal']; ?>" alt="Foto de <?= $destino_seleccionado['Destino']; ?>">
|
|
<p><?= $destino_seleccionado["Destino"]; ?></p>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<h2>🗺️ Mapa del destino</h2>
|
|
<div class="mapa-realista">
|
|
<img src="destinos/<?= $destino_nombre; ?>/<?= $destino_seleccionado['Mapa']; ?>" alt="Mapa de <?= $destino_seleccionado['Destino']; ?>">
|
|
<p>Mapa de <?= $destino_seleccionado["Destino"]; ?></p>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<h2>📷 Galería de imágenes</h2>
|
|
<div id="carouselExample" class="carousel slide" data-bs-ride="carousel">
|
|
<div class="carousel-inner">
|
|
<?php foreach ($destino_seleccionado["Fotos"] as $index => $foto): ?>
|
|
<div class="carousel-item <?= $index === 0 ? 'active' : ''; ?>">
|
|
<div class="polaroid">
|
|
<img src="destinos/<?= $destino_nombre; ?>/<?= $foto; ?>" class="d-block w-100" alt="<?= $destino_seleccionado["Descripcion_Fotos"][$index]; ?>">
|
|
<p><?= $destino_seleccionado["Descripcion_Fotos"][$index]; ?></p>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExample" data-bs-slide="prev">
|
|
<span class="carousel-control-prev-icon"></span>
|
|
</button>
|
|
<button class="carousel-control-next" type="button" data-bs-target="#carouselExample" data-bs-slide="next">
|
|
<span class="carousel-control-next-icon"></span>
|
|
</button>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<h2>🏨 Alojamiento</h2>
|
|
<p><?= $destino_seleccionado["Alojamiento"]; ?></p>
|
|
|
|
<br>
|
|
|
|
<h2>🍽️ Comida</h2>
|
|
<ul style="list-style-position: inside;">
|
|
<?php foreach ($destino_seleccionado["Comida"] as $platillo): ?>
|
|
<li><?= $platillo; ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
<br>
|
|
|
|
<h2>📍 Zonas visitadas</h2>
|
|
<ul style="list-style-position: inside;">
|
|
<?php foreach ($destino_seleccionado["Zonas_Visitadas"] as $zona): ?>
|
|
<li><?= $zona; ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
<br>
|
|
|
|
<h2>🤔 Curiosidades y Anécdotas</h2>
|
|
<p>
|
|
<?php
|
|
$curiosidades_path = "destinos/" . $destino_nombre . "/curiosidades.txt";
|
|
if (file_exists($curiosidades_path)) {
|
|
$curiosidades = file($curiosidades_path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
|
foreach ($curiosidades as $curiosidad) {
|
|
echo "$curiosidad<br>";
|
|
}
|
|
} else {
|
|
echo "No hay curiosidades ni anecdotas.";
|
|
}
|
|
?>
|
|
</p>
|
|
|
|
<br>
|
|
|
|
<div class="text-center mt-4">
|
|
<a href="index.php" class="btn btn-secondary">🔙 Volver a la página principal</a>
|
|
</div>
|
|
<br><br>
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
</body>
|
|
</html>
|