From a2c075fa834d4b22c75813b75620a86acdbd0c77 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Thu, 31 Aug 2023 19:20:31 +0000 Subject: [PATCH] All --- action/action_auditoria.php | 9 +- action/action_periodousuario_update.php | 1 - action/rutas_salón_horario.php | 12 +- auditoria.php | 243 ++++++++++++------------ class/c_login.php | 136 +++++-------- index.php | 2 +- js/auditoría.js | 7 +- reposiciones_crear.php | 10 +- supervisor.php | 1 - ts/auditoría.ts | 13 +- 10 files changed, 208 insertions(+), 226 deletions(-) diff --git a/action/action_auditoria.php b/action/action_auditoria.php index c5a37c4..e1b74c5 100644 --- a/action/action_auditoria.php +++ b/action/action_auditoria.php @@ -37,7 +37,7 @@ try { WHERE (periodo_id, facultad.facultad_id) = (:periodo_id, COALESCE(:facultad_id, facultad.facultad_id)) ), fechas AS ( - SELECT fechas_clase(h.horario_id) as registro_fecha_ideal, h.horario_id + SELECT fechas_clase(h.horario_id, true) as registro_fecha_ideal, h.horario_id FROM horarios h ), sin_registro AS ( @@ -74,11 +74,6 @@ try { ] ); - - $last_query = [ - 'query' => $db->getLastQuery(), - ]; - echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); } else { http_response_code(405); @@ -89,7 +84,7 @@ try { http_response_code(500); echo json_encode([ 'error' => $th->getMessage(), - 'query' => $db->getLastQuery(), + // 'query' => $db->getLastQuery(), ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR); exit; } catch (Exception $th) { diff --git a/action/action_periodousuario_update.php b/action/action_periodousuario_update.php index f02e8c7..2c31ed2 100644 --- a/action/action_periodousuario_update.php +++ b/action/action_periodousuario_update.php @@ -12,7 +12,6 @@ $params = array(':id' => $user->user['id'], ':per' => $_POST['id']); $user->print_to_log('Actualizando periodo from ' . $user->periodo_id . ' to ' . $_POST['id']); query("SELECT FU_UPDATEPERIODO(:id, :per)", $params); -$user->periodo_id = $params[':per']; $_SESSION['user'] = serialize($user); header("Location: {$_POST["target"]}"); diff --git a/action/rutas_salón_horario.php b/action/rutas_salón_horario.php index 96b00fb..a097527 100644 --- a/action/rutas_salón_horario.php +++ b/action/rutas_salón_horario.php @@ -28,7 +28,11 @@ try { ->get('salon_view'); // step 3: get horarios + + $fecha = "'2023-10-13':DATE"; + $data = array_map( + fn($ruta) => array_merge( [ 'horarios' => $db @@ -37,9 +41,9 @@ try { ->join('salon_view', 'salon_view.salon_id = horario_view.salon_id') ->join('horario_profesor', 'horario_profesor.horario_id = horario_view.horario_id') ->join('profesor', 'profesor.profesor_id = horario_profesor.profesor_id') - ->join('registro', '(registro.profesor_id, registro.horario_id, registro.registro_fecha_ideal) = (profesor.profesor_id, horario_view.horario_id, CURRENT_DATE)', 'LEFT') - ->where('CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin') - ->where('horario_dia = EXTRACT(DOW FROM CURRENT_DATE)') + ->join('registro', "(registro.profesor_id, registro.horario_id, registro.registro_fecha_ideal) = (profesor.profesor_id, horario_view.horario_id, $fecha)", 'LEFT') + ->where("$fecha BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin") + ->where("horario_dia = EXTRACT(DOW FROM $fecha)") ->where('bloque_horario.id', $_GET['bloque_horario_id']) ->where('id_espacio_padre', $ruta['id_espacio_sgu']) ->get('horario_view', null, '*, horario_view.horario_id, profesor.profesor_id'), @@ -61,7 +65,7 @@ try { http_response_code(500); echo json_encode([ 'error' => $th->getMessage(), - 'query' => $db->getLastQuery(), + // 'query' => $db->getLastQuery(), ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); exit; } catch (Exception $th) { diff --git a/auditoria.php b/auditoria.php index 6bceb47..c36ed2a 100644 --- a/auditoria.php +++ b/auditoria.php @@ -242,114 +242,114 @@ -
- - - - +
+
- - Fecha -
+ + + - - + + - - - - acceso == 'w') { ?> - - - - - - - - - - - - + + + + acceso == 'w') { ?> + + + + + + + + + + + + - - - - - - + + + + + + acceso == 'w') { ?> + - acceso == 'w') { ?> - - - - -
+ + Fecha + SalónProfesorSalónProfesorHorarioRegistroSupervisorJustificar
No hay clases en este horario
{{ registro.registro_fecha_ideal }} - {{ registro.salon }} - {{ registro.profesor_clave }} - {{ registro.profesor_nombre }} - - HorarioRegistroSupervisorJustificar
No hay clases en este horario
{{ registro.registro_fecha_ideal }} + {{ registro.salon }} + {{ registro.profesor_clave }} + {{ registro.profesor_nombre }} + + {{ registro.horario_hora?.slice(0,5) }} - - {{registro.horario_fin?.slice(0,5) }} -
-
- Registro {{ registro.registro_fecha?.slice(11,19) }} -
-
-
- -
- -
-
-
-
+ {{ registro.horario_hora?.slice(0,5) }} - + {{registro.horario_fin?.slice(0,5) }} +
-
-
- - - - {{ registro.usuario_nombre - }} -
-
- Hora - {{ registro.registro_fecha_supervisor?.slice(11,19) }} -
+ Registro {{ registro.registro_fecha?.slice(11,19) }} +
+
+
+ +
+
-
- Observaciones: - {{registro.comentario?.slice(0,25)}}{{registro.comentario.length - > 10 ? '...' : ''}} + +
+
+
+
+
+ + + + {{ registro.usuario_nombre + }} +
+
+ Hora + {{ registro.registro_fecha_supervisor?.slice(11,19) }}
+
+ Observaciones: + {{registro.comentario?.slice(0,25)}}{{registro.comentario.length + > 10 ? '...' : ''}} +
+
+
+
+ +
-
- -
-
-
+ + + + +