<!DOCTYPE html>
<html lang="es">

<head>
  <%- include('../../tools/head'); %>
  <!-- Custom styles for this page -->
  <link href="/vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="https://cdn.datatables.net/datetime/1.1.2/css/dataTables.dateTime.min.css">
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/amcharts/3.21.15/plugins/export/libs/FileSaver.js/FileSaver.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.15.6/xlsx.full.min.js"></script>
  <link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.dataTables.min.css">
</head>

<body id="page-top">
  <!-- Page Wrapper -->
  <div id="wrapper">

    <!-- Sidebar -->
    <%- include('../../tools/sidebarProf'); %>
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">
      <!-- Main Content -->
      <div id="content">

        <!-- Topbar -->
        <%- include('../../tools/topbar'); %>
        <!-- End of Topbar -->

        <!-- Begin Page Content -->
        <div class="container-fluid">


          <!-- Page Heading -->
          <div class="container">

            <div class="card shadow mb-4">
              <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="/profesional/HojaVida/ConsultarHV">Hojas de Vida</a>
                  </li>
                  <li class="breadcrumb-item active" aria-current="page">Detalles</li>
                </ol>
              </nav>

              <div class="card-body p-0">
                <!-- Nested Row within Card Body -->
                <div class="p-5">
                  <div class="text-center">
                    <h1 class="h4 text-gray-900 mb-4">Detalle de Establecimientos</h1>
                  </div>

                  <div class="form-row align-items-center mb-sm-2">
                    <div class="col my-1">
                      <label class="mr-sm-2" for="provinciaID">Provincia</label>
                      <input type="text" class="form-control form-control-user" readonly value="<%= consultHV.provincia %>" />
                    </div>
                    <div class="col my-1">
                      <label class="mr-sm-2" for="muniSelect">Municipio</label>
                      <input type="text" class="form-control form-control-user" readonly value="<%= consultHV.municipio %>" />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-8 mb-3 mb-sm-0">
                      <label class="mr-sm-2" for="grupEsta">Grupo Del
                        Establecimiento</label>
                      <input type="text" class="form-control form-control-user" readonly value="<%= consultHV.grupo %>" />
                    </div>
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="Nriesgo">Nivel de
                        Riesgo</label>
                      <input type="text" class="form-control form-control-user" readonly value="<%= consultHV.nivelRiesgo %>" />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-12">
                      <label class="mr-sm-2" for="tipoEsta">Tipo Del
                        Establecimiento</label>
                      <input type="text" class="form-control form-control-user" readonly value="<%= consultHV.tipo %>" />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-3">
                      <label class="mr-sm-2" for="codEsta">Codigo
                        Establecimiento</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.codigo %>" readonly />
                    </div>
                    <div class="col-sm-3">
                      <label class="mr-sm-2" for="tIden">Tipo de
                        Identificación</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.tipoIdentificacion %>" readonly />
                    </div>
                    <div class="col-sm-3">
                      <label class="mr-sm-2" for="inputIden">Identificación</label>
                      <input type="number" class="form-control form-control-user" value="<%= consultHV.identificacion %>" readonly />
                    </div>
                    <div class="col-sm-3">
                      <label class="mr-sm-2" for="phone">Telefono</label>
                      <input type="number" class="form-control form-control-user" value="<%= consultHV.telefono %>" readonly />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="rSocial">Razón
                        Social</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.razonSocial %>" readonly />
                    </div>
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="idenSocial">Codigo Inscripción</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.idenSocial %>" readonly />
                    </div>
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="direccion">Dirección</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.direccion %>" readonly />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-6">
                      <label class="mr-sm-2" for="rLegal">Representante
                        Legal</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.repreLegal %>" readonly />
                    </div>
                    <div class="col-sm-2" id="placaDiv" style="display: none;">
                      <label class="mr-sm-2" for="placa">Placa</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.placa %>" readonly />
                    </div>
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="estado">Estado</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.estado %>" readonly />
                    </div>
                  </div>

                  <div class="form-group row">
                    <div class="col-sm-4">
                      <label class="mr-sm-2" for="iDueno">Identificación Dueño (Opcional)</label>
                      <input type="number" class="form-control form-control-user" value="<%= consultHV.iDueno %>" readonly />
                    </div>
                    <div class="col-sm-8">
                      <label class="mr-sm-2" for="nDueno">Nombre Dueño (Opcional)</label>
                      <input type="text" class="form-control form-control-user" value="<%= consultHV.nDueno %>" readonly />
                    </div>
                  </div>

                  <% if (allConso){ %>
                  <div id="accordion">

                    <%- include('../../tools/Templates/HVViewTem'); %>

                  </div>
                  <% } %>


                </div>
              </div>

            </div>
            <!-- /.container-fluid -->

          </div>
          <!-- End of Main Content -->

          <!-- Footer -->
          <%- include('../../tools/footer'); %>
          <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

      </div>
      <!-- End of Page Wrapper -->

      <!-- Scroll to Top Button-->
      <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
      </a>

      <!-- Logout Modal-->
      <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLabel">Salida</h5>
              <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
              </button>
            </div>
            <div class="modal-body">Seleccione "Cerrar
              sesión" a continuación si está listo para
              finalizar su sesión actual.</div>
            <div class="modal-footer">
              <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancelar</button>
              <a class="btn btn-primary" href="/profesional/logout">Cerrar Sesión</a>
            </div>
          </div>
        </div>
      </div>

      <!-- Bootstrap core JavaScript-->
      <script src="/vendor/jquery/jquery.min.js"></script>
      <script src="/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

      <!-- Core plugin JavaScript-->
      <script src="/vendor/jquery-easing/jquery.easing.min.js"></script>

      <!-- Custom scripts for all pages-->
      <script src="/js/sb-admin-2.min.js"></script>

      <!-- Page level plugins -->
      <script src="/vendor/datatables/jquery.dataTables.min.js"></script>
      <script src="/vendor/datatables/dataTables.bootstrap4.min.js"></script>

      <!-- Page level custom scripts -->
      <script src="/js/demo/datatables-demo.js"></script>

      <!-- Excel -->
      <script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
      <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>

      <!-- Search Advanced -->
      <script src="https://cdn.datatables.net/fixedcolumns/4.1.0/js/dataTables.fixedColumns.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.2/moment.min.js"></script>
      <script src="https://cdn.datatables.net/datetime/1.1.2/js/dataTables.dateTime.min.js"></script>

      <script type="text/JavaScript">
        $(window).bind('load', function() {
      var nav = document.getElementById('nav3');
      $('#navlink2').removeClass('collapsed');
      var nav3 = document.getElementById('collapseThree');
      var nav4 = document.getElementById('show3');
      nav.className += "  active";
      nav3.className += "  show";
      nav4.className += "  active";

      if ("<%= consultHV.grupo %>" == "VEHÍCULOS TRANSPORTADORES DE ALIMENTOS Y BEBIDAS") {
        document.getElementById("placaDiv").removeAttribute("style")
      } 
    });

    // $('table.display tfoot th').each(function() {
    //   var title = $(this).text();
    //   $(this).html('<input type="text" placeholder="Search ' + title + '" />');
    // });
    $('#dataTable').DataTable({
    "scrollX": true
  });
  $('#dataTable4').DataTable({
    "scrollX": true
  });
  $('.dataTables_length').addClass('bs-select');
    // table.columns().every(function() {
    //   var that = this;
    //   $('input', this.footer()).on('keyup change', function() {
    //     that
    //       .search(this.value)
    //       .draw();
    //   });
    // });
    </script>

      <% if(typeof alert !="undefined" ) { %>
      <script type="text/JavaScript">
        Swal.fire({
        title: '<%= alert[0].alertTitle %>',
        text:'<%= alert[0].alertMessage %>',
        icon:'<%= alert[0].alertIcon %>',
        showConfirmButton: <%= alert[0].showConfirmButton %>,
        timer: <%= alert[0].timer %>
        }).then(()=>{
        window.location = '/<%= alert[0].ruta %>'
        })
    </script>
      <% } %>
</body>

</html>