diff --git a/action/action_auditoria.php b/action/action_auditoria.php index 0af4bbf..a937cdd 100644 --- a/action/action_auditoria.php +++ b/action/action_auditoria.php @@ -39,6 +39,7 @@ try { PERIODO.periodo_fecha_inicio, PERIODO.periodo_fecha_fin, salon, + salon_array, COALESCE(materia_nombre, materia_asignacion_materia) as materia, coalesce(carrera_nombre, materia_asignacion_carrera) as carrera, facultad_nombre as facultad, @@ -51,7 +52,7 @@ try { join facultad on facultad.facultad_id = horario.facultad_id JOIN PERIODO USING (periodo_id) JOIN nivel on periodo.nivel_id = nivel.nivel_id - JOIN SALON USING (salon_id) + JOIN SALON_VIEW_MAT USING (salon_id) WHERE (PERIODO.periodo_id, horario.facultad_id) = (COALESCE(:periodo_id, PERIODO.periodo_id), COALESCE(:facultad_id, horario.facultad_id)) ), fechas AS ( @@ -70,7 +71,7 @@ try { registro_fecha_justificacion, profesor.profesor_id, profesor_nombre, profesor_clave, profesor_correo, horario_id, - materia, carrera, horarios.facultad_id, facultad, nivel, horario_hora, horario_fin, horario_grupo, horarios.salon, + materia, carrera, horarios.facultad_id, facultad, nivel, horario_hora, horario_fin, horario_grupo, horarios_salon, horarios.salon_array, fechas.registro_fecha_ideal, estado_supervisor.estado_supervisor_id as estado_supervisor_id, estado_supervisor.nombre as nombre, @@ -84,6 +85,7 @@ try { reposicion_fecha, reposicion_hora, salon_reposicion.salon as reposicion_salon, + salon_reposicion.salon_array as reposicion_salon_array, CASE WHEN registro_retardo THEN 'warning' ELSE 'primary' END as color FROM horarios JOIN fechas using (horario_id) @@ -91,7 +93,7 @@ try { JOIN profesor using (profesor_id) LEFT JOIN registro USING (horario_id, registro_fecha_ideal, profesor_id) LEFT JOIN reposicion USING (reposicion_id) - LEFT JOIN salon as salon_reposicion ON salon_reposicion.salon_id = reposicion.salon_id + LEFT JOIN salon_view_mat as salon_reposicion ON salon_reposicion.salon_id = reposicion.salon_id join estado_supervisor ON estado_supervisor.estado_supervisor_id = COALESCE(registro.estado_supervisor_id, 0) LEFT JOIN USUARIO ON USUARIO.usuario_id = REGISTRO.supervisor_id LEFT JOIN USUARIO JUSTIFICADOR ON JUSTIFICADOR.usuario_id = REGISTRO.justificador_id diff --git a/export/supervisor_excel.php b/export/supervisor_excel.php index 9b5883d..2e90384 100644 --- a/export/supervisor_excel.php +++ b/export/supervisor_excel.php @@ -1,3 +1,4 @@ + 'horario_grupo', "HORARIO" => 'horario_hora_completa', "SALÓN" => 'salon', + "UNIDAD" => 'salon_array' "REGISTRO PROFESOR" => 'asistencia', "HORA DE REGISTRO" => 'registro_fecha', "NOMBRE SUPERVISOR" => 'usuario_nombre', @@ -130,17 +132,15 @@ const DEFAULT_STYLE = [ function getFormattedValue($key, $registro) { return match ($key) { - 'asistencia' => is_null($registro['registro_fecha']) - ? "Sin registro" - : ($registro['registro_retardo'] ? "Retardo " : "Asistencia "), - 'registro_fecha', 'registro_fecha_supervisor' => - is_null($registro[$key]) - ? 'Sin registro' - : date('H:i', strtotime($registro[$key])), + 'asistencia' => is_null($registro['registro_fecha']) ? "Sin registro" : ($registro['registro_retardo'] ? "Retardo " : "Asistencia "), + 'registro_fecha', + 'registro_fecha_supervisor' => is_null($registro[$key]) ? 'Sin registro' : date('H:i', strtotime($registro[$key])), 'nombre' => $registro[$key] ?? "Sin registro", 'horario_hora_completa' => "{$registro['horario_hora']} - {$registro['horario_fin']}", - 'usuario_nombre', 'justificacion', 'comentario' => - $registro[$key] ?? "Sin registro", + 'usuario_nombre', + 'salon_array' => implode(", ", json_decode($registro[$key], true)); + 'justificacion', + 'comentario' => $registro[$key] ?? "Sin registro", default => $registro[$key] }; }