Sin auditoría Mat
This commit is contained in:
@@ -19,7 +19,6 @@ $user = unserialize($_SESSION['user']);
|
|||||||
// check method
|
// check method
|
||||||
try {
|
try {
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
// pg_send_query($db->getConnection(), "REFRESH MATERIALIZED VIEW CONCURRENTLY PUBLIC.AUDITORIA_MAT");
|
|
||||||
$baseDate = $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null;
|
$baseDate = $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null;
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
@@ -33,9 +32,9 @@ try {
|
|||||||
// Define relevant columns
|
// Define relevant columns
|
||||||
$relevant_columns = [
|
$relevant_columns = [
|
||||||
'registro_id',
|
'registro_id',
|
||||||
'registro_fecha_ideal',
|
'fechas.registro_fecha_ideal',
|
||||||
'horario_id',
|
'fechas.horario_id',
|
||||||
'profesor_id',
|
'profesor.profesor_id',
|
||||||
'salon',
|
'salon',
|
||||||
'profesor_clave',
|
'profesor_clave',
|
||||||
'profesor_nombre',
|
'profesor_nombre',
|
||||||
@@ -56,20 +55,21 @@ try {
|
|||||||
$RelevantColumns = implode(', ', $relevant_columns);
|
$RelevantColumns = implode(', ', $relevant_columns);
|
||||||
|
|
||||||
$_SESSION['fecha_inicio'] = $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? date('Y-m-d');
|
$_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 = [
|
$fechas = [
|
||||||
'fecha_inicio' => $_SESSION['fecha_inicio'],
|
'fecha_inicio' => $_SESSION['fecha_inicio'],
|
||||||
'fecha_fin' => $_SESSION['fecha_fin'],
|
'fecha_fin' => $_SESSION['fecha_fin'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
$PeriodosHorarios = implode(',', array_column(
|
$PeriodosHorarios = implode(',', array_column(
|
||||||
$db->query(
|
$db->query(
|
||||||
'SELECT periodo_id FROM periodo WHERE (:fecha_inicio, :fecha_fin) OVERLAPS (periodo_fecha_inicio, periodo_fecha_fin)',
|
'SELECT periodo_id FROM periodo WHERE (:fecha_inicio, :fecha_fin) OVERLAPS (periodo_fecha_inicio, periodo_fecha_fin)',
|
||||||
$fechas
|
$fechas
|
||||||
),
|
),
|
||||||
'periodo_id'
|
'periodo_id'
|
||||||
));
|
)) ?: 0;
|
||||||
|
|
||||||
|
|
||||||
$DaysWeek = implode(',', array_values(array_unique(array_map(
|
$DaysWeek = implode(',', array_values(array_unique(array_map(
|
||||||
@@ -79,7 +79,7 @@ try {
|
|||||||
new DateInterval('P1D'),
|
new DateInterval('P1D'),
|
||||||
(new DateTime($_SESSION['fecha_fin']))->modify('+1 day')
|
(new DateTime($_SESSION['fecha_fin']))->modify('+1 day')
|
||||||
))
|
))
|
||||||
))));
|
)))) ?: 0;
|
||||||
|
|
||||||
$_SESSION['horarios'] = $HorariosID = implode(',', array_column($db->query(
|
$_SESSION['horarios'] = $HorariosID = implode(',', array_column($db->query(
|
||||||
"SELECT horario_id FROM horario
|
"SELECT horario_id FROM horario
|
||||||
@@ -90,7 +90,7 @@ try {
|
|||||||
array_merge($fechas, [
|
array_merge($fechas, [
|
||||||
':facultad_id' => $user->facultad['facultad_id'],
|
':facultad_id' => $user->facultad['facultad_id'],
|
||||||
])
|
])
|
||||||
), 'horario_id'));
|
), 'horario_id')) ?: 0;
|
||||||
|
|
||||||
|
|
||||||
$Horarios = $db->query(
|
$Horarios = $db->query(
|
||||||
@@ -100,8 +100,10 @@ try {
|
|||||||
_todos => false,
|
_todos => false,
|
||||||
_fecha_inicio => :fecha_inicio,
|
_fecha_inicio => :fecha_inicio,
|
||||||
_fecha_fin => :fecha_fin
|
_fecha_fin => :fecha_fin
|
||||||
) AS registro_fecha_ideal, h.horario_id
|
) AS registro_fecha_ideal, h.horario_id, profesor_id
|
||||||
FROM horario h WHERE horario_id IN ($HorariosID)
|
FROM horario h
|
||||||
|
JOIN horario_profesor USING (horario_id)
|
||||||
|
WHERE horario_id IN ($HorariosID)
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
$RelevantColumns,
|
$RelevantColumns,
|
||||||
@@ -110,11 +112,13 @@ try {
|
|||||||
ELSE 'primary'
|
ELSE 'primary'
|
||||||
END AS color
|
END AS color
|
||||||
FROM horario
|
FROM horario
|
||||||
NATURAL JOIN fechas
|
JOIN fechas USING (horario_id)
|
||||||
NATURAL JOIN horario_profesor
|
JOIN profesor USING (profesor_id)
|
||||||
NATURAL JOIN profesor
|
JOIN salon USING (salon_id)
|
||||||
NATURAL JOIN salon
|
LEFT JOIN REGISTRO ON
|
||||||
LEFT JOIN REGISTRO USING (profesor_id, registro_fecha_ideal, horario_id)
|
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
|
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)
|
JOIN estado_supervisor ON estado_supervisor.estado_supervisor_id = COALESCE(REGISTRO.estado_supervisor_id, 0)
|
||||||
ORDER BY fechas.registro_fecha_ideal, horario_hora",
|
ORDER BY fechas.registro_fecha_ideal, horario_hora",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ try {
|
|||||||
facultad_nombre as facultad,
|
facultad_nombre as facultad,
|
||||||
carrera_nombre as carrera,
|
carrera_nombre as carrera,
|
||||||
registro_fecha,
|
registro_fecha,
|
||||||
|
registro_fecha_supervisor,
|
||||||
estado_color,
|
estado_color,
|
||||||
estado_supervisor.estado_supervisor_id,
|
estado_supervisor.estado_supervisor_id,
|
||||||
estado_supervisor.nombre,
|
estado_supervisor.nombre,
|
||||||
@@ -40,7 +41,7 @@ try {
|
|||||||
usuario_nombre,
|
usuario_nombre,
|
||||||
horario_grupo,
|
horario_grupo,
|
||||||
registro_retardo,
|
registro_retardo,
|
||||||
justificada,
|
registro_justificada,
|
||||||
justificacion,
|
justificacion,
|
||||||
comentario,
|
comentario,
|
||||||
CASE
|
CASE
|
||||||
@@ -65,11 +66,6 @@ try {
|
|||||||
AND profesor.profesor_id = :profesor_id",
|
AND profesor.profesor_id = :profesor_id",
|
||||||
$_GET
|
$_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);
|
echo json_encode($data);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ try {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->query("REFRESH MATERIALIZED VIEW CONCURRENTLY PUBLIC.AUDITORIA_MAT");
|
|
||||||
|
|
||||||
|
|
||||||
$data_justificador = $db->querySingle(
|
$data_justificador = $db->querySingle(
|
||||||
"SELECT justificador.usuario_nombre as justificador_nombre,
|
"SELECT justificador.usuario_nombre as justificador_nombre,
|
||||||
justificador.usuario_clave as justificador_clave,
|
justificador.usuario_clave as justificador_clave,
|
||||||
|
|||||||
@@ -395,7 +395,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal" tabindex="-1" id="ver-detalle">
|
<div class="modal" tabindex="-1" id="ver-detalle">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl" v-if="clase_vista">
|
<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">
|
<div class="modal-body detalle">
|
||||||
<nav style="cursor: pointer;" class="modal-close pe-auto"
|
<nav style="cursor: pointer;" class="modal-close pe-auto"
|
||||||
@click="$('#ver-detalle').modal('hide');">
|
@click="$('#ver-detalle').modal('hide');">
|
||||||
@@ -432,8 +432,10 @@
|
|||||||
{{clase_vista.usuario_nombre}}
|
{{clase_vista.usuario_nombre}}
|
||||||
</span>
|
</span>
|
||||||
<span class="supervisor_hora">
|
<span class="supervisor_hora">
|
||||||
{{`${new Date(clase_vista.registro_fecha_supervisor).toTimeString().slice(0,
|
<strong>A las </strong>
|
||||||
5)}`}}
|
<time datetime="clase_vista.registro_fecha_supervisor">{{`${new
|
||||||
|
Date(clase_vista.registro_fecha_supervisor).toTimeString().slice(0,
|
||||||
|
5)}`}}</time>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<footer>Supervisor</footer>
|
<footer>Supervisor</footer>
|
||||||
@@ -448,7 +450,8 @@
|
|||||||
<section class="la-salle-regular">
|
<section class="la-salle-regular">
|
||||||
<span class="font-weight-bold">
|
<span class="font-weight-bold">
|
||||||
{{ new
|
{{ 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()) }}
|
weekday: 'long' }).replace(/^\w/, c => c.toUpperCase()) }}
|
||||||
</span>
|
</span>
|
||||||
<span class="font-italic font-weight-light">de</span>
|
<span class="font-italic font-weight-light">de</span>
|
||||||
@@ -469,8 +472,7 @@
|
|||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<div class="pp-card" style="grid-row: span 3">
|
<div class="pp-card" style="grid-row: span 3">
|
||||||
<div class="bg-primary text-white"
|
<div class="bg-primary text-white" v-if="clase_vista.registro_justificada">
|
||||||
v-if="clase_vista.registro_justificada">
|
|
||||||
<span>Justificada</span>
|
<span>Justificada</span>
|
||||||
<i class="ing-finalistas"></i>
|
<i class="ing-finalistas"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user