-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestaurantes.php
More file actions
136 lines (116 loc) · 5.29 KB
/
Copy pathrestaurantes.php
File metadata and controls
136 lines (116 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<title>XtremeTech</title>
<link rel="stylesheet" href="bootstrap.css">
<style>
/* Estilo para el fondo de la página */
body {
//background-image: url('night.jpg');
background-size: cover; /* Ajusta la imagen para que cubra toda el área */
background-repeat: no-repeat; /* Evita la repetición de la imagen */
height: 100vh; /* Establece la altura de la página al 100% del viewport */
margin: 0; /* Elimina el margen por defecto del body */
padding: 0; /* Elimina el padding por defecto del body */
background-color: rgba(255, 255, 255, 0.8);
filter: hue-rotate(20deg) saturate(150%);
}
</style>
</head>
<body>
<div class="container-fluid text-right">
<div class="row">
<div class="col-1">
<img src="logo xtremetech.png" alt="Logo de XtremeTech" width="70" height="70">
</div>
<div class="col-8">
</div>
<div class="col-3">
<br>
<?php if (!isset($_SESSION['username'])): ?>
<a href="login.php" class="btn btn-danger">Ingresar</a>
<a href="registro.php" class="btn btn-danger">Registrarse</a>
<?php else: ?>
<?php echo '<div style="text-align: right; margin-top: 5px; margin-right: 30px;">Bienvenid@ '.$_SESSION['username'].'</div>'; ?>
<?php endif; ?>
<br>
</div
</div>
</div>
<div class="container text-center">
<br>
<h1 class="fw-bold">Restaurants</h1>
<h5>Las <span style="letter-spacing: 2px;">experiencias</span> <span style="letter-spacing: 2px;">nocturnas</span> <span style="letter-spacing: 2px;">más</span> <span style="letter-spacing: 2px;">exclusivas</span> <span style="letter-spacing: 2px;">en</span> <span style="letter-spacing: 2px;">Córdoba</span></h5>
<br>
<!-- Botón de volver -->
<?php if ($_SESSION['zona'] = '1') :?>
<a class="btn btn-secondary btn-lg mt-3" href="zona_norte.php">Volver</a>
<?php else :?>
<?php if ($_SESSION['zona'] = '2') :?>
<a class="btn btn-secondary btn-lg mt-3" href="zona_centro.php">Volver</a>
<?php else :?>
<a class="btn btn-secondary btn-lg mt-3" href="zona_sur.php">Volver</a>
<?php endif; ?>
<?php endif; ?>
<br>
</div>
<?php
//session_start(); // Iniciar la sesión
include 'db.php';
include 'funciones.php';
// Acceder a la variable de sesión 'zona'
if(isset($_SESSION['zona'])) {
$zona = $_SESSION['zona'];
} else {
echo "La zona no está definida";
}
$sql = "SELECT * FROM restaurants where Id_zonas = $zona";
$result = $conn->query($sql);
echo "<div class='container justify-content-center'>";
// Mostrar los datos en una tabla HTML
if ($result->num_rows > 0) {
// Abre el bucle while para iterar sobre los datos
while ($row = $result->fetch_assoc()) {
echo "<br>";
echo "<div class='card mb-3 mx-auto' style='max-width: 540px;'>";
echo "<div class='row g-0'>";
echo "<div class='col-md-4'>";
echo "<img src='" . $row["Foto"] . "' class='img-fluid rounded-start'>";
echo "</div>";
echo "<div class='col-md-8'>";
echo "<div class='card-body'>";
echo "<h5 class='card-title'>" . $row["Nombre"] . "</h5>";
echo "<p class='card-text'><small class='text-body-secondary'>" . $row["Direccion"] . "</small></p>";
echo "<h6 class='card-text'>";
if ($row["CantComentarios"] != 0) {
echo mostrar_estrellas($row["PuntajeAcum"] / $row["CantComentarios"]);
} else {
echo "Sin calificaciones";
}
echo "</h6>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='text-center'>";
echo "<form action='funciones.php' method='post'>";
echo "<input type='hidden' name='Nombre' value='" . $row["Nombre"] . "'>";
echo "<button type='submit' name='accion' value='ver_comentarios_restaurantes' class='btn btn-danger mx-2'>Ver Comentarios</button>";
echo "<input type='hidden' name='Nombre' value='" . $row["Nombre"] . "'>";
echo "<button type='submit' name='accion' value='dejar_comentarios_restaurantes' class='btn btn-danger mx-2'>Dejar Comentarios</button>";
echo "</form>";
echo "</div>";
}
} else {
echo "<p style='text-align: center; margin-top: 20px;'>No se encontraron resultados</p>";
}
echo "</div>";
// Cerrar la conexión
$conn->close();
?>
</body>
</html>