Excel mejorado
This commit is contained in:
@@ -29,7 +29,7 @@ $data = $db->query(
|
|||||||
auditoria->>'facultad' as facultad,
|
auditoria->>'facultad' as facultad,
|
||||||
auditoria->>'materia' as materia,
|
auditoria->>'materia' as materia,
|
||||||
auditoria->>'carrera' as carrera,
|
auditoria->>'carrera' as carrera,
|
||||||
auditoria->>'horario_grupo' as horario_grupo,
|
NULLIF(auditoria->>'horario_grupo', '') as horario_grupo,
|
||||||
auditoria->>'horario_hora_completa' as horario_hora_completa,
|
auditoria->>'horario_hora_completa' as horario_hora_completa,
|
||||||
auditoria->>'salon' as salon,
|
auditoria->>'salon' as salon,
|
||||||
(
|
(
|
||||||
@@ -48,6 +48,8 @@ $data = $db->query(
|
|||||||
(auditoria->>'estado_supervisor_id')::integer as estado_id,
|
(auditoria->>'estado_supervisor_id')::integer as estado_id,
|
||||||
auditoria->>'registro_retardo' as registro_retardo
|
auditoria->>'registro_retardo' as registro_retardo
|
||||||
FROM last_auditoria
|
FROM last_auditoria
|
||||||
|
JOIN BLOQUE_HORARIO ON BLOQUE_HORARIO.ID = COALESCE(:bloque_horario_id, BLOQUE_HORARIO.ID)
|
||||||
|
AND ((auditoria->>'horario_hora')::TIME, (auditoria->>'horario_fin')::TIME) OVERLAPS (HORA_INICIO, HORA_FIN)
|
||||||
WHERE USUARIO_ID = :usuario_id
|
WHERE USUARIO_ID = :usuario_id
|
||||||
AND auditoria->>'facultad_id' = COALESCE(:facultad_id, auditoria->>'facultad_id')
|
AND auditoria->>'facultad_id' = COALESCE(:facultad_id, auditoria->>'facultad_id')
|
||||||
AND auditoria->>'profesor_clave' = COALESCE(:profesor_clave, auditoria->>'profesor_clave')",
|
AND auditoria->>'profesor_clave' = COALESCE(:profesor_clave, auditoria->>'profesor_clave')",
|
||||||
@@ -55,6 +57,7 @@ $data = $db->query(
|
|||||||
'usuario_id' => $user->user['id'],
|
'usuario_id' => $user->user['id'],
|
||||||
'facultad_id' => $params['facultad_id'],
|
'facultad_id' => $params['facultad_id'],
|
||||||
'profesor_clave' => $profesor_clave,
|
'profesor_clave' => $profesor_clave,
|
||||||
|
'bloque_horario_id' => $params['bloque_horario']
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -188,15 +191,20 @@ const DEFAULT_STYLE = [
|
|||||||
function getFormattedValue($key, $registro)
|
function getFormattedValue($key, $registro)
|
||||||
{
|
{
|
||||||
return match ($key) {
|
return match ($key) {
|
||||||
'asistencia' => is_null($registro['registro_fecha']) ? "Sin registro" : ($registro['registro_retardo'] ? "Retardo " : "Asistencia "),
|
'asistencia' => $registro['registro_fecha'] === null
|
||||||
|
? "Sin registro"
|
||||||
|
: ($registro['registro_retardo'] ? "Retardo " : "Asistencia "),
|
||||||
'registro_fecha',
|
'registro_fecha',
|
||||||
'registro_fecha_supervisor' => $registro[$key] === null ? 'Sin registro' : date('H:i', strtotime($registro[$key])),
|
'registro_fecha_supervisor' => $registro[$key] === null
|
||||||
|
? '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' => $registro[$key] ?? "Sin registro",
|
'usuario_nombre' => $registro[$key] ?? "Sin registro",
|
||||||
'salon_array' => $registro[$key],
|
'salon_array' => $registro[$key],
|
||||||
'justificacion',
|
'justificacion',
|
||||||
'comentario' => $registro[$key] ?? "Sin registro",
|
'comentario' => $registro[$key] ?? "Sin registro",
|
||||||
|
'horario_grupo' => $registro[$key] ?? "Sin registro",
|
||||||
'profesor_correo' => $registro[$key] ?? "Sin correo",
|
'profesor_correo' => $registro[$key] ?? "Sin correo",
|
||||||
default => $registro[$key]
|
default => $registro[$key]
|
||||||
};
|
};
|
||||||
@@ -230,7 +238,7 @@ foreach ($data as $index => $registro) {
|
|||||||
|
|
||||||
foreach ($sheet->getColumnIterator() as $column) {
|
foreach ($sheet->getColumnIterator() as $column) {
|
||||||
$colIndex = $column->getColumnIndex();
|
$colIndex = $column->getColumnIndex();
|
||||||
if ($colIndex === 'Q') {
|
if (in_array($colIndex, ['Q', 'R'])) {
|
||||||
$sheet->getColumnDimension($colIndex)->setWidth(100); // Ajusta el valor según el tamaño deseado
|
$sheet->getColumnDimension($colIndex)->setWidth(100); // Ajusta el valor según el tamaño deseado
|
||||||
} else {
|
} else {
|
||||||
$sheet->getColumnDimension($colIndex)->setAutoSize(true);
|
$sheet->getColumnDimension($colIndex)->setAutoSize(true);
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ const store = reactive({
|
|||||||
'facultad_id': store.filters.facultad_id,
|
'facultad_id': store.filters.facultad_id,
|
||||||
'estados': store.filters.estados,
|
'estados': store.filters.estados,
|
||||||
'profesor': store.filters.profesor,
|
'profesor': store.filters.profesor,
|
||||||
|
'bloque_horario': store.filters.bloque_horario,
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
const blob = await res.blob();
|
const blob = await res.blob();
|
||||||
|
|||||||
Reference in New Issue
Block a user