Actualizar Interfaz/control/consultar_asientos.php

This commit is contained in:
maria.ruiz 2025-03-13 06:28:19 +00:00
parent c5a3090517
commit 7054e8b6af
1 changed files with 19 additions and 19 deletions
Interfaz/control

View File

@ -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()]));
}
?>