Skip to content

Commit

Permalink
Arreglar edición de reservas por ID
Browse files Browse the repository at this point in the history
Se corrigió la funcionalidad de editar reservas que estaba fallando. Ahora, los datos de la reserva se obtienen directamente por su ID utilizando una consulta SQL, eliminando la necesidad de pasar por parámetros.
  • Loading branch information
Bernard2806 committed Dec 26, 2024
1 parent 108beb7 commit bc11f26
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions ReservationSystem/reserva/modifica_reserva.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@

<!-- Archivos a incluir -->
<?php
include '../include/conexion.php';

$id_tabla = $_GET['id'];
$usuario = $_GET['nombreapellido'];
$curso = $_GET['curso'];
$materia = $_GET['materia'];
$horario = $_GET['horario'];
$horario1 = $_GET['horario1'];
$fecha = $_GET['fecha'];
$info = $_GET['info'];
$materiales = $_GET['materiales'];

$query = "SELECT nombreapellido, curso, materia, horario, horario1, fecha, info, materiales FROM tabla WHERE id = ?";
$stmt = $conexion->prepare($query);
$stmt->bind_param("i", $id_tabla);
$stmt->execute();
$stmt->bind_result($usuario, $curso, $materia, $horario, $horario1, $fecha, $info, $materiales);
$stmt->fetch();
$stmt->close();
$conexion->close();
?>
</head>

Expand All @@ -50,9 +53,10 @@
</div>
</div>
</nav>

<br>

<br>
<!-- Formulario -->

<div class="container">

Expand Down Expand Up @@ -107,7 +111,6 @@
<input type="text" id="materiales" name="materiales" value="<?php echo $materiales; ?>" class="form-control">
</div>

<!-- Botones rediseñados -->
<button type="submit" class="btn btn-warning btn-block" name="boton" value="1">
<i class="bi bi-pencil-square me-2"></i> Modifica la reserva
</button>
Expand Down

0 comments on commit bc11f26

Please sign in to comment.