Actualizar Interfaz/control/consultar_asientos.php
This commit is contained in:
parent
c5a3090517
commit
7054e8b6af
Interfaz/control
|
@ -1,20 +1,20 @@
|
|||
<?php
|
||||
require 'conexionbd.php';
|
||||
|
||||
$artista = $_GET['artista'] ?? '';
|
||||
$dia = $_GET['dia'] ?? '';
|
||||
|
||||
if (empty($artista) || empty($dia)) {
|
||||
die(json_encode(['error' => 'Faltan parámetros (artista y dia).']));
|
||||
}
|
||||
|
||||
try {
|
||||
$stmt = $conn->prepare("SELECT id, asiento, estado, precio FROM asientos WHERE artista = :artista AND dia = :dia");
|
||||
$stmt->execute([':artista' => $artista, ':dia' => $dia]);
|
||||
$asientos = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
echo json_encode(['success' => true, 'asientos' => $asientos]);
|
||||
} catch (PDOException $e) {
|
||||
die(json_encode(['error' => 'Error al consultar los asientos: ' . $e->getMessage()]));
|
||||
}
|
||||
<?php
|
||||
require 'conexionbd.php';
|
||||
|
||||
$artista = $_GET['artista'] ?? '';
|
||||
$dia = $_GET['dia'] ?? '';
|
||||
|
||||
if (empty($artista) || empty($dia)) {
|
||||
die(json_encode(['error' => 'Faltan parámetros (artista y dia).']));
|
||||
}
|
||||
|
||||
try {
|
||||
$stmt = $conn->prepare("SELECT id, asiento, estado, precio FROM asientos WHERE artista = :artista AND dia = :dia");
|
||||
$stmt->execute([':artista' => $artista, ':dia' => $dia]);
|
||||
$asientos = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
echo json_encode(['success' => true, 'asientos' => $asientos]);
|
||||
} catch (PDOException $e) {
|
||||
die(json_encode(['error' => 'Error al consultar los asientos: ' . $e->getMessage()]));
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue