Agregar Unidad
Some checks are pending
Deploy Pruebas / deploy (push) Waiting to run

This commit is contained in:
2024-08-19 10:29:40 -06:00
parent 4e1c24c7e2
commit 3148415c11
2 changed files with 14 additions and 12 deletions

View File

@@ -39,6 +39,7 @@ try {
PERIODO.periodo_fecha_inicio, PERIODO.periodo_fecha_inicio,
PERIODO.periodo_fecha_fin, PERIODO.periodo_fecha_fin,
salon, salon,
salon_array,
COALESCE(materia_nombre, materia_asignacion_materia) as materia, COALESCE(materia_nombre, materia_asignacion_materia) as materia,
coalesce(carrera_nombre, materia_asignacion_carrera) as carrera, coalesce(carrera_nombre, materia_asignacion_carrera) as carrera,
facultad_nombre as facultad, facultad_nombre as facultad,
@@ -51,7 +52,7 @@ try {
join facultad on facultad.facultad_id = horario.facultad_id join facultad on facultad.facultad_id = horario.facultad_id
JOIN PERIODO USING (periodo_id) JOIN PERIODO USING (periodo_id)
JOIN nivel on periodo.nivel_id = nivel.nivel_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)) WHERE (PERIODO.periodo_id, horario.facultad_id) = (COALESCE(:periodo_id, PERIODO.periodo_id), COALESCE(:facultad_id, horario.facultad_id))
), ),
fechas AS ( fechas AS (
@@ -70,7 +71,7 @@ try {
registro_fecha_justificacion, registro_fecha_justificacion,
profesor.profesor_id, profesor_nombre, profesor_clave, profesor_correo, profesor.profesor_id, profesor_nombre, profesor_clave, profesor_correo,
horario_id, 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, fechas.registro_fecha_ideal,
estado_supervisor.estado_supervisor_id as estado_supervisor_id, estado_supervisor.estado_supervisor_id as estado_supervisor_id,
estado_supervisor.nombre as nombre, estado_supervisor.nombre as nombre,
@@ -84,6 +85,7 @@ try {
reposicion_fecha, reposicion_fecha,
reposicion_hora, reposicion_hora,
salon_reposicion.salon as reposicion_salon, 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 CASE WHEN registro_retardo THEN 'warning' ELSE 'primary' END as color
FROM horarios FROM horarios
JOIN fechas using (horario_id) JOIN fechas using (horario_id)
@@ -91,7 +93,7 @@ try {
JOIN profesor using (profesor_id) JOIN profesor using (profesor_id)
LEFT JOIN registro USING (horario_id, registro_fecha_ideal, profesor_id) LEFT JOIN registro USING (horario_id, registro_fecha_ideal, profesor_id)
LEFT JOIN reposicion USING (reposicion_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) 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 ON USUARIO.usuario_id = REGISTRO.supervisor_id
LEFT JOIN USUARIO JUSTIFICADOR ON JUSTIFICADOR.usuario_id = REGISTRO.justificador_id LEFT JOIN USUARIO JUSTIFICADOR ON JUSTIFICADOR.usuario_id = REGISTRO.justificador_id

View File

@@ -1,3 +1,4 @@
<?php <?php
$fecha = date('d_m_Y'); $fecha = date('d_m_Y');
@@ -43,6 +44,7 @@ $data_excel = array(
"GRUPO" => 'horario_grupo', "GRUPO" => 'horario_grupo',
"HORARIO" => 'horario_hora_completa', "HORARIO" => 'horario_hora_completa',
"SALÓN" => 'salon', "SALÓN" => 'salon',
"UNIDAD" => 'salon_array'
"REGISTRO PROFESOR" => 'asistencia', "REGISTRO PROFESOR" => 'asistencia',
"HORA DE REGISTRO" => 'registro_fecha', "HORA DE REGISTRO" => 'registro_fecha',
"NOMBRE SUPERVISOR" => 'usuario_nombre', "NOMBRE SUPERVISOR" => 'usuario_nombre',
@@ -130,17 +132,15 @@ const DEFAULT_STYLE = [
function getFormattedValue($key, $registro) function getFormattedValue($key, $registro)
{ {
return match ($key) { return match ($key) {
'asistencia' => is_null($registro['registro_fecha']) 'asistencia' => is_null($registro['registro_fecha']) ? "Sin registro" : ($registro['registro_retardo'] ? "Retardo " : "Asistencia "),
? "Sin registro" 'registro_fecha',
: ($registro['registro_retardo'] ? "Retardo " : "Asistencia "), 'registro_fecha_supervisor' => is_null($registro[$key]) ? 'Sin registro' : date('H:i', strtotime($registro[$key])),
'registro_fecha', 'registro_fecha_supervisor' =>
is_null($registro[$key])
? 'Sin registro'
: date('H:i', strtotime($registro[$key])),
'nombre' => $registro[$key] ?? "Sin registro", 'nombre' => $registro[$key] ?? "Sin registro",
'horario_hora_completa' => "{$registro['horario_hora']} - {$registro['horario_fin']}", 'horario_hora_completa' => "{$registro['horario_hora']} - {$registro['horario_fin']}",
'usuario_nombre', 'justificacion', 'comentario' => 'usuario_nombre',
$registro[$key] ?? "Sin registro", 'salon_array' => implode(", ", json_decode($registro[$key], true));
'justificacion',
'comentario' => $registro[$key] ?? "Sin registro",
default => $registro[$key] default => $registro[$key]
}; };
} }