Redistribución de periodo a periodo_id
This commit is contained in:
@@ -26,14 +26,18 @@ const store = reactive({
|
||||
profesor: null,
|
||||
periodo_id: null,
|
||||
bloque_horario: null,
|
||||
sin_registro: false,
|
||||
estados: [],
|
||||
switchFecha: false,
|
||||
switchFechas() {
|
||||
async switchFechas() {
|
||||
const periodo = await fetch('action/periodo_datos.php');
|
||||
const periodo_data = await periodo.json();
|
||||
// console.log(`Fecha inicio: ${periodo_data.periodo_fecha_inicio} Fecha fin: ${periodo_data.fecha_final}`);
|
||||
$(function () {
|
||||
store.filters.fecha_inicio = store.filters.fecha_fin = store.filters.fecha = null;
|
||||
$("#fecha, #fecha_inicio, #fecha_fin").datepicker({
|
||||
minDate: -15,
|
||||
maxDate: new Date(),
|
||||
minDate: new Date(`${periodo_data.periodo_fecha_inicio}:00:00:00`),
|
||||
maxDate: new Date(`${periodo_data.fecha_final}:00:00:00`),
|
||||
dateFormat: "yy-mm-dd",
|
||||
showAnim: "slide",
|
||||
});
|
||||
@@ -148,6 +152,10 @@ createApp({
|
||||
perPage: 10,
|
||||
*/
|
||||
return this.data.filter((registro) => {
|
||||
if (store.filters.sin_registro && !registro.registro_fecha_supervisor)
|
||||
return true;
|
||||
else if (store.filters.sin_registro)
|
||||
return false;
|
||||
return filters.every((filtro) => {
|
||||
switch (filtro) {
|
||||
case 'fecha':
|
||||
@@ -241,7 +249,7 @@ createApp({
|
||||
await store.facultades.fetch();
|
||||
await store.estados.fetch();
|
||||
await store.bloques_horario.fetch();
|
||||
store.filters.switchFechas();
|
||||
await store.filters.switchFechas();
|
||||
$('div.modal#cargando').modal('hide');
|
||||
}
|
||||
}).mount('#app');
|
||||
|
||||
@@ -668,7 +668,7 @@ function guardarHorario() {
|
||||
formData.append("salón", salon);
|
||||
formData.append("profesor", profesor);
|
||||
formData.append("duración", data.duración.value);
|
||||
formData.append("periodo", "<?= $user->periodo ?>");
|
||||
formData.append("periodo", "<?= $user->periodo_id ?>");
|
||||
formData.append("materia", materia);
|
||||
formData.append("facultad", "<?= $user->facultad['facultad_id'] ?>");
|
||||
|
||||
@@ -871,7 +871,7 @@ document.querySelectorAll("#dlcarrera li").forEach(async li => {
|
||||
// get the data-id from the li element
|
||||
const carrera = li.getAttribute("data-id");
|
||||
const facultad = '<?= $user->facultad['facultad_id'] ?>';
|
||||
const periodo = '<?= $user->periodo ?>';
|
||||
const periodo = '<?= $user->periodo_id ?>';
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("carrera", carrera);
|
||||
|
||||
Reference in New Issue
Block a user