Datos mínimos
This commit is contained in:
@@ -8,8 +8,8 @@ ini_set('display_errors', 1);
|
|||||||
ini_set('display_startup_errors', 1);
|
ini_set('display_startup_errors', 1);
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
$ruta = "../";
|
$ruta = "..";
|
||||||
require_once $ruta . "class/c_login.php";
|
require_once "$ruta/class/c_login.php";
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
http_response_code(401);
|
http_response_code(401);
|
||||||
die(json_encode(['error' => 'unauthorized']));
|
die(json_encode(['error' => 'unauthorized']));
|
||||||
@@ -30,17 +30,44 @@ try {
|
|||||||
// ':periodo_id' => $_GET['periodo_id'] > 0 ? $user->periodo_id : null,
|
// ':periodo_id' => $_GET['periodo_id'] > 0 ? $user->periodo_id : null,
|
||||||
':facultad_id' => $user->facultad['facultad_id'],
|
':facultad_id' => $user->facultad['facultad_id'],
|
||||||
':fecha_inicio' => $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? date('Y-m-d'),
|
':fecha_inicio' => $_GET['fecha'] ?? $_GET['fecha_inicio'] ?? date('Y-m-d'),
|
||||||
':fecha_fin' => $baseDate ? date('Y-m-d H:i:s', strtotime($baseDate . ' +24 hours')) : date('Y-m-d H:i:s'),
|
':fecha_fin' => $baseDate ? date('Y-m-d H:i:s', strtotime("$baseDate +24 hours")) : date('Y-m-d H:i:s'),
|
||||||
|
'usuario_id' => $user->user['id'],
|
||||||
];
|
];
|
||||||
$data = $db->query(
|
$data = $db->query(
|
||||||
"SELECT * FROM PUBLIC.AUDITORIA_MAT
|
"WITH AUDITORIA_DATA AS (
|
||||||
WHERE FACULTAD_ID = COALESCE(:facultad_id, FACULTAD_ID)
|
SELECT * FROM PUBLIC.AUDITORIA_MAT
|
||||||
AND REGISTRO_FECHA_IDEAL + HORARIO_HORA between :fecha_inicio AND :fecha_fin
|
WHERE FACULTAD_ID = COALESCE(:facultad_id, FACULTAD_ID)
|
||||||
ORDER BY registro_fecha_ideal asc, horario_hora asc",
|
AND REGISTRO_FECHA_IDEAL + HORARIO_HORA between :fecha_inicio AND :fecha_fin
|
||||||
|
), INSERTION AS (
|
||||||
|
INSERT INTO last_auditoria VALUES (:usuario_id , COALESCE((
|
||||||
|
SELECT jsonb_agg(AUDITORIA_DATA) FROM AUDITORIA_DATA
|
||||||
|
), '[]'::JSONB))
|
||||||
|
ON CONFLICT (usuario_id) DO UPDATE SET auditoria = EXCLUDED.auditoria
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
registro_id,
|
||||||
|
registro_fecha_ideal,
|
||||||
|
horario_id,
|
||||||
|
profesor_id,
|
||||||
|
salon,
|
||||||
|
profesor_clave,
|
||||||
|
profesor_nombre,
|
||||||
|
horario_hora,
|
||||||
|
horario_fin,
|
||||||
|
registro_fecha,
|
||||||
|
color,
|
||||||
|
estado_color,
|
||||||
|
estado_icon,
|
||||||
|
usuario_nombre,
|
||||||
|
registro_fecha_supervisor,
|
||||||
|
comentario,
|
||||||
|
registro_justificada,
|
||||||
|
reposicion_id
|
||||||
|
FROM AUDITORIA_DATA",
|
||||||
$params
|
$params
|
||||||
);
|
);
|
||||||
|
// Print the JSON file
|
||||||
echo json_encode(array_merge($data), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
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']);
|
||||||
|
|||||||
@@ -266,7 +266,7 @@
|
|||||||
<strong>{{ registro.profesor_clave }}</strong>
|
<strong>{{ registro.profesor_clave }}</strong>
|
||||||
{{ registro.profesor_nombre }}
|
{{ registro.profesor_nombre }}
|
||||||
<button type="button" class="ml-3 btn btn-sm btn-outline-primary"
|
<button type="button" class="ml-3 btn btn-sm btn-outline-primary"
|
||||||
@click="store.current.clase_vista = registro" data-toggle="modal"
|
@click="store.current.clase_vista = registro; detalle.obtener_detalle(registro.horario_id, registro.profesor_id)" data-toggle="modal"
|
||||||
data-target="#ver-detalle">
|
data-target="#ver-detalle">
|
||||||
<i class="ing-ojo"></i> detalle
|
<i class="ing-ojo"></i> detalle
|
||||||
</button>
|
</button>
|
||||||
@@ -275,7 +275,6 @@
|
|||||||
|
|
||||||
<td class="text-center align-middle px-2">{{ registro.horario_hora?.slice(0,5) }} -
|
<td class="text-center align-middle px-2">{{ registro.horario_hora?.slice(0,5) }} -
|
||||||
{{registro.horario_fin?.slice(0,5) }}</td>
|
{{registro.horario_fin?.slice(0,5) }}</td>
|
||||||
<!-- -->
|
|
||||||
<td class="text-center align-middle px-2">
|
<td class="text-center align-middle px-2">
|
||||||
<div v-if="registro.registro_fecha">
|
<div v-if="registro.registro_fecha">
|
||||||
<div class="col-12" :class="registro.color">
|
<div class="col-12" :class="registro.color">
|
||||||
@@ -406,7 +405,7 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Correo:</strong>
|
<strong>Correo:</strong>
|
||||||
<a :href="`mailto:${clase_vista.profesor_correo}`"><strong>{{
|
<a :href="`mailto:${clase_vista.profesor_correo}`"><strong>{{
|
||||||
clase_vista.profesor_correo }}</strong></a>
|
detalle.correo }}</strong></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Clave:</strong>
|
<strong>Clave:</strong>
|
||||||
@@ -414,7 +413,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Facultad:</strong>
|
<strong>Facultad:</strong>
|
||||||
{{ clase_vista.facultad }}
|
{{ detalle.facultad }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -423,19 +422,19 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Materia:</strong>
|
<strong>Materia:</strong>
|
||||||
{{ clase_vista.materia }}
|
{{ detalle.materia }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Carrera:</strong>
|
<strong>Carrera:</strong>
|
||||||
{{ clase_vista.carrera }}
|
{{ detalle.carrera }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Nivel:</strong>
|
<strong>Nivel:</strong>
|
||||||
{{ clase_vista.nivel}}
|
{{ detalle.nivel}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Grupo:</strong>
|
<strong>Grupo:</strong>
|
||||||
{{ clase_vista.horario_grupo }}
|
{{ detalle.horario_grupo }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<strong>Horario:</strong>
|
<strong>Horario:</strong>
|
||||||
|
|||||||
Reference in New Issue
Block a user