From 8f68e927b16cefaa74b25a1f9da1996007346981 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales <98922270+ja-rg@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:24:58 -0600 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20todos=20los=20periodos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action/action_auditoria.php | 4 ++-- auditoria.php | 10 ++++++---- js/auditoría.js | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/action/action_auditoria.php b/action/action_auditoria.php index efac69e..225d211 100644 --- a/action/action_auditoria.php +++ b/action/action_auditoria.php @@ -22,7 +22,7 @@ try { $baseDate = $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null; $params = [ - ':periodo_id' => $user->periodo_id, + ':periodo_id' => $_GET['periodo_id'] == 1 ? $user->periodo_id : null, ':facultad_id' => $user->facultad['facultad_id'], ':fecha_inicio' => $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? date('Y-m-d'), ':fecha_fin' => $baseDate ? date('Y-m-d H:i:s', strtotime($baseDate . ' +24 hours')) : date('Y-m-d H:i:s'), @@ -52,7 +52,7 @@ try { JOIN PERIODO USING (periodo_id) JOIN nivel on periodo.nivel_id = nivel.nivel_id JOIN SALON USING (salon_id) - WHERE (PERIODO.periodo_id, horario.facultad_id) = (:periodo_id, COALESCE(:facultad_id, horario.facultad_id)) + WHERE (PERIODO.periodo_id, horario.facultad_id) = (COALESCE(:periodo_id, PERIODO.periodo_id), COALESCE(:facultad_id, horario.facultad_id)) ), fechas AS ( SELECT fechas_clase(h.horario_id, true) as registro_fecha_ideal, h.horario_id diff --git a/auditoria.php b/auditoria.php index ad87c58..319accd 100644 --- a/auditoria.php +++ b/auditoria.php @@ -88,11 +88,13 @@
- +
- +
+ + +
diff --git a/js/auditoría.js b/js/auditoría.js index 8ab4fb6..881ef2b 100644 --- a/js/auditoría.js +++ b/js/auditoría.js @@ -99,8 +99,8 @@ const store = reactive({ }, printEstados() { if (store.filters.estados.length > 0) - document.querySelector('#estados').innerHTML = store.filters.estados.map((estado) => ` - ${store.estados.getEstado(estado).nombre} + document.querySelector('#estados').innerHTML = store.filters.estados.map((estado) => ` + ${store.estados.getEstado(estado).nombre} `).join(''); else document.querySelector('#estados').innerHTML = `Todos los registros`; @@ -208,6 +208,7 @@ const store = reactive({ params['fecha_inicio'] = fecha_inicio; if (fecha_fin) params['fecha_fin'] = fecha_fin; + params['periodo_id'] = store.filters.todos_los_periodos ? 1 : 0; const paramsUrl = new URLSearchParams(params).toString(); try { const res = await fetch(`action/action_auditoria.php?${paramsUrl}`, {