Añadir justificaciones

This commit is contained in:
2023-08-16 19:19:00 +00:00
parent 094cf8b611
commit 9ce1dee313
5 changed files with 422 additions and 137 deletions

View File

@@ -25,18 +25,29 @@ try {
SELECT fechas_clase(h.horario_id) as registro_fecha_ideal, h.horario_id
FROM horarios h
)
SELECT estado_supervisor.*, usuario.*, registro.*, profesor.*, horarios.*, fechas.*
SELECT estado_supervisor.*, usuario.*, registro.*, profesor.*, horarios.*, fechas.*,
justificador.usuario_nombre as justificador_nombre,
justificador.usuario_clave as justificador_clave,
facultad.facultad_nombre as justificador_facultad,
rol.rol_titulo as justificador_rol
FROM horarios
JOIN fechas using (horario_id)
JOIN horario_profesor using (horario_id)
JOIN profesor using (profesor_id)
LEFT JOIN registro USING (horario_id, registro_fecha_ideal, profesor_id)
left join estado_supervisor using (estado_supervisor_id)
LEFT join estado_supervisor using (estado_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 ROL on ROL.rol_id = justificador.rol_id
left join facultad on facultad.facultad_id = justificador.facultad_id
WHERE fechas.registro_fecha_ideal BETWEEN COALESCE(:fecha_inicio, LEAST(CURRENT_DATE, PERIODO_FECHA_FIN)) AND COALESCE(:fecha_fin, LEAST(CURRENT_DATE, PERIODO_FECHA_FIN))
ORDER BY fechas.registro_fecha_ideal DESC, horarios.horario_id, profesor_nombre",
[
':periodo_id' => $user->periodo_id,
':facultad_id' => $user->facultad['facultad_id'],
':fecha_inicio' => $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? null,
':fecha_fin' => $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null,
]
);