src/templates/ReclutaProceso/limpiaResultado.html.twig line 1

Open in your IDE?
  1. {% extends "@crud\\crud.html.twig" %}
  2. {% block jquery %}
  3.     {{ parent() }}
  4.     <script type="text/javascript">
  5.         $(function()
  6.         {
  7.             $("#buscar").click(function(e){
  8.                 if ($('#cedula').val())
  9.                 {
  10.                     var url='{{ path('search_recluta_con_resultado', {'cedula': '__CEDULA__'}) }}';
  11.                     url=url.replace('__CEDULA__',$('#cedula').val());
  12.                     $('#contenedor_cambio').mask('&nbsp;&nbsp;&nbsp;&nbsp;Buscando...');
  13.                     $.getJSON(url , function(result){
  14.                         $('#contenedor_cambio').unmask();
  15.                         if (result.ok)
  16.                         {
  17.                             $('#resultados').removeClass('hide');
  18.                             if (result.reclutaFoto)                    
  19.                                 $('#foto').html('<img width="200px" src="'+result.reclutaFoto+'">');
  20.                             else
  21.                                 if (result.reclutaSexo=='Masculino')
  22.                                     $('#foto').html('<img src="{{ asset('images/foto_hombre.jpg') }}">');
  23.                                 else
  24.                                     $('#foto').html('<img src="{{ asset('images/foto_mujer.jpg') }}">');
  25.                             $('#recluta_nombre').html(result.reclutaNombre);
  26.                             $('#recluta_identificacion').html(result.reclutaIdentificacion);
  27.                             $('#recluta_sexo').html(result.reclutaSexo);
  28.                             $('#base').val(result.base);
  29.                             $('#centro').html(result.centros);
  30.                             $('#unidad').html(result.unidades);
  31.                             $('#unidad_asignada').val(result.unidad);
  32.                             $('#recluta').val(result.recluta);
  33.                             $('#asignado_a').html(result.asignado);
  34.                         }
  35.                         else
  36.                         {
  37.                             showError(bootbox, result.error);
  38.                         }
  39.                     });
  40.                 }
  41.             });        
  42.             $("#cambiar").click(function(e){
  43.                 if ($('#unidad').val()!=$('#unidad_asignada').val())
  44.                 {
  45.                     var url='{{ path('do_limpiar_resultado', {'reclutaProceso': '__RECLUTA__'}) }}';
  46.                     url=url.replace('__RECLUTA__',$('#recluta').val());
  47.                     $('#contenedor_cambio').mask('&nbsp;&nbsp;&nbsp;&nbsp;Cambiando...');
  48.                     $.getJSON(url , function(result){
  49.                         $('#contenedor_cambio').unmask();
  50.                         if (result.ok)
  51.                         {
  52.                             showError(bootbox, 'Cambio realizado');
  53.                             $('#resultados').addClass('hide');
  54.                             $('#cedula').val('');
  55.                         }
  56.                         else
  57.                         {
  58.                             showError(bootbox, result.error);
  59.                         }
  60.                     });
  61.                 }
  62.                 else
  63.                 {
  64.                     showError(bootbox, 'No ha cambiado la unidad');
  65.                 }
  66.             });        
  67.             $("#base").change(function(e){
  68.                 if ($("#base").val())
  69.                 {
  70.                     $('#resultados').mask('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cargando...');
  71.                     var url = '{{ path('load_centros_por_base', {'base': '__BASE__'}) }}';
  72.                     url = url.replace('__BASE__', $("#base").val());
  73.                     $('#centro').load(url, function(){
  74.                         $('#unidad').html('');  
  75.                         $('#resultados').unmask();
  76.                     });  
  77.                 }
  78.             }); 
  79.             $("#centro").change(function(e){
  80.                 if ($("#centro").val())
  81.                 {
  82.                     $('#resultados').mask('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cargando...');
  83.                     var url = '{{ path('load_unidades_por_centro', {'centro': '__CENTRO__'}) }}';
  84.                     url = url.replace('__CENTRO__', $("#centro").val());
  85.                     $('#unidad').load(url, function(){
  86.                         $('#resultados').unmask();
  87.                     });  
  88.                 }
  89.             }); 
  90.         
  91.         });
  92.         
  93.     </script>    
  94.     
  95. {% endblock %}
  96. {% block content %}
  97.     <div class="widget-box transparent">
  98.         <div class="widget-header widget-header-flat">
  99.             <h4 class="widget-title lighter">
  100.                 <i class="fas fa-pencil-alt orange"></i>
  101.                 Anular y borrar resultado de aspirante registrado
  102.             </h4>
  103.             <!--div class="widget-toolbar">
  104.                 <a href="#" data-action="collapse">
  105.                     <i class="fas fa-chevron-up"></i>
  106.                 </a>
  107.             </div-->
  108.         </div>
  109.         <div id='contenedor_cambio' class="widget-body" style="display: block;">
  110.             <div class="widget-main no-padding">
  111.                 <br>
  112.                     <table>
  113.                         <thead>
  114.                             <tr>
  115.                                 <td style='padding: 8px'>
  116.                                     Indique la cédula del recluta:&nbsp;
  117.                                 </td>
  118.                                 <td style='padding: 8px'>
  119.                                     <input id='cedula' type='text'> <button id='buscar'>Buscar</button>   
  120.                                 </td>
  121.                             </tr>
  122.                         <thead>
  123.                         <tbody id='resultados' class='hide'>
  124.                             <tr>
  125.                                 <td style='padding: 8px' rowspan='4'>
  126.                                     <span id="foto"></span>
  127.                                 </td>
  128.                                 <td style='padding: 8px'>
  129.                                     <b>Nombres:</b><br>
  130.                                     <span id='recluta_nombre'></span>
  131.                                 </td>
  132.                             </tr>
  133.                             <tr>
  134.                                 <td style='padding: 8px'>
  135.                                     <b>Identificación:</b><br>
  136.                                     <span id='recluta_identificacion'></span>
  137.                                 </td>
  138.                             </tr>
  139.                             <tr>
  140.                                 <td style='padding: 8px'>
  141.                                     <b>Sexo:</b><br>
  142.                                     <span id='recluta_sexo'></span>
  143.                                 </td>
  144.                             </tr>
  145.                             <tr>
  146.                                 <td style='padding: 8px'>
  147.                                     <b>Resultado:</b><br>
  148.                                     <span id='asignado_a'></span>
  149.                                     <input id='unidad_asignada' type='hidden'>
  150.                                     <input id='recluta' type='hidden'>
  151.                                 </td>
  152.                             </tr>
  153.                             <tr>
  154.                                 <td style='padding: 8px'>
  155.                                 </td>
  156.                                 <td style='padding: 8px'>
  157.                                     <button id='cambiar'>Anular resultado</button>
  158.                                 </td>
  159.                             </tr>
  160.                         </tbody>
  161.                 </table>
  162.             </div>                   
  163.         </div>                   
  164.     </div>
  165. {% endblock %}