eaiovnaovbqoebvqoeavibavo function enviar_rol(){ var formData= new FormData(document.getElementById('form-rol')); //$('#loading-screen').css('display','block'); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Insertar/rol", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ var mensaje =JSON.parse(response); //console.log(mensaje); //$('#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/roles'; }); }); } 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_rol',id) $.ajax({ type: "post", url: "https://juliojodi.com/CEGSystem/Eliminar/rol", 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/roles'; }); }); } else { swal("No se eliminó el dato"); } }); } function cargar(id){ var conteo=0; $("#cargar"+id).parents("tr").find("td").each(function(){ if(conteo==0){ document.form_rolA.id_rol.value=$(this).html(); } if(conteo==1){ document.form_rolA.rol.value=$(this).html(); } conteo++; }); } function actualizar_rol(){ var formData= new FormData(document.getElementById('form_rolA')); $.ajax({ type: "POST", url: "https://juliojodi.com/CEGSystem/Modificar/rol", data: formData, cache: false, contentType: false, processData: false }).done(function(response){ swal({ icon: 'success', title: 'Atención', text: 'Se ha actualizado correctamente', }).then(function () { $('#actualizarMarca').modal("hide"); window.location.href='https://juliojodi.com/CEGSystem/Page/roles'; }); }); }