Merge remote-tracking branch 'refs/remotes/origin/Pruebas' into Pruebas

This commit is contained in:
2024-04-17 15:55:35 -06:00
2 changed files with 5 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ try {
$baseDate = $_GET['fecha'] ?? $_GET['fecha_fin'] ?? null;
$params = [
':periodo_id' => $_GET['periodo_id'] == 1 ? $user->periodo_id : null,
':periodo_id' => $_GET['periodo_id'] > 0 ? $user->periodo_id : null,
':facultad_id' => $user->facultad['facultad_id'],
':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'),

View File

@@ -198,17 +198,15 @@ const store = reactive({
// if (!store.filters.facultad_id || !store.filters.periodo_id) return
this.loading = true;
this.data = [];
const params = {
facultad_id: 19,
periodo_id: 2,
};
const params = {};
if (fecha)
params['fecha'] = fecha;
if (fecha_inicio)
params['fecha_inicio'] = fecha_inicio;
if (fecha_fin)
params['fecha_fin'] = fecha_fin;
params['periodo_id'] = store.filters.todos_los_periodos ? 1 : 0;
params['periodo_id'] = store.filters.todos_los_periodos ? 0 : store.periodo.periodo_id;
console.log(store.periodo);
const paramsUrl = new URLSearchParams(params).toString();
try {
const res = await fetch(`action/action_auditoria.php?${paramsUrl}`, {
@@ -335,12 +333,12 @@ createApp({
async mounted() {
$('div.modal#cargando').modal('show');
try {
store.periodo = await fetch('action/periodo_datos.php').then(res => res.json());
// await store.registros.fetch()
await store.facultades.fetch();
await store.estados.fetch();
await store.bloques_horario.fetch();
await store.filters.switchFechas();
store.periodo = await fetch('action/periodo_datos.php').then(res => res.json());
this.profesores = await (await fetch('action/action_profesor.php')).json();
this.messages.push({ title: 'Datos cargados', text: 'Los datos se han cargado correctamente', type: 'success', timestamp: new Date() });
}