src/templates/ReclutaProceso/bajaVoluntaria.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_asignado', {'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.                             $('#recluta').val(result.recluta);
  29.                             $('#asignado_a').html(result.asignado);
  30.                         }
  31.                         else
  32.                         {
  33.                             showError(bootbox, result.error);
  34.                         }
  35.                     });
  36.                 }
  37.             });        
  38.             $("#cambiar").click(function(e){
  39.                 var url='{{ path('do_baja_voluntaria', {'reclutaProceso': '__RECLUTA__'}) }}';
  40.                 url=url.replace('__RECLUTA__',$('#recluta').val());
  41.                 $('#contenedor_cambio').mask('&nbsp;&nbsp;&nbsp;&nbsp;Dando baja...');
  42.                 $.getJSON(url , function(result){
  43.                     $('#contenedor_cambio').unmask();
  44.                     if (result.ok)
  45.                     {
  46.                         showError(bootbox, 'Cambio realizado');
  47.                         $('#resultados').addClass('hide');
  48.                         $('#cedula').val('');
  49.                     }
  50.                     else
  51.                     {
  52.                         showError(bootbox, result.error);
  53.                     }
  54.                 });
  55.             });        
  56.         
  57.         });
  58.         
  59.     </script>    
  60.     
  61. {% endblock %}
  62. {% block content %}
  63.     <div class="widget-box transparent">
  64.         <div class="widget-header widget-header-flat">
  65.             <h4 class="widget-title lighter">
  66.                 <i class="fas fa-pencil-alt orange"></i>
  67.                 Dar baja voluntaria a recluta
  68.             </h4>
  69.             <!--div class="widget-toolbar">
  70.                 <a href="#" data-action="collapse">
  71.                     <i class="fas fa-chevron-up"></i>
  72.                 </a>
  73.             </div-->
  74.         </div>
  75.         <div id='contenedor_cambio' class="widget-body" style="display: block;">
  76.             <div class="widget-main no-padding">
  77.                 <br>
  78.                     <table>
  79.                         <thead>
  80.                             <tr>
  81.                                 <td style='padding: 8px'>
  82.                                     Indique la cédula del recluta:&nbsp;
  83.                                 </td>
  84.                                 <td style='padding: 8px'>
  85.                                     <input id='cedula' type='text'> <button id='buscar'>Buscar</button>   
  86.                                 </td>
  87.                             </tr>
  88.                         <thead>
  89.                         <tbody id='resultados' class='hide'>
  90.                             <tr>
  91.                                 <td style='padding: 8px' rowspan='4'>
  92.                                     <span id="foto"></span>
  93.                                 </td>
  94.                                 <td style='padding: 8px'>
  95.                                     <b>Nombres:</b><br>
  96.                                     <span id='recluta_nombre'></span>
  97.                                 </td>
  98.                             </tr>
  99.                             <tr>
  100.                                 <td style='padding: 8px'>
  101.                                     <b>Identificación:</b><br>
  102.                                     <span id='recluta_identificacion'></span>
  103.                                 </td>
  104.                             </tr>
  105.                             <tr>
  106.                                 <td style='padding: 8px'>
  107.                                     <b>Sexo:</b><br>
  108.                                     <span id='recluta_sexo'></span>
  109.                                 </td>
  110.                             </tr>
  111.                             <tr>
  112.                                 <td style='padding: 8px'>
  113.                                     <b>Asignado a:</b><br>
  114.                                     <span id='asignado_a'></span>
  115.                                     <input id='unidad_asignada' type='hidden'>
  116.                                     <input id='recluta' type='hidden'>
  117.                                 </td>
  118.                             </tr>
  119.                             <tr>
  120.                                 <td style='padding: 8px'>
  121.                                 </td>
  122.                                 <td style='padding: 8px'>
  123.                                     <button id='cambiar'>Dar baja</button>
  124.                                 </td>
  125.                             </tr>
  126.                         </tbody>
  127.                 </table>
  128.             </div>                   
  129.         </div>                   
  130.     </div>
  131. {% endblock %}