Alumno detalle

This commit is contained in:
Your Name
2025-02-21 16:22:07 -06:00
parent 2f392964ad
commit 272d509a05

View File

@@ -20,13 +20,57 @@ $user = unserialize($_SESSION['user']);
try { try {
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$data = $db $data = $db->querySingle(
->where('registro_fecha_ideal', $_GET['registro_fecha_ideal']) "SELECT
->where('horario_id', $_GET['horario_id']) :registro_fecha_ideal as registro_fecha_ideal,
->where('profesor_id', $_GET['profesor_id']) horario_hora,
->getOne('auditoria_mat'); horario_fin,
profesor_nombre,
profesor_correo,
profesor_clave,
horario.facultad_id,
materia_nombre as materia,
facultad_nombre as facultad,
carrera_nombre as carrera,
registro_fecha,
estado_color,
estado_supervisor.estado_supervisor_id,
estado_supervisor.nombre,
estado_icon,
usuario_nombre,
horario_grupo,
registro_retardo,
justificada,
justificacion,
comentario,
CASE
WHEN registro.registro_retardo THEN 'warning'
ELSE 'primary'
END AS color
FROM horario
NATURAL JOIN facultad
NATURAL JOIN materia
NATURAL JOIN carrera
NATURAL JOIN horario_profesor
NATURAL JOIN profesor
LEFT JOIN registro ON
REGISTRO.HORARIO_ID = HORARIO.HORARIO_ID AND
REGISTRO.PROFESOR_ID = HORARIO_PROFESOR.PROFESOR_ID AND
REGISTRO.REGISTRO_FECHA_IDEAL = :registro_fecha_ideal
LEFT JOIN estado_supervisor ON estado_supervisor.estado_supervisor_id = COALESCE(registro.estado_supervisor_id, 0)
LEFT JOIN usuario ON usuario_id = supervisor_id
WHERE horario.horario_id = :horario_id
AND profesor.profesor_id = :profesor_id",
$_GET
);
/* ->where('registro_fecha_ideal', $_GET['registro_fecha_ideal'])
->where('horario_id', $_GET['horario_id'])
->where('profesor_id', $_GET['profesor_id'])
->getOne('auditoria_mat'); */
// Print the JSON file // Print the JSON file
echo json_encode(array_merge($data, ['query' => $db->getLastQuery(), 'get' => $_GET])); echo json_encode($data);
} else { } else {
http_response_code(405); http_response_code(405);
echo json_encode(['error' => 'method not allowed']); echo json_encode(['error' => 'method not allowed']);