diff --git a/app/Resources/views/cea/ascenso_mostar.html.twig b/app/Resources/views/cea/ascenso_mostar.html.twig index 813df65..d6b8a5e 100644 --- a/app/Resources/views/cea/ascenso_mostar.html.twig +++ b/app/Resources/views/cea/ascenso_mostar.html.twig @@ -60,7 +60,15 @@ {%endfor %} -

Escalafón Solicita: {{ ascenso.idEscalafones.nombre }}

+

Escalafón Solicita: {{ ascenso.idEscalafones.nombre }}

+ {% for tutor in ascenso.tutoresAscenso %} +

Tutores propuestos

+

+ {{ tutor.nombres }} {{ tutor.apellidos }}: + {{ tutor.institucion }} -> {{ tutor.idEscala.nombre }} +

+ {% endfor %} + {% endif %} diff --git a/app/Resources/views/solicitudes/ascenso.html.twig b/app/Resources/views/solicitudes/ascenso.html.twig index a0bcfcc..0488901 100644 --- a/app/Resources/views/solicitudes/ascenso.html.twig +++ b/app/Resources/views/solicitudes/ascenso.html.twig @@ -59,19 +59,65 @@ @@ -93,7 +139,46 @@ $('.esc_oposicion')[this.checked ? "show" : "hide"](); - }); + }); + + + $(".tutorForm").submit(function(e){ + alert("funciona"); + e.preventDefault(); + + var formSerialize = $(this).serialize(); + alert(formSerialize); + $.ajax({ + method: "POST", + url: "{{ url('ajax_registrar_tutor') }}", + data: formSerialize + }) + .done(function (data) { + if (typeof data.message !== 'undefined') { + alert(data.message); + } + }) + .fail(function (jqXHR, textStatus, errorThrown) { + if (typeof jqXHR.responseJSON !== 'undefined') { + if (jqXHR.responseJSON.hasOwnProperty('form')) { + console.log(jqXHR.responseJSON.form); + } + + console.log(jqXHR.responseJSON.message); + + } else { + alert(errorThrown); + } + + }); + + + + + + + + }); $( "#tutores_ascenso_buscarTutor" ).click(function() { if($("#tutores_ascenso_cedulaPasaporte").val() == ""){ @@ -107,16 +192,13 @@ cache: false, data: ({cedula: $("#tutores_ascenso_cedulaPasaporte").val(), documento: $("#tutores_ascenso_idDocumentoIdentidad").val()}), success: function (data) { - + console.log(data); var posts = JSON.parse(data.posts); console.log(posts); - if (posts == ""){ + if (!posts){ $('.oculto').removeClass('hidden'); }else{ - $('#ascenso_tutores_asignados').append($('