templates/prog_preventivo/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %} - Programación de Mantenimiento Preventivo{% endblock %}
  3. {% block stylesheets %}
  4.     <link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
  5.     <link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
  6.     <link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css')}}">
  7.     <link rel="stylesheet" href="{{ asset('plugins/toastr/toastr.min.css') }}">
  8. {% endblock %}
  9. {% block body %}
  10.     <div class="content-wrapper">
  11.         <!-- Content Header (Page header) -->
  12.         <section class="content-header">
  13.             <div class="card">
  14.                 <div class="card-header">
  15.                     <h1 class="card-title">Programación de Mantenimiento Preventivo</h1>
  16.                     <div class="card-tools">
  17.                         <ol class="breadcrumb float-sm-right">
  18.                             <li class="breadcrumb-item"><a href="#">Inicio</a></li>
  19.                             <li class="breadcrumb-item active"><b>Mantenimiento Preventivo</b></li>
  20.                         </ol>
  21.                     </div>
  22.                 </div>
  23.             </div>
  24.         </section>
  25.         <!-- Main content -->
  26.         <section class="content">
  27.             <div class="row justify-content-center">
  28.                 <div class="col-12">
  29.                     <!-- Default box -->
  30.                     <div class="card card-outline card-teal p-3">
  31.                         <div class="card">
  32.                             <div class="card-body" style="background: #bacbff85;">
  33.                                 {{ form_start(form, {'attr': {'class': 'form-inline col-md-auto', 'id': 'form_ubicacion_filtro'}}) }}
  34.                                 {{ form_widget(form) }}
  35.                                 {{ form_end(form) }}
  36.                             </div>
  37.                         </div>
  38.                         <form id="form_prog_preventivo">
  39.                             <div class="card" id="form-info" style="background: #baffbe85;">
  40.                                 <div class="card-body">
  41.                                     <div class="pb-3">
  42.                                         <label>Acción a realizar</label><input type="text" class="form-control" id="arealizar" name="accion" required>
  43.                                         <div class="row">
  44.                                             <div class="col-lg"><label>Fecha de atención</label><input type="date" class="form-control" id="fregistro" name="fecha" required></div>
  45.                                             <div class="col-lg"><div class="col-md-12">
  46.                                                     <br/>
  47.                                                     <a id="form-btn-preventivo" class="btn btn-success" type="submit" onclick="solicitudProgramarLote('{{ path('prog_preventivo_solicitud_lote') }}')">
  48.                                                         <i class="fa fa-calendar" data-toggle="tooltip" title="Programar mantenimiento"></i> Programar mantenimiento
  49.                                                     </a>
  50.                                                 </div>
  51.                                             </div>
  52.                                         </div>
  53.                                     </div>
  54.                                 </div>
  55.                             </div>
  56.                             <ul class="nav nav-tabs" role="tablist">
  57.                                 <li class="nav-item">
  58.                                     <a class="nav-link active" id="tipo-tab1" data-toggle="tab" href="#tab_equipo_computo" role="tab" aria-controls="tab_equipo_computo" aria-selected="true">Equipo de cómputo</a>
  59.                                 </li>
  60.                                 <li class="nav-item">
  61.                                     <a class="nav-link" id="tipo-tab2" data-toggle="tab" href="#tab_impresora" role="tab" aria-controls="tab_impresora" aria-selected="false">Impresora</a>
  62.                                 </li>
  63.                                 <li class="nav-item">
  64.                                     <a class="nav-link" id="tipo-tab3" data-toggle="tab" href="#tab_red" role="tab" aria-controls="tab_red" aria-selected="false">Red</a>
  65.                                 </li>
  66.                                 <li class="nav-item">
  67.                                     <a class="nav-link" id="tipo-tab4" data-toggle="tab" href="#tab_otro" role="tab" aria-controls="tab_otro" aria-selected="false">Otro</a>
  68.                                 </li>
  69.                             </ul>
  70.                             <div class="tab-content tab-bordered" id="myTabcontent2">
  71.                                 <div class="tab-pane active" id="tab_equipo_computo" role="tabpanel" aria-labelledby="tab1">
  72.                                     <div class="card-body">
  73.                                         <table id="tipoA" class="table table-hover w-100">
  74.                                             <thead>
  75.                                             <tr>
  76.                                                 <th><label><input type="checkbox" class="select-all-tipoa" /> Seleccionar todo</label></th>
  77.                                                 <th>Marbete</th>
  78.                                                 <th>Descripción</th>
  79.                                                 <th>Marca</th>
  80.                                                 <th>Ubicación</th>
  81.                                                 <th>Usuario</th>
  82.                                                 <th>#MPE</th>
  83.                                                 <th>Acciones</th>
  84.                                             </tr>
  85.                                             </thead>
  86.                                             <tbody>
  87.                                             {% for i in equipo %}
  88.                                                 <tr id="idTipoA-{{ i.idEqu }}">
  89.                                                     <td>
  90.                                                         <label>
  91.                                                             <input type="checkbox" class="check-tipoa" name="equipo[]" value="{{ i.idEqu }}"/>
  92.                                                         </label>
  93.                                                     </td>
  94.                                                     <th class="marbete">{{ i.marbete }}</th>
  95.                                                     <td class="descripcion">{{ i.descripcion }}</td>
  96.                                                     <td class="marca">{{ i.idMarca.marca }}</td>
  97.                                                     <td class="ubicacion">{{ i.ubicacion }}</td>
  98.                                                     <td class="usuario">{% if i.usuario.nombre is defined %}{{ i.usuario.nombre }} {{ i.usuario.papellido }} {{ i.usuario.sapellido }}{% endif %}</td>
  99.                                                     <td class="mpe"><h3><span class="badge bg-secondary float-center">0</span></h3></td>
  100.                                                     <td>
  101.                                                         {#<a href="#modal-solicitud-programar" class="text-success" data-toggle="modal" onclick="solicitudProgramar('{{ path('prog_preventivo_solicitud_tipoa', {'id': i.idEqu}) }}')">
  102.                                                             <i class="fa fa-calendar" data-toggle="tooltip" title="Programar mantenimiento"></i>
  103.                                                         </a>#}
  104.                                                         <a href="#modal-solicitud-programada" class="text-info btn" data-toggle="modal" onclick="solicitudProgramada('{{ path('prog_preventivo_programada_tipoa', {'id': i.idEqu}) }}')">
  105.                                                             <i class="fa fa-eye" data-toggle="tooltip" title="Ver mantenimientos programados"></i>
  106.                                                         </a>
  107.                                                     </td>
  108.                                                 </tr>
  109.                                             {% endfor %}
  110.                                             </tbody>
  111.                                         </table>
  112.                                     </div>
  113.                                 </div>
  114.                                 <div class="tab-pane" id="tab_impresora" role="tabpanel" aria-labelledby="tab2">
  115.                                     <div class="card-body">
  116.                                         <table id="tipoB" class="table table-hover w-100">
  117.                                             <thead>
  118.                                                 <tr>
  119.                                                     <th><label><input type="checkbox" class="select-all-tipob" /> Seleccionar todo</label></th>
  120.                                                     <th>Marbete</th>
  121.                                                     <th>Descripción</th>
  122.                                                     <th>Marca</th>
  123.                                                     <th>Ubicación</th>
  124.                                                     <th>Usuario</th>
  125.                                                     <th>#MPE</th>
  126.                                                     <th>Acciones</th>
  127.                                                 </tr>
  128.                                             </thead>
  129.                                             <tbody>
  130.                                             {% for i in impresora %}
  131.                                                 <tr id="idTipoB-{{ i.idImp }}">
  132.                                                     <td>
  133.                                                         <label>
  134.                                                             <input type="checkbox" class="check-tipob" name="impresora[]" value="{{ i.idImp }}"/>
  135.                                                         </label>
  136.                                                     </td>
  137.                                                     <th class="marbete">{{ i.marbete }}</th>
  138.                                                     <td class="descripcion">{{ i.descripcion }}</td>
  139.                                                     <td class="marca">{{ i.marca }}</td>
  140.                                                     <td class="ubicacion">{{ i.ubicacion }}</td>
  141.                                                     <td class="usuario">{% if i.usuario.nombre is defined %}{{ i.usuario.nombre }} {{ i.usuario.papellido }} {{ i.usuario.sapellido }}{% endif %}</td>
  142.                                                     <td class="mpe"><h3><span class="badge bg-secondary float-center">0</span></h3></td>
  143.                                                     <td>
  144.                                                         {#<a href="#modal-solicitud-programar" class="text-success" data-toggle="modal" onclick="solicitudProgramar('{{ path('prog_preventivo_solicitud_tipob', {'id': i.idImp}) }}')">
  145.                                                             <i class="fa fa-calendar" data-toggle="tooltip" title="Programar mantenimiento"></i>
  146.                                                         </a>#}
  147.                                                         <a href="#modal-solicitud-programada" class="text-info btn" data-toggle="modal" onclick="solicitudProgramada('{{ path('prog_preventivo_programada_tipob', {'id': i.idImp}) }}')">
  148.                                                             <i class="fa fa-eye" data-toggle="tooltip" title="Ver mantenimientos programados"></i>
  149.                                                         </a>
  150.                                                     </td>
  151.                                                 </tr>
  152.                                             {% endfor %}
  153.                                             </tbody>
  154.                                         </table>
  155.                                     </div>
  156.                                 </div>
  157.                                 <div class="tab-pane" id="tab_red" role="tabpanel" aria-labelledby="tab3">
  158.                                     <div class="card-body">
  159.                                         <table id="tipoC" class="table table-hover w-100">
  160.                                             <thead>
  161.                                             <tr>
  162.                                                 <th><label><input type="checkbox" class="select-all-tipoc" /> Seleccionar todo</label></th>
  163.                                                 <th>Marbete</th>
  164.                                                 <th>Descripción</th>
  165.                                                 <th>Marca</th>
  166.                                                 <th>Ubicación</th>
  167.                                                 <th>Usuario</th>
  168.                                                 <th>#MPE</th>
  169.                                                 <th>Acciones</th>
  170.                                             </tr>
  171.                                             </thead>
  172.                                             <tbody>
  173.                                             {% for i in red %}
  174.                                                 <tr id="idTipoC-{{ i.idRed }}">
  175.                                                     <td>
  176.                                                         <label>
  177.                                                             <input type="checkbox" class="check-tipoc" name="red[]" value="{{ i.idRed }}"/>
  178.                                                         </label>
  179.                                                     </td>
  180.                                                     <th class="marbete">{{ i.marbete }}</th>
  181.                                                     <td class="descripcion">{{ i.descripcion }}</td>
  182.                                                     <td class="marca">{{ i.marca }}</td>
  183.                                                     <td class="ubicacion">{{ i.ubicacion }}</td>
  184.                                                     <td class="usuario">{% if i.usuario.nombre is defined %}{{ i.usuario.nombre }}{% endif %} {% if i.usuario.papellido is defined %}{{ i.usuario.papellido }}{% endif %} {% if i.usuario.sapellido is defined %}{{ i.usuario.sapellido }}{% endif %}</td>
  185.                                                     <td class="mpe"><h3><span class="badge bg-secondary float-center">0</span></h3></td>
  186.                                                     <td>
  187.                                                         {#<a href="#modal-solicitud-programar" class="text-success" data-toggle="modal" onclick="solicitudProgramar('{{ path('prog_preventivo_solicitud_tipoc', {'id': i.idRed}) }}')">
  188.                                                             <i class="fa fa-calendar" data-toggle="tooltip" title="Programar mantenimiento"></i>
  189.                                                         </a>#}
  190.                                                         <a href="#modal-solicitud-programada" class="text-info btn" data-toggle="modal" onclick="solicitudProgramada('{{ path('prog_preventivo_programada_tipoc', {'id': i.idRed}) }}')">
  191.                                                             <i class="fa fa-eye" data-toggle="tooltip" title="Ver mantenimientos programados"></i>
  192.                                                         </a>
  193.                                                     </td>
  194.                                                 </tr>
  195.                                             {% else %}
  196.                                                 <tr>
  197.                                                     <td colspan="8" class="text-center">No se encontraron registros acerca de <b>equipos de redes</b></td>
  198.                                                 </tr>
  199.                                             {% endfor %}
  200.                                             </tbody>
  201.                                         </table>
  202.                                     </div>
  203.                                 </div>
  204.                                 <div class="tab-pane" id="tab_otro" role="tabpanel" aria-labelledby="tab4">
  205.                                     <div class="card-body">
  206.                                         <table id="tipoD" class="table table-hover w-100">
  207.                                             <thead>
  208.                                             <tr>
  209.                                                 <th><label><input type="checkbox" class="select-all-tipod" /> Seleccionar todo</label></th>
  210.                                                 <th>Marbete</th>
  211.                                                 <th>Descripción</th>
  212.                                                 <th>Marca</th>
  213.                                                 <th>Ubicación</th>
  214.                                                 <th>Usuario</th>
  215.                                                 <th>#MPE</th>
  216.                                                 <th>Acciones</th>
  217.                                             </tr>
  218.                                             </thead>
  219.                                             <tbody>
  220.                                             {% for i in otro %}
  221.                                                 <tr id="idTipoD-{{ i.idOtro }}">
  222.                                                     <td>
  223.                                                         <label>
  224.                                                             <input type="checkbox" class="check-tipod" name="otro[]" value="{{ i.idOtro }}"/>
  225.                                                         </label>
  226.                                                     </td>
  227.                                                     <th class="marbete">{{ i.marbete }}</th>
  228.                                                     <td class="descripcion">{{ i.descripcion }}</td>
  229.                                                     <td class="marca">{{ i.marca }}</td>
  230.                                                     <td class="ubicacion">{{ i.ubicacion }}</td>
  231.                                                     <td class="usuario">{% if i.usuario.nombre is defined %}{{ i.usuario.nombre }}{% endif %} {% if i.usuario.papellido is defined %}{{ i.usuario.papellido }}{% endif %} {% if i.usuario.sapellido is defined %}{{ i.usuario.sapellido }}{% endif %}</td>
  232.                                                     <td class="mpe"><h3><span class="badge bg-secondary float-center">0</span></h3></td>
  233.                                                     <td>
  234.                                                         {#<a href="#modal-solicitud-programar" class="text-success" data-toggle="modal" onclick="solicitudProgramar('{{ path('prog_preventivo_solicitud_tipod', {'id': i.idOtro}) }}')">
  235.                                                             <i class="fa fa-calendar" data-toggle="tooltip" title="Programar mantenimiento"></i>
  236.                                                         </a>#}
  237.                                                         <a href="#modal-solicitud-programada" class="text-info btn" data-toggle="modal" onclick="solicitudProgramada('{{ path('prog_preventivo_programada_tipod', {'id': i.idOtro}) }}')">
  238.                                                             <i class="fa fa-eye" data-toggle="tooltip" title="Ver mantenimientos programados"></i>
  239.                                                         </a>
  240.                                                     </td>
  241.                                                 </tr>
  242.                                             {% endfor %}
  243.                                             </tbody>
  244.                                         </table>
  245.                                     </div>
  246.                                 </div>
  247.                             </div>
  248.                         </form>
  249.                         <!-- /.card-body -->
  250.                     </div>
  251.                 </div>
  252.             </div>
  253.         </section>
  254.         <!-- /.content -->
  255.     </div>
  256.     <!-- Modal de solicitud para programar mantenimiento preventivo -->
  257.     <div class="modal hide" id="modal-solicitud-programar"></div>
  258.     <!-- /.modal de solicitud para programar mantenimiento preventivo -->
  259.     <!-- Modal de solicitudes programadas para mantenimiento preventivo -->
  260.     <div class="modal hide" id="modal-solicitud-programada"></div>
  261.     <!-- /.modal de solicitudes programadas para mantenimiento preventivo -->
  262.     <!-- Modal de reprogramacion de solicitud para mantenimiento preventivo -->
  263.     <div class="modal hide" id="modal-solicitud-reprogramar"></div>
  264.     <!-- /.modal de reprogramacion de solicitud para mantenimiento preventivo -->
  265.     
  266. {% endblock %}
  267. {% block javascripts %}
  268.     <script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
  269.     <script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
  270.     <script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
  271.     <script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
  272.     <script src="{{ asset('plugins/datatables-buttons/js/dataTables.buttons.min.js') }}"></script>
  273.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.bootstrap4.min.js') }}"></script>
  274.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.html5.min.js') }}"></script>
  275.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.print.min.js') }}"></script>
  276.     <script src="{{ asset('plugins/datatables-buttons/js/buttons.colVis.min.js') }}"></script>
  277.     <script src="{{ asset('plugins/toastr/toastr.min.js') }}"></script>
  278.     <script type="text/javascript">
  279.         $("#mtto-preventivo").addClass("menu-open");
  280.         $("#mtto-preventivo").find('.nav-link:first').addClass("active");
  281.         $("#programa-mtto").addClass("active");
  282.         $(document).ready(function(){
  283.             $('[data-toggle="tooltip"]').tooltip();
  284.             $('a[data-toggle="tab"]').on('shown.bs.tab', function(e){
  285.                 $($.fn.dataTable.tables(true)).DataTable()
  286.                     .columns.adjust();
  287.             });
  288.             $('#tipoA').DataTable({
  289.                 "aaSorting": [],
  290.                 orderCellsTop: true,
  291.                 {# Define un valor predeterminado para LengthChange #}
  292.                 "pageLength": 50,
  293.                 "scrollX": true,
  294.                 {# sDom: 'lrtip', #}
  295.                 "bLengthChange" : true,
  296.                 language: {
  297.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  298.                 },
  299.             });
  300.             $('#tipoB').DataTable({
  301.                 "aaSorting": [],
  302.                 orderCellsTop: true,
  303.                 {# Define un valor predeterminado para LengthChange #}
  304.                 "pageLength": 50,
  305.                 "scrollX": true,
  306.                 {# sDom: 'lrtip', #}
  307.                 "bLengthChange" : true,
  308.                 language: {
  309.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  310.                 },
  311.             });
  312.             $('#tipoC').DataTable({
  313.                 "aaSorting": [],
  314.                 orderCellsTop: true,
  315.                 {# Define un valor predeterminado para LengthChange #}
  316.                 "pageLength": 50,
  317.                 "scrollX": true,
  318.                 {# sDom: 'lrtip', #}
  319.                 "bLengthChange" : true,
  320.                 language: {
  321.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  322.                 },
  323.             });
  324.             $('#tipoD').DataTable({
  325.                 "aaSorting": [],
  326.                 orderCellsTop: true,
  327.                 {# Define un valor predeterminado para LengthChange #}
  328.                 "pageLength": 50,
  329.                 "scrollX": true,
  330.                 {# sDom: 'lrtip', #}
  331.                 "bLengthChange" : true,
  332.                 language: {
  333.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  334.                 },
  335.             });
  336.             $(".select-all-tipoa").click(function ()
  337.             {
  338.                 if($(".select-all-tipoa").prop('checked')){
  339.                     let checked = true;
  340.                     $('.check-tipoa').attr('checked', this.checked);
  341.                     const checkboxes = document.querySelectorAll('input[name="equipo[]"]');
  342.                     checkboxes.forEach((checkbox) => {
  343.                         checkbox.checked = checked;
  344.                     });
  345.                 } else {
  346.                     let checked = false;
  347.                     $('.check-tipoa').attr('checked', this.checked);
  348.                     const checkboxes = document.querySelectorAll('input[name="equipo[]"]');
  349.                     checkboxes.forEach((checkbox) => {
  350.                         checkbox.checked = checked;
  351.                     });
  352.                 }
  353.                 ocultarFormulario();
  354.             });
  355.             $("#form_ubicacion").on('change', function () {
  356.                 aplicarFiltro();
  357.             });
  358.             vistaContador();
  359.             ocultarFormulario();
  360.             funcionSeleccion();
  361.         });
  362.         function funcionSeleccion()
  363.         {
  364.             $(".check-tipoa").click(function()
  365.             {
  366.                 ocultarFormulario();
  367.                 if($(".check-tipoa").length == $(".check-tipoa:checked").length)
  368.                 {
  369.                     $(".select-all-tipoa").attr("checked", "checked");
  370.                 } else {
  371.                     $(".select-all-tipoa").removeAttr("checked");
  372.                 }
  373.             });
  374.             $(".select-all-tipob").click(function ()
  375.             {
  376.                 if($(".select-all-tipob").prop('checked')){
  377.                     let checked = true;
  378.                     $('.check-tipob').attr('checked', this.checked);
  379.                     const checkboxes = document.querySelectorAll('input[name="impresora[]"]');
  380.                     checkboxes.forEach((checkbox) => {
  381.                         checkbox.checked = checked;
  382.                     });
  383.                 } else {
  384.                     let checked = false;
  385.                     $('.check-tipob').attr('checked', this.checked);
  386.                     const checkboxes = document.querySelectorAll('input[name="impresora[]"]');
  387.                     checkboxes.forEach((checkbox) => {
  388.                         checkbox.checked = checked;
  389.                     });
  390.                 }
  391.                 ocultarFormulario();
  392.             });
  393.             $(".check-tipob").click(function()
  394.             {
  395.                 if($(".check-tipob").length == $(".check-tipob:checked").length) {
  396.                     $(".select-all-tipob").attr("checked", "checked");
  397.                 } else {
  398.                     $(".select-all-tipob").removeAttr("checked");
  399.                 }
  400.                 ocultarFormulario();
  401.             });
  402.             $(".select-all-tipoc").click(function ()
  403.             {
  404.                 if($(".select-all-tipoc").prop('checked')){
  405.                     let checked = true;
  406.                     $('.check-tipoc').attr('checked', this.checked);
  407.                     const checkboxes = document.querySelectorAll('input[name="red[]"]');
  408.                     checkboxes.forEach((checkbox) => {
  409.                         checkbox.checked = checked;
  410.                     });
  411.                 } else {
  412.                     let checked = false;
  413.                     $('.check-tipoc').attr('checked', this.checked);
  414.                     const checkboxes = document.querySelectorAll('input[name="red[]"]');
  415.                     checkboxes.forEach((checkbox) => {
  416.                         checkbox.checked = checked;
  417.                     });
  418.                 }
  419.                 ocultarFormulario();
  420.             });
  421.             $(".check-tipoc").click(function()
  422.             {
  423.                 ocultarFormulario();
  424.                 if($(".check-tipoc").length == $(".check-tipoc:checked").length) {
  425.                     $(".select-all-tipoc").attr("checked", "checked");
  426.                 } else {
  427.                     $(".select-all-tipoc").removeAttr("checked");
  428.                 }
  429.             });
  430.             $(".select-all-tipod").click(function ()
  431.             {
  432.                 if($(".select-all-tipod").prop('checked')){
  433.                     let checked = true;
  434.                     $('.check-tipod').attr('checked', this.checked);
  435.                     const checkboxes = document.querySelectorAll('input[name="otro[]"]');
  436.                     checkboxes.forEach((checkbox) => {
  437.                         checkbox.checked = checked;
  438.                     });
  439.                 } else {
  440.                     let checked = false;
  441.                     $('.check-tipod').attr('checked', this.checked);
  442.                     const checkboxes = document.querySelectorAll('input[name="otro[]"]');
  443.                     checkboxes.forEach((checkbox) => {
  444.                         checkbox.checked = checked;
  445.                     });
  446.                 }
  447.                 ocultarFormulario();
  448.             });
  449.             $(".check-tipod").click(function()
  450.             {
  451.                 ocultarFormulario();
  452.                 if($(".check-tipod").length == $(".check-tipod:checked").length) {
  453.                     $(".select-all-tipod").attr("checked", "checked");
  454.                 } else {
  455.                     $(".select-all-tipod").removeAttr("checked");
  456.                 }
  457.             });
  458.         }
  459.         $(document).on('click', '.page-link', function(e) {
  460.             e.preventDefault(); // Evita la acción por defecto (si es un enlace)
  461.             // Aquí puedes obtener información del elemento clickeado
  462.             // const pagina = $(this).text(); // Ejemplo: el número de página
  463.             // console.log('Se hizo clic en la página:', pagina);
  464.             // O puedes agregar tu lógica personalizada
  465.             vistaContador();
  466.         });
  467.         
  468.         function limpiarSeleccion() {
  469.             let checked = false;
  470.             const checkbox_a = document.querySelectorAll('input[name="equipo[]"]');
  471.             checkbox_a.forEach((checkbox) => {
  472.                 checkbox.checked = checked;
  473.             });
  474.             const checkbox_b = document.querySelectorAll('input[name="impresora[]"]');
  475.             checkbox_b.forEach((checkbox) => {
  476.                 checkbox.checked = checked;
  477.             });
  478.             const checkbox_c = document.querySelectorAll('input[name="red[]"]');
  479.             checkbox_c.forEach((checkbox) => {
  480.                 checkbox.checked = checked;
  481.             });
  482.             const checkbox_d = document.querySelectorAll('input[name="otro[]"]');
  483.             checkbox_d.forEach((checkbox) => {
  484.                 checkbox.checked = checked;
  485.             });
  486.             ocultarFormulario();
  487.             $('#arealizar').val('');
  488.             $('#fregistro').val('');
  489.         }
  490.         function vistaContador()
  491.         {
  492.             $.ajax({
  493.                 type: "POST",
  494.                 url: '{{ path('prog_preventivo_vista') }}',
  495.                 dataType: "json",
  496.                 cache: false,
  497.                 contentType: false,
  498.                 processData: false,
  499.                 success: function (data) {
  500.                     let datos = data;
  501.                     for(let i = 0; i < datos['data'].length; i++){
  502.                         if(datos['data'][i]['tipoEquipo'] == 'Equipo'){
  503.                             row = $('#idTipoA-' + datos['data'][i]['idEquipo']);
  504.                             row.find('.mpe').html('<h3><span class="badge bg-primary float-center">' + datos['data'][i]['equipoCont'] + '</span></h3>');
  505.                         }
  506.                         if(datos['data'][i]['tipoEquipo'] == 'Impresora'){
  507.                             row = $('#idTipoB-' + datos['data'][i]['idEquipo']);
  508.                             row.find('.mpe').html('<h3><span class="badge bg-primary float-center">' + datos['data'][i]['equipoCont'] + '</span></h3>');
  509.                         }
  510.                         if(datos['data'][i]['tipoEquipo'] == 'Red'){
  511.                             row = $('#idTipoC-' + datos['data'][i]['idEquipo']);
  512.                             row.find('.mpe').html('<h3><span class="badge bg-primary float-center">' + datos['data'][i]['equipoCont'] + '</span></h3>');
  513.                         }
  514.                         if(datos['data'][i]['tipoEquipo'] == 'Otro'){
  515.                             row = $('#idTipoD-' + datos['data'][i]['idEquipo']);
  516.                             row.find('.mpe').html('<h3><span class="badge bg-primary float-center">' + datos['data'][i]['equipoCont'] + '</span></h3>');
  517.                         }
  518.                     }
  519.                 },
  520.                 error: function (data, text, error) {
  521.                     alertMessage(1, data.responseJSON.mensaje);
  522.                 },
  523.                 complete: function () {
  524.                 }
  525.             });
  526.         }
  527.         function ocultarFormulario()
  528.         {
  529.             console.log();
  530.             if ($(".check-tipoa:checked").length + $(".check-tipob:checked").length + $(".check-tipoc:checked").length + $(".check-tipod:checked").length < 1) {
  531.                 console.log();
  532.                 document.getElementById("form-info").style.display = "none";
  533.             } else {
  534.                 document.getElementById("form-info").style.display = "block";
  535.             }
  536.         }
  537.         function solicitudProgramarLote(url)
  538.         {
  539.             let formData = new FormData(document.getElementById("form_prog_preventivo"));
  540.             let send = $('#form-btn-preventivo');
  541.             $.ajax({
  542.                 type: "POST",
  543.                 url: url,
  544.                 data: formData,
  545.                 dataType: "json",
  546.                 cache: false,
  547.                 contentType: false,
  548.                 processData: false,
  549.                 beforeSend: function () {
  550.                     send.text("Programando "); // Para input de tipo button
  551.                     send.append("<i class='fa fa-spinner fa-spin' style='font-size:16px'></i>");
  552.                     send.prop("disabled", true);
  553.                 },
  554.                 success: function (data) {
  555.                     let row = "";
  556.                     console.log(data['info']);
  557.                     var info = Object.values(data['info']);
  558.                     console.log(info.length);
  559.                     for(let i = 0; i < info.length - 1; i++){
  560.                         if(info[i].tipoequipo == 'Equipo' || info[i].tipoequipo == 'Impresora' || info[i].tipoequipo == 'Red' || info[i].tipoequipo == 'Otro'){
  561.                             row +=
  562.                             "<tr>" +
  563.                                 "<td>" + info[i].tipoequipo + "</td>" +
  564.                                 "<td>" + info[i].fregistro + "</td>" +
  565.                                 "<td>" + info[i].tipomantenimiento + "</td>" +
  566.                                 "<td>" + info[i].accion + "</td>" +
  567.                                 "<td>" + info[i].unidad + "</td>" +
  568.                                 "<td>" +
  569.                                     "<a href='#modal-solicitud-reprogramar' class='text-success' data-toggle='modal' onclick=\"solicitudReprogramar('" + info[i].reprogramar + "')\">" +
  570.                                         "<i class='fa fa-calendar' data-toggle='tooltip' title='Reprogramar mantenimiento'></i>" +
  571.                                     "</a>" +
  572.                                 "</td>" +
  573.                             "</tr>"
  574.                             ;
  575.                         }
  576.                     }
  577.                     console.log(row);
  578.                     $("#tipoE").append(row).html();
  579.                     $(document).Toasts('create', {
  580.                         autohide: false,
  581.                         delay: 3000,
  582.                         class: 'bg-success',
  583.                         title: 'Programación por grupo',
  584.                         subtitle: 'Éxito',
  585.                         body: data.mensaje
  586.                     });
  587.                     vistaContador();
  588.                     ocultarFormulario();
  589.                     limpiarSeleccion();
  590.                     funcionSeleccion();
  591.                 },
  592.                 error: function (data, text, error) {
  593.                     $(document).Toasts('create', {
  594.                         autohide: true,
  595.                         delay: 3000,
  596.                         class: 'bg-warning',
  597.                         title: 'Programación por grupo',
  598.                         subtitle: 'Ocurrió un error',
  599.                         body: data.responseJSON.mensaje
  600.                     });
  601.                 },
  602.                 complete: function () {
  603.                     setTimeout(function(){
  604.                         send.text("Programar mantenimiento"); // Para input de tipo button
  605.                         send.append("<i></i>");
  606.                         send.prop("disabled", false);
  607.                     }, 5000);
  608.                 }
  609.             });
  610.         }
  611.         function solicitudProgramar(url)
  612.         {
  613.             $('#modal-solicitud-programar').load(url, function ()
  614.             {
  615.                 // configuración del Modal
  616.                 $("#modal-solicitud-programar").on('hide.bs.modal', function () {
  617.                     $(this).html('Cargando');
  618.                 });
  619.                 $(".modal-dialog").draggable;
  620.                 solicitudProgramarAjax(url)
  621.             })
  622.         }
  623.         function solicitudProgramarAjax(url)
  624.         {
  625.             let send = $("#editar_usuario_guardar");
  626.             $('#editar_usuario_guardar').on('click', function () {
  627.                 let formData = new FormData(document.getElementById("form-programar-solicitud"));
  628.                 $.ajax({
  629.                     type: "POST",
  630.                     url: url,
  631.                     data: formData, // Adjuntar los campos del formulario enviado.
  632.                     dataType: "json",
  633.                     cache: false,
  634.                     contentType: false,
  635.                     processData: false,
  636.                     beforeSend: function () {
  637.                         send.text("Actualizando "); // Para input de tipo button
  638.                         send.append("<i class='fa fa-spinner fa-spin' style='font-size:16px'></i>");
  639.                         send.prop("disabled", true);
  640.                     },
  641.                     success: function (data) {
  642.                         closeModal('modal-solicitud-programar');
  643.                         $(document).Toasts('create', {
  644.                             autohide: true,
  645.                             delay: 3000,
  646.                             class: 'bg-success',
  647.                             title: 'Programación individual',
  648.                             subtitle: 'Éxito',
  649.                             body: data.mensaje
  650.                         });
  651.                         vistaContador();
  652.                         ocultarFormulario();
  653.                         limpiarSeleccion();
  654.                         funcionSeleccion();
  655.                     },
  656.                     error: function (data, text, error) {
  657.                         $(document).Toasts('create', {
  658.                             autohide: true,
  659.                             delay: 5000,
  660.                             class: 'bg-danger',
  661.                             title: 'Programar solicitud',
  662.                             subtitle: 'Ocurrió un error',
  663.                             body: data.responseJSON.mensaje
  664.                         });
  665.                     },
  666.                     complete: function () {
  667.                         setTimeout(function(){
  668.                             send.text("Programar mantenimiento"); // Para input de tipo button
  669.                             send.append("<i></i>");
  670.                             send.prop("disabled", false);
  671.                         }, 5000);
  672.                     }
  673.                 });
  674.                 return false; // Evitar ejecutar el submit del formulario.
  675.             });
  676.         }
  677.         function solicitudProgramada(url)
  678.         {
  679.             $('#modal-solicitud-programada').load(url, function ()
  680.             {
  681.                 // configuración del Modal
  682.                 $("#modal-solicitud-programada").on('hide.bs.modal', function () {
  683.                     $(this).html('Cargando');
  684.                 });
  685.                 $(".modal-dialog").draggable;
  686.                 solicitudProgramadaAjax(url)
  687.             })
  688.         }
  689.         function solicitudProgramadaAjax(url)
  690.         {
  691.             let send = $("#editar_usuario_guardar");
  692.             $('#editar_usuario_guardar').on('click', function () {
  693.                 $.ajax({
  694.                     type: "POST",
  695.                     url: url,
  696.                     dataType: "json",
  697.                     cache: false,
  698.                     contentType: false,
  699.                     processData: false,
  700.                     beforeSend: function () {
  701.                         send.text("Actualizando "); // Para input de tipo button
  702.                         send.append("<i class='fa fa-spinner fa-spin' style='font-size:16px'></i>");
  703.                         send.prop("disabled", true);
  704.                     },
  705.                     success: function (data) {
  706.                         $(document).Toasts('create', {
  707.                             autohide: true,
  708.                             delay: 3000,
  709.                             class: 'bg-success',
  710.                             title: 'Edición de programación',
  711.                             subtitle: 'Éxito',
  712.                             body: data.mensaje
  713.                         });
  714.                         closeModal('modal-solicitud-programada');
  715.                     },
  716.                     error: function (data, text, error) {
  717.                         $(document).Toasts('create', {
  718.                             autohide: true,
  719.                             delay: 3000,
  720.                             class: 'bg-warning',
  721.                             title: 'Programación por grupo',
  722.                             subtitle: 'Ocurrió un error',
  723.                             body: data.responseJSON.mensaje
  724.                         });
  725.                     },
  726.                     complete: function () {
  727.                         setTimeout(function(){
  728.                             send.text("Programar mantenimiento"); // Para input de tipo button
  729.                             send.append("<i></i>");
  730.                             send.prop("disabled", false);
  731.                         }, 5000);
  732.                     }
  733.                 });
  734.                 return false; // Evitar ejecutar el submit del formulario.
  735.             });
  736.         }
  737.         function solicitudReprogramar(url)
  738.         {
  739.             $('#modal-solicitud-reprogramar').load(url, function ()
  740.             {
  741.                 // configuración del Modal
  742.                 $("#modal-solicitud-reprogramar").on('hide.bs.modal', function () {
  743.                     $(this).html('Cargando');
  744.                 });
  745.                 $(".modal-dialog").draggable;
  746.                 solicitudReprogramarAjax(url)
  747.             })
  748.         }
  749.         function solicitudReprogramarAjax(url)
  750.         {
  751.             let send = $("#editar_usuario_guardar");
  752.             $('#editar_usuario_guardar').on('click', function () {
  753.                 let formData = new FormData(document.getElementById("form-programar-solicitud"));
  754.                 $.ajax({
  755.                     type: "POST",
  756.                     url: url,
  757.                     data: formData, // Adjuntar los campos del formulario enviado.
  758.                     dataType: "json",
  759.                     cache: false,
  760.                     contentType: false,
  761.                     processData: false,
  762.                     beforeSend: function () {
  763.                         send.text("Actualizando "); // Para input de tipo button
  764.                         send.append("<i class='fa fa-spinner fa-spin' style='font-size:16px'></i>");
  765.                         send.prop("disabled", true);
  766.                     },
  767.                     success: function (data) {
  768.                         let row = $('#idTipoE-' + data.idsol);
  769.                         row.find('.falla').text(data.accion);
  770.                         row = $('#modal-table-' + data.idsol);
  771.                         row.find('.falla').text(data.accion);
  772.                         $(document).Toasts('create', {
  773.                             autohide: true,
  774.                             delay: 3000,
  775.                             class: 'bg-success',
  776.                             title: 'Edición de programación',
  777.                             subtitle: 'Éxito',
  778.                             body: data.mensaje
  779.                         });
  780.                         closeModal('#modal-solicitud-reprogramar');
  781.                     },
  782.                     error: function (data, text, error) {
  783.                         let datos = data.responseJSON;
  784.                         $("#modal-solicitud-reprogramar").html(datos.form);
  785.                         solicitudReprogramarAjax(url);
  786.                     },
  787.                     complete: function () {
  788.                         setTimeout(function(){
  789.                             send.text("Programar mantenimiento"); // Para input de tipo button
  790.                             send.append("<i></i>");
  791.                             send.prop("disabled", false);
  792.                         }, 5000);
  793.                     }
  794.                 });
  795.                 return false; // Evitar ejecutar el submit del formulario.
  796.             });
  797.         }
  798.         function aplicarFiltro() {
  799.             $("#tipoA").find($("tbody")).html("<tr><td colspan='8' class='text-center'><i class='fas fa-spinner fa-pulse'></i></td></tr>");
  800.             $("#tipoB").find($("tbody")).html("<tr><td colspan='8' class='text-center'><i class='fas fa-spinner fa-pulse'></i></td></tr>");
  801.             $("#tipoC").find($("tbody")).html("<tr><td colspan='8' class='text-center'><i class='fas fa-spinner fa-pulse'></i></td></tr>");
  802.             $("#tipoD").find($("tbody")).html("<tr><td colspan='8' class='text-center'><i class='fas fa-spinner fa-pulse'></i></td></tr>");
  803.             let formData = new FormData(document.getElementById("form_ubicacion_filtro"));
  804.             console.log(formData);
  805.             $.ajax({
  806.                 type: "POST",
  807.                 url: '{{ path('prog_preventivo_index') }}',
  808.                 data: formData, // Adjuntar los campos del formulario enviado.
  809.                 dataType: "html",
  810.                 cache: false,
  811.                 contentType: false,
  812.                 processData: false,
  813.                 success: function (data) {
  814.                     let datos = jQuery.parseJSON(data);
  815.                     console.log(datos);
  816.                     actualizarEquipos(datos);
  817.                     ocultarFormulario();
  818.                     funcionSeleccion();
  819.                     limpiarSeleccion();
  820.                 },
  821.                 error: function (data, text, error) {
  822.                     let datos = jQuery.parseJSON(data.responseText);
  823.                     console.log(datos);
  824.                 }
  825.             });
  826.         }
  827.         <!-- Actualizar tabla de bitácora -->
  828.         function actualizarEquipos(data) {
  829.             $("#tipoA").dataTable().fnClearTable();
  830.             $("#tipoA").dataTable().fnDestroy();
  831.             $("#tipoB").dataTable().fnClearTable();
  832.             $("#tipoB").dataTable().fnDestroy();
  833.             $("#tipoC").dataTable().fnClearTable();
  834.             $("#tipoC").dataTable().fnDestroy();
  835.             $("#tipoD").dataTable().fnClearTable();
  836.             $("#tipoD").dataTable().fnDestroy();
  837.             var edit = "";
  838.             var html_a = "";
  839.             var html_b = "";
  840.             var html_c = "";
  841.             var html_d = "";
  842.             $.each(data, function (key, equipo) {
  843.                 if(equipo.tipo === 'Equipo'){
  844.                     html_a +=
  845.                         "<tr id='idTipoA-" + equipo.id + "'>" +
  846.                             "<td>" +
  847.                                 "<label>" +
  848.                                     "<input type='checkbox' class='check-tipoa' name='equipo[]' value='" + equipo.id + "'/>" +
  849.                                 "</label>" +
  850.                             "</td>" +
  851.                             "<th class='marbete'>" + equipo.marbete + "</th>" +
  852.                             "<td class='descripcion'>" + equipo.descripcion + "</td>" +
  853.                             "<td class='marca'>" + equipo.marca + "</td>" +
  854.                             "<td class='ubicacion'>" + equipo.ubicacion + "</td>" +
  855.                             "<td class='usuario'>" + equipo.usuario + "</td>" +
  856.                             "<td class='mpe'><h3><span class='badge bg-secondary float-center'>0</span></h3></td>" +
  857.                             "<td>" +
  858.                                 /*"<a href='#modal-solicitud-programar' class='text-success' data-toggle='modal' onclick=\"solicitudProgramar('" + equipo.nuevo + "')\">" +
  859.                                     "<i class='fa fa-calendar' data-toggle='tooltip' title='Programar mantenimiento'></i>" +
  860.                                 "</a>" +*/
  861.                                 "<a href='#modal-solicitud-programada' class='text-info btn' data-toggle='modal' onclick=\"solicitudProgramada('" + equipo.ver + "')\">" +
  862.                                     "<i class='fa fa-eye' data-toggle='tooltip' title='Ver mantenimientos programados'></i>" +
  863.                                 "</a>" +
  864.                             "</td>" +
  865.                         "</tr>";
  866.                 }
  867.                 if(equipo.tipo === 'Impresora'){
  868.                     html_b +=
  869.                         "<tr id='idTipoB-" + equipo.id + "'>" +
  870.                             "<td>" +
  871.                                 "<label>" +
  872.                                     "<input type='checkbox' class='check-tipob' name='impresora[]' value='" + equipo.id + "'/>" +
  873.                                 "</label>" +
  874.                             "</td>" +
  875.                             "<th class='marbete'>" + equipo.marbete + "</th>" +
  876.                             "<td class='descripcion'>" + equipo.descripcion + "</td>" +
  877.                             "<td class='marca'>" + equipo.marca + "</td>" +
  878.                             "<td class='ubicacion'>" + equipo.ubicacion + "</td>" +
  879.                             "<td class='usuario'>" + equipo.usuario + "</td>" +
  880.                             "<td class='mpe'><h3><span class='badge bg-secondary float-center'>0</span></h3></td>" +
  881.                             "<td>" +
  882.                                 /*"<a href='#modal-solicitud-programar' class='text-success' data-toggle='modal' onclick=\"solicitudProgramar('" + equipo.nuevo + "')\">" +
  883.                                     "<i class='fa fa-calendar' data-toggle='tooltip' title='Programar mantenimiento'></i>" +
  884.                                 "</a>" +*/
  885.                                 "<a href='#modal-solicitud-programada' class='text-info btn' data-toggle='modal' onclick=\"solicitudProgramada('" + equipo.ver + "')\">" +
  886.                                     "<i class='fa fa-eye' data-toggle='tooltip' title='Ver mantenimientos programados'></i>" +
  887.                                 "</a>" +
  888.                             "</td>" +
  889.                         "</tr>";
  890.                 }
  891.                 if(equipo.tipo === 'Red'){
  892.                     html_c +=
  893.                         "<tr id='idTipoC-" + equipo.id + "'>" +
  894.                             "<td>" +
  895.                                 "<label>" +
  896.                                     "<input type='checkbox' class='check-tipoc' name='red[]' value='" + equipo.id + "'/>" +
  897.                                 "</label>" +
  898.                             "</td>" +
  899.                             "<th class='marbete'>" + equipo.marbete + "</th>" +
  900.                             "<td class='descripcion'>" + equipo.descripcion + "</td>" +
  901.                             "<td class='marca'>" + equipo.marca + "</td>" +
  902.                             "<td class='ubicacion'>" + equipo.ubicacion + "</td>" +
  903.                             "<td class='usuario'>" + equipo.usuario + "</td>" +
  904.                             "<td class='mpe'><h3><span class='badge bg-secondary float-center'>0</span></h3></td>" +
  905.                             "<td>" +
  906.                                 /*"<a href='#modal-solicitud-programar' class='text-success' data-toggle='modal' onclick=\"solicitudProgramar('" + equipo.nuevo + "')\">" +
  907.                                     "<i class='fa fa-calendar' data-toggle='tooltip' title='Programar mantenimiento'></i>" +
  908.                                 "</a>" +*/
  909.                                 "<a href='#modal-solicitud-programada' class='text-info btn' data-toggle='modal' onclick=\"solicitudProgramada('" + equipo.ver + "')\">" +
  910.                                     "<i class='fa fa-eye' data-toggle='tooltip' title='Ver mantenimientos programados'></i>" +
  911.                                 "</a>" +
  912.                             "</td>" +
  913.                         "</tr>";
  914.                 }
  915.                 if(equipo.tipo === 'Otro'){
  916.                     html_d +=
  917.                         "<tr id='idTipoD-" + equipo.id + "'>" +
  918.                             "<td>" +
  919.                                 "<label>" +
  920.                                     "<input type='checkbox' class='check-tipod' name='otro[]' value='" + equipo.id + "'/>" +
  921.                                 "</label>" +
  922.                             "</td>" +
  923.                             "<th class='marbete'>" + equipo.marbete + "</th>" +
  924.                             "<td class='descripcion'>" + equipo.descripcion + "</td>" +
  925.                             "<td class='marca'>" + equipo.marca + "</td>" +
  926.                             "<td class='ubicacion'>" + equipo.ubicacion + "</td>" +
  927.                             "<td class='usuario'>" + equipo.usuario + "</td>" +
  928.                             "<td class='mpe'><h3><span class='badge bg-secondary float-center'>0</span></h3></td>" +
  929.                             "<td>" +
  930.                                 /*"<a href='#modal-solicitud-programar' class='text-success' data-toggle='modal' onclick=\"solicitudProgramar('" + equipo.nuevo + "')\">" +
  931.                                     "<i class='fa fa-calendar' data-toggle='tooltip' title='Programar mantenimiento'></i>" +
  932.                                 "</a>" +*/
  933.                                 "<a href='#modal-solicitud-programada' class='text-info btn' data-toggle='modal' onclick=\"solicitudProgramada('" + equipo.ver + "')\">" +
  934.                                     "<i class='fa fa-eye' data-toggle='tooltip' title='Ver mantenimientos programados'></i>" +
  935.                                 "</a>" +
  936.                             "</td>" +
  937.                         "</tr>";
  938.                 }
  939.             });
  940.             $("#tipoA").find($("tbody")).html(html_a);
  941.             $('#tipoA').DataTable({
  942.                 "aaSorting": [],
  943.                 orderCellsTop: true,
  944.                 {# Define un valor predeterminado para LengthChange #}
  945.                 "pageLength": 50,
  946.                 "scrollX": true,
  947.                 {# sDom: 'lrtip', #}
  948.                 "bLengthChange" : true,
  949.                 language: {
  950.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  951.                 },
  952.             });
  953.             $("#tipoB").find($("tbody")).html(html_b);
  954.             $('#tipoB').DataTable({
  955.                 "aaSorting": [],
  956.                 orderCellsTop: true,
  957.                 {# Define un valor predeterminado para LengthChange #}
  958.                 "pageLength": 50,
  959.                 "scrollX": true,
  960.                 {# sDom: 'lrtip', #}
  961.                 "bLengthChange" : true,
  962.                 language: {
  963.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  964.                 },
  965.             });
  966.             $("#tipoC").find($("tbody")).html(html_c);
  967.             $('#tipoC').DataTable({
  968.                 "aaSorting": [],
  969.                 orderCellsTop: true,
  970.                 {# Define un valor predeterminado para LengthChange #}
  971.                 "pageLength": 50,
  972.                 "scrollX": true,
  973.                 {# sDom: 'lrtip', #}
  974.                 "bLengthChange" : true,
  975.                 language: {
  976.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  977.                 },
  978.             });
  979.             $("#tipoD").find($("tbody")).html(html_d);
  980.             $('#tipoD').DataTable({
  981.                 "aaSorting": [],
  982.                 orderCellsTop: true,
  983.                 {# Define un valor predeterminado para LengthChange #}
  984.                 "pageLength": 50,
  985.                 "scrollX": true,
  986.                 {# sDom: 'lrtip', #}
  987.                 "bLengthChange" : true,
  988.                 language: {
  989.                     url: 'https://cdn.datatables.net/plug-ins/1.10.22/i18n/Spanish.json'
  990.                 },
  991.             });
  992.             vistaContador();
  993.         }
  994.     </script>
  995. {% endblock %}