templates/bundles/AccesoBundle/ordenes/consultareventos.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}New Ordenes{% endblock %}
  3. {% block body %}
  4. <legend></legend>
  5. <form name="consultar" method="post" id="planesselect" action="{{ path('ordenes_consultareventos') }}"> 
  6.     <input type="hidden" name="clienteid" id="clienteid" value="{{ clienteid }}" class="form-control">
  7.     <input type="hidden" name="certificado" id="certificado" value="" class="form-control">
  8.     <div class="row">
  9.         <div class="col-sm-2 col-md-2 col-lg-2">
  10.              </div>
  11.         <div class="col-sm-3 col-md-3 col-lg-3">
  12.             <strong>N° de Identificación del Afiliado</strong>
  13.         </div>
  14.         <div class="col-sm-1 col-md-1 col-lg-1" style="margin-bottom:1%">
  15.             <select class="form-control" name="tipoid">
  16.                 <option value="-">-</option>
  17.                 <option value="V" {% if tipoid=='V'%} selected="selected" {% endif%} >V</option>
  18.                 <option value="E" {% if tipoid=='E'%} selected="selected" {% endif%} >E</option>
  19.                 <option value="M" {% if tipoid=='M'%} selected="selected" {% endif%} >M</option>
  20.             </select>
  21.         </div>
  22.         <div class="col-sm-2 col-md-2 col-lg-2" style="margin-bottom:1%" >
  23.             <input type="text" name="numid"  value="{{ numid }}" class="form-control">
  24.         </div>
  25.         <div class="col-sm-1 col-md-1 col-lg-1">
  26.             <button class="btn btn-primary">Consultar</button>
  27.         </div>
  28.     </div>
  29.     <br>
  30. {% if contratos %}
  31.     <div class="row">
  32.         <div class="col-sm-12 col-md-12 col-lg-12">
  33.             <p class="alert-info text-right"><strong> Cantidad de Clientes que retornó la consulta: ({{ contratos|length }})</strong></p>
  34.             <div class="table-responsive">
  35.                 <table class="table table-bordered table-condensed table-hover ">
  36.                     <thead>
  37.                         <tr class="active">
  38.                             <th style="width:15%">Cliente</th>
  39.                             <th style="width:8%">N° contrato</th>
  40.                             <th style="width:15%">Titular</th>
  41.                             <th style="width:10%">N° Certificado</th>
  42.                             <th style="width:15%">Afiliado</th>
  43.                             <th style="width:12%">Plan</th>
  44.                             <th style="width:14%">Vigencia</th>
  45.                             <th style="width:10%">Fecha Ingreso</th>
  46.                             <th style="width:8%"></th>
  47.                         </tr>
  48.                     </thead>
  49.                     <tbody>
  50.         {% for entity in contratos %}
  51.                             {% set class = '' %}
  52.                             {% if entity.indservicioconrecibopendiente== '1'%}  
  53.                             {% set class = 'alert alert-danger' %}
  54.                             {% endif %}
  55.                             <tr class="{{ class }}">
  56.                                 <td>{{ entity.tomador }}</td>
  57.                                 <td>{{ entity.id }}  
  58. {% if entity.vip=='1' %} 
  59.             <i class="glyphicon glyphicon-king"></i> 
  60.             {% endif %} </td>
  61.                                 <td>{{ entity.titular }}</td>
  62.                                 <td>{{ entity.ncertificado }}</td>
  63.                                 <td>{{ entity.nombreasegurado }}</td>
  64.                                 <td>{{ entity.plan }}</td>
  65.                                 <td>{{ entity.fechadesde ? entity.fechadesde|date('d-m-Y') : '' }}/{{ entity.fechahasta ? entity.fechahasta|date('d-m-Y') : '' }}</td>
  66.                                 <td>{{ entity.fechaingreso ? entity.fechaingreso|date('d-m-Y') : '' }}
  67.                                     <br><strong>Días Trans: {{ entity.dias }}</strong>
  68.                                 </td>
  69.                                 <td style="width:10%;">
  70.                                     <input type="radio" data-certificado="{{ entity.ncertificado }}" name="radiocontrato" value="{{ entity.id }}">
  71.                                 </td>
  72.                             </tr>
  73.         {% endfor %}
  74.                         </tbody>
  75.                     </table>
  76.                 </div>
  77.             </div>
  78.         </div>
  79.         <div class="row" id="refresh" style="display: none">
  80.             <div class="col-md-12 text-center" >
  81.                 Consultando ... <i class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></i>
  82.             </div>
  83.         </div>
  84.         <div class="row" id="servicios">
  85.         </div>
  86. {% endif %}
  87.     {% if contratos==null and app.request.method =='POST' %}
  88.     <div class="row">
  89.             <div class="col-md-12 text-center alert alert-warning" >
  90.               <strong>   No se encontraron contratos activos para la cédula ingresada  </strong>    <i class="glyphicon glyphicon-warning-sign"></i>  
  91.             </div>
  92.         </div>
  93. {% endif %}
  94.     </form>
  95.     <script type="text/javascript">
  96.         $(function() {
  97.             $('#refresh')
  98.                     .hide()
  99.                     .ajaxStart(function() {
  100.                 $(this).show();
  101.             })
  102.                     .ajaxStop(function() {
  103.                 $(this).hide();
  104.             })
  105.                     ;
  106.             $('input[type=radio]').click(function() {
  107.                 var rutadeleteactuacion = '{{ path('ordenes_eventosporcontrato')}}';
  108.                 var checkbox = $(this), // Selected or current checkbox
  109.                         value = checkbox.val(); // Value of checkbox
  110.                 var cliente = $("#clienteid").val();
  111.                 console.log(value);
  112.                 console.log(cliente);
  113.                 console.log($(this).data("certificado"));
  114.                 $('#certificado').val($(this).data("certificado"));
  115.                 $('#servicios').html("");
  116.                 $("#refresh").show();
  117.                 $.ajax({
  118.                     type: 'POST',
  119.                     url: rutadeleteactuacion,
  120.                     data: {"clienteid": cliente, "contratoid": value},
  121.                     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  122.                 })
  123.                         .done(function(data)
  124.                 {
  125.                     $("#refresh").hide();
  126.                     $('#servicios').html(data);
  127.                 });
  128.                                          $("body, html").animate({scrollTop: $("#servicios").offset().top }, 1000,function () {
  129.     document.getSelection().removeAllRanges();
  130. });
  131.             });
  132.         });
  133.         </script>
  134. {% endblock %}