eaiovnaovbqoebvqoeavibavo $(document).ready(function(){ $('#idAlumnoEncargadoA').select2({ dropdownParent: $('#modalPadres') }); $('#idAlumnoEncargadoA2').select2({ dropdownParent: $('#AsignarAlumno') }); var tabla = $('#myTable').DataTable({ "language": { "paginate": { "previous": "Anterior", "next":"Siguiente" }, "lengthMenu": "Mostrar _MENU_ entradas", "zeroRecords": "No hay ningun registro", "info": "Mostrando _PAGE_ de _PAGES_", "infoEmpty": "No hay ningun registro", "search":"Buscar" }, "order": [[0, "asc"]] , dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf' ] }); }); function enviar_encargado(){ var formData= new FormData(document.getElementById('form-encargado')); $('#loading-screen').css('display','block'); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Insertar/encargado", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ //var mensaje =JSON.parse(response); //console.log(response); //$('#loading-screen').css('display','none'); swal({ icon: 'success', title: 'Atención', text: '¡Se ha registrado correctamente!', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } function mostrar_msg(id){ swal({ title: "¿Está seguro eliminar el dato", text: "Esta acción es irreversible", icon: "warning", buttons: { confirm : {text:'Si deseo eliminarlo',className:'sweet-warning'}, cancel : 'Cancelar' }, dangerMode: true }) .then((willDelete) => { if (willDelete) { var formData= new FormData(); formData.append('id_encargado',id) $.ajax({ type: "post", url: "https://juliojodi.com/CEGSystem/Eliminar/encargado2", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ var mensaje = JSON.parse(response); //console.log(mensaje); swal({ icon: 'success', title: 'Atención', text: 'Se ha eliminado el dato', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } else { swal("No se eliminó el dato"); } }); } function cargar(id){ //$('#actualizarPadres').modal({backdrop: 'static', keyboard: false}); var myModal = new bootstrap.Modal(document.getElementById('actualizarPadres'), { backdrop: 'static', keyboard: false }) var conteo=0; $("#cargar"+id).parents("tr").find("td").each(function(){ if(conteo==0){ document.form_encargadoA.id_padreA.value=$(this).html(); } if(conteo==1){ document.form_encargadoA.nombreA.value=$(this).html(); } if(conteo==2){ document.form_encargadoA.direccionA.value=$(this).html(); } if(conteo==3){ document.form_encargadoA.parentescoA.value=$(this).html(); } conteo++; }); var formData2= new FormData(); formData2.append('id_padre',id); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Page/buscarTelefonosPadre", data: formData2, cache: false, contentType: false, processData: false, async : false }).done(function(response3){ var datos3 = JSON.parse(response3); for(var i2=0; i2
'); $("#datos_padreA").append(''); } $("#datos_padreA").append(''); }); var formData3= new FormData(); formData3.append('id_padre',id); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Page/buscarCorreosPadre", data: formData3, cache: false, contentType: false, processData: false, async : false }).done(function(response4){ var datos4 = JSON.parse(response4); for(var i3=0; i3
'); $("#datos_padreA").append(''); } $("#datos_padreA").append(''); }); myModal.show(); } function actualizar_encargado(){ var formData= new FormData(document.getElementById('form-encargadoA')); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Modificar/encargado", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ //console.log(response); swal({ icon: 'success', title: 'Atención', text: 'Se ha actualizado correctamente', }).then(function () { $('#actualizarPadres').modal("hide"); window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } function generar_inputsT(){ $("#div-telefonos").css("display","none"); var input = document.getElementById("cant_inputT").value; for(var i=0; i'); } } function generar_inputsT2(){ $("#div-telefonosA").css("display","none"); var input = document.getElementById("cant_inputTA").value; for(var i=0; i'); } } function limpiarAgregarT(){ $("#div-telefonosA").css("display","flex"); $("#telefonosA").empty(); $("#cant_inputTA").val(""); } function generar_inputsC(){ $("#div-correos").css("display","none"); var input = document.getElementById("cant_inputC").value; for(var i=0; i'); } } function generar_inputsC2(){ $("#div-correosA").css("display","none"); var input = document.getElementById("cant_inputCA").value; for(var i=0; i'); } } function limpiarAgregarC(){ $("#div-correosA").css("display","flex"); $("#correosA").empty(); $("#cant_inputCA").val(""); } function limpiarActualizar(){ $("#datos_padreA").empty(); } function cargarT(id){ var myModal = new bootstrap.Modal(document.getElementById('AgregarTelefonos'), { backdrop: 'static', keyboard: false }); //$('#AgregarTelefonos').modal({backdrop: 'static', keyboard: false}); $('#id_encargadoAT').val(id); myModal.show() } function AgregarA(id){ var myModal = new bootstrap.Modal(document.getElementById('AsignarAlumno'), { backdrop: 'static', keyboard: false }); //$('#AsignarAlumno').modal({backdrop: 'static', keyboard: false}); $('#id_encargadoAA').val(id); myModal.show() } function cargarC(id){ var myModal = new bootstrap.Modal(document.getElementById('AgregarCorreos'), { backdrop: 'static', keyboard: false }); //$('#AgregarCorreos').modal({backdrop: 'static', keyboard: false}); $('#id_encargadoAC').val(id); myModal.show() } function agregarTelefonos(){ var formData= new FormData(document.getElementById('form_AgregarTelefonos')); $('#loading-screen').css('display','block'); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Insertar/telefonos", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ //var mensaje =JSON.parse(response); //console.log(response); //$('#loading-screen').css('display','none'); swal({ icon: 'success', title: 'Atención', text: '¡Se ha registrado correctamente!', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } function agregarCorreos(){ var formData= new FormData(document.getElementById('form_AgregarCorreos')); $('#loading-screen').css('display','block'); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Insertar/correos", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ //var mensaje =JSON.parse(response); //console.log(response); //$('#loading-screen').css('display','none'); swal({ icon: 'success', title: 'Atención', text: '¡Se ha registrado correctamente!', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } function agregarAlumno(){ var formData= new FormData(document.getElementById('form_AgregarAlumno')); $('#loading-screen').css('display','block'); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Insertar/EncargadoAlumno", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ //var mensaje =JSON.parse(response); //console.log(response); //$('#loading-screen').css('display','none'); swal({ icon: 'success', title: 'Atención', text: '¡Se ha registrado correctamente!', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } function eliminarT(id){ swal({ title: "¿Está seguro eliminar el dato", text: "Esta acción es irreversible", icon: "warning", buttons: { confirm : {text:'Si deseo eliminarlo',className:'sweet-warning'}, cancel : 'Cancelar' }, dangerMode: true }) .then((willDelete) => { if (willDelete) { var formData= new FormData(); formData.append('id_telefono',id) $.ajax({ type: "post", url: "https://juliojodi.com/CEGSystem/Eliminar/telefono", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ var mensaje = JSON.parse(response); //console.log(mensaje); swal({ icon: 'success', title: 'Atención', text: 'Se ha eliminado el dato', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } else { swal("No se eliminó el dato"); } }); } function eliminarC(id){ swal({ title: "¿Está seguro eliminar el dato", text: "Esta acción es irreversible", icon: "warning", buttons: { confirm : {text:'Si deseo eliminarlo',className:'sweet-warning'}, cancel : 'Cancelar' }, dangerMode: true }) .then((willDelete) => { if (willDelete) { var formData= new FormData(); formData.append('id_correo',id) $.ajax({ type: "post", url: "https://juliojodi.com/CEGSystem/Eliminar/correo", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ var mensaje = JSON.parse(response); //console.log(mensaje); swal({ icon: 'success', title: 'Atención', text: 'Se ha eliminado el dato', }).then(function () { window.location.href='https://juliojodi.com/CEGSystem/Page/encargados'; }); }); } else { swal("No se eliminó el dato"); } }); }