Sin auditoría Mat

This commit is contained in:
Your Name
2025-02-24 09:02:51 -06:00
parent 272d509a05
commit 13f1e3b26d
4 changed files with 29 additions and 30 deletions

View File

@@ -19,7 +19,6 @@ $user = unserialize($_SESSION['user']);
// check method
try {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// pg_send_query($db->getConnection(), "REFRESH MATERIALIZED VIEW CONCURRENTLY PUBLIC.AUDITORIA_MAT");
$baseDate = $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null;
$params = [
@@ -33,9 +32,9 @@ try {
// Define relevant columns
$relevant_columns = [
'registro_id',
'registro_fecha_ideal',
'horario_id',
'profesor_id',
'fechas.registro_fecha_ideal',
'fechas.horario_id',
'profesor.profesor_id',
'salon',
'profesor_clave',
'profesor_nombre',
@@ -56,20 +55,21 @@ try {
$RelevantColumns = implode(', ', $relevant_columns);
$_SESSION['fecha_inicio'] = $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? date('Y-m-d');
$_SESSION['fecha_fin'] = date('Y-m-d H:i:s', strtotime(($baseDate ?? 'now') . ' +24 hours'));
$_SESSION['fecha_fin'] = date('Y-m-d H:i:s', strtotime($baseDate ?? 'now'));
$fechas = [
'fecha_inicio' => $_SESSION['fecha_inicio'],
'fecha_fin' => $_SESSION['fecha_fin'],
];
$PeriodosHorarios = implode(',', array_column(
$db->query(
'SELECT periodo_id FROM periodo WHERE (:fecha_inicio, :fecha_fin) OVERLAPS (periodo_fecha_inicio, periodo_fecha_fin)',
$fechas
),
'periodo_id'
));
)) ?: 0;
$DaysWeek = implode(',', array_values(array_unique(array_map(
@@ -79,7 +79,7 @@ try {
new DateInterval('P1D'),
(new DateTime($_SESSION['fecha_fin']))->modify('+1 day')
))
))));
)))) ?: 0;
$_SESSION['horarios'] = $HorariosID = implode(',', array_column($db->query(
"SELECT horario_id FROM horario
@@ -90,7 +90,7 @@ try {
array_merge($fechas, [
':facultad_id' => $user->facultad['facultad_id'],
])
), 'horario_id'));
), 'horario_id')) ?: 0;
$Horarios = $db->query(
@@ -100,8 +100,10 @@ try {
_todos => false,
_fecha_inicio => :fecha_inicio,
_fecha_fin => :fecha_fin
) AS registro_fecha_ideal, h.horario_id
FROM horario h WHERE horario_id IN ($HorariosID)
) AS registro_fecha_ideal, h.horario_id, profesor_id
FROM horario h
JOIN horario_profesor USING (horario_id)
WHERE horario_id IN ($HorariosID)
)
SELECT
$RelevantColumns,
@@ -110,11 +112,13 @@ try {
ELSE 'primary'
END AS color
FROM horario
NATURAL JOIN fechas
NATURAL JOIN horario_profesor
NATURAL JOIN profesor
NATURAL JOIN salon
LEFT JOIN REGISTRO USING (profesor_id, registro_fecha_ideal, horario_id)
JOIN fechas USING (horario_id)
JOIN profesor USING (profesor_id)
JOIN salon USING (salon_id)
LEFT JOIN REGISTRO ON
REGISTRO.profesor_id = PROFESOR.profesor_id AND
REGISTRO.horario_id = FECHAS.horario_id AND
FECHAS.registro_fecha_ideal = REGISTRO.registro_fecha_ideal
LEFT JOIN usuario ON usuario.usuario_id = REGISTRO.supervisor_id
JOIN estado_supervisor ON estado_supervisor.estado_supervisor_id = COALESCE(REGISTRO.estado_supervisor_id, 0)
ORDER BY fechas.registro_fecha_ideal, horario_hora",

View File

@@ -33,6 +33,7 @@ try {
facultad_nombre as facultad,
carrera_nombre as carrera,
registro_fecha,
registro_fecha_supervisor,
estado_color,
estado_supervisor.estado_supervisor_id,
estado_supervisor.nombre,
@@ -40,7 +41,7 @@ try {
usuario_nombre,
horario_grupo,
registro_retardo,
justificada,
registro_justificada,
justificacion,
comentario,
CASE
@@ -65,11 +66,6 @@ try {
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
echo json_encode($data);
} else {
http_response_code(405);

View File

@@ -39,9 +39,6 @@ try {
]
);
$db->query("REFRESH MATERIALIZED VIEW CONCURRENTLY PUBLIC.AUDITORIA_MAT");
$data_justificador = $db->querySingle(
"SELECT justificador.usuario_nombre as justificador_nombre,
justificador.usuario_clave as justificador_clave,

View File

@@ -395,7 +395,7 @@
</div>
<div class="modal" tabindex="-1" id="ver-detalle">
<div class="modal-dialog modal-dialog-centered modal-xl" v-if="clase_vista">
<div class="modal-content">
<div class="modal-content" :data-id="clase_vista.horario_id">
<div class="modal-body detalle">
<nav style="cursor: pointer;" class="modal-close pe-auto"
@click="$('#ver-detalle').modal('hide');">
@@ -432,8 +432,10 @@
{{clase_vista.usuario_nombre}}
</span>
<span class="supervisor_hora">
{{`${new Date(clase_vista.registro_fecha_supervisor).toTimeString().slice(0,
5)}`}}
<strong>A las </strong>
<time datetime="clase_vista.registro_fecha_supervisor">{{`${new
Date(clase_vista.registro_fecha_supervisor).toTimeString().slice(0,
5)}`}}</time>
</span>
</div>
<footer>Supervisor</footer>
@@ -448,7 +450,8 @@
<section class="la-salle-regular">
<span class="font-weight-bold">
{{ new
Date(`${clase_vista.registro_fecha_ideal} 00:00`).toLocaleDateString('es-MX', {
Date(`${clase_vista.registro_fecha_ideal}
00:00`).toLocaleDateString('es-MX', {
weekday: 'long' }).replace(/^\w/, c => c.toUpperCase()) }}
</span>
<span class="font-italic font-weight-light">de</span>
@@ -469,8 +472,7 @@
</main>
</div>
<div class="pp-card" style="grid-row: span 3">
<div class="bg-primary text-white"
v-if="clase_vista.registro_justificada">
<div class="bg-primary text-white" v-if="clase_vista.registro_justificada">
<span>Justificada</span>
<i class="ing-finalistas"></i>
</div>