From b415ba035eef9da87373a61ae1ef2dc9527dfed7 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Wed, 17 May 2023 10:25:06 -0600 Subject: [PATCH] Periodo null --- consultar_horario.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/consultar_horario.php b/consultar_horario.php index e4e30ec..5da5739 100644 --- a/consultar_horario.php +++ b/consultar_horario.php @@ -43,12 +43,13 @@ $write = $user->admin || in_array($user->acceso, ['w']); $user->facultad['facultad_id'], ":per" => $user->periodo], single: false); // repliaction of the query in the database with database class - $nivel = $db->where('id', $user->periodo)->getOne('fs_periodo'); - $carreras = $db + $nivel = $user->periodo ? $db->where('id', $user->periodo)->getOne('fs_periodo') : false; + + $carreras = $nivel ? $db ->orderBy('carrera') ->where('facultad', $nivel['facultad_id']) ->where('nivel', $nivel['nivel_id']) - ->get('fs_carrera', 100, 'id, carrera'); + ->get('fs_carrera', 100, 'id, carrera') : []; ?>
@@ -282,7 +283,7 @@ $write = $user->admin || in_array($user->acceso, ['w']);
- +
El salón no puede estar vacío.