Update code with changes from git diff

This commit is contained in:
2023-11-10 18:15:14 +00:00
parent 2e00fbec20
commit 2173869717
33 changed files with 7013 additions and 615 deletions

View File

@@ -2,8 +2,8 @@
#input $_GET['id_espacio_sgu']
#output rutas: [ ...ruta, salones: [{...salon}] ]
header('Content-Type: application/json charset=utf-8');
ini_set('memory_limit', '256M');
ini_set('post_max_size', '256M');
ini_set('memory_limit', '500M');
ini_set('post_max_size', '500M');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@@ -39,16 +39,18 @@ try {
PERIODO.periodo_fecha_inicio,
PERIODO.periodo_fecha_fin,
salon,
materia_nombre as materia,
COALESCE(materia_nombre, materia_asignacion_materia) as materia,
carrera_nombre as carrera,
facultad_nombre as facultad,
nivel_nombre as nivel,
horario_fin
FROM horario
left JOIN materia USING (materia_id)
JOIN carrera USING (carrera_id)
LEFT JOIN carrera USING (carrera_id)
left join materia_asignacion using (horario_id)
-- JOIN carrera USING (carrera_id) but if carrera_id is null then 0
JOIN nivel USING (nivel_id)
JOIN facultad ON facultad.facultad_id = carrera.facultad_id
JOIN facultad ON facultad.facultad_id = COALESCE(carrera.facultad_id, 0)
JOIN PERIODO USING (periodo_id)
JOIN SALON USING (salon_id)
WHERE (PERIODO.periodo_id, facultad.facultad_id) = (:periodo_id, COALESCE(:facultad_id, facultad.facultad_id))
@@ -97,12 +99,14 @@ try {
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 + HORARIO_HORA) BETWEEN
GREATEST(HORARIO_FECHA_INICIO, PERIODO_FECHA_INICIO, :fecha_inicio) AND LEAST(:fecha_fin, PERIODO_FECHA_FIN, HORARIO_FECHA_FIN)
GREATEST(HORARIO_FECHA_INICIO, PERIODO_FECHA_INICIO, :fecha_inicio) AND LEAST(PERIODO_FECHA_FIN, HORARIO_FECHA_FIN, :fecha_fin)
ORDER BY fechas.registro_fecha_ideal DESC, horarios.horario_id, profesor_nombre",
$params
);
// $user->print_to_log(json_encode($params));
$db->delete('general_log');
$db->insert('general_log', [
'general_log_json' => json_encode($params, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT),
]);
echo json_encode(array_merge($data), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
} else {
http_response_code(405);