Commit inicial

This commit is contained in:
2024-08-02 12:02:25 -06:00
commit ff7d678844
267 changed files with 101936 additions and 0 deletions

30
js/horario_profesor.ts Normal file
View File

@@ -0,0 +1,30 @@
import 'es6-promise/auto';
declare function triggerMessage(message: string, title: string, type: string): void;
const form = document.getElementById('form') as HTMLFormElement;
if (form instanceof HTMLFormElement) {
form.addEventListener('submit', async function (e) {
e.preventDefault();
const formData = new FormData(form);
try {
const response = await fetch('action/action_horario_profesor.php', {
method: 'POST',
body: formData,
});
const data = await response.json();
if (data.status == 'ok') {
}
else {
triggerMessage(data.message, 'Error en la consulta', 'warning');
}
} catch (error) {
triggerMessage('Fallo al consutar los datos ', 'Error', 'danger');
}
});
}
else {
triggerMessage('No se ha encontrado el formulario', 'Error', 'danger');
}