<html lang="es">

<head>
  <%- include('../../../tools/head'); %>
  <link rel="stylesheet" href="/css/dropzone.css">
</head>

<body id="page-top">
  <!-- Page Wrapper -->
  <div id="wrapper">
    <!-- Sidebar -->
    <%- include('../../../tools/sidebarTec'); %>
    <!-- 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">
          <div class="container">
            <div class="card o-hidden border-0 shadow-lg">
              <div class="card-body p-0">
                <nav style="--bs-breadcrumb-divider: '>'" aria-label="breadcrumb">
                  <ol class="breadcrumb">
                    <li class="breadcrumb-item">
                      <a href="/tecnico/Consolidaciones/Ver">Consolidaciones</a>
                    </li>
                    <li class="breadcrumb-item">
                      <a href="/tecnico/Consolidaciones/Ver/Quejas">Quejas</a>
                    </li>
                    <li class="breadcrumb-item active" aria-current="page">
                      Corregir
                    </li>
                  </ol>
                </nav>
                <!-- Nested Row within Card Body -->
                <div class="p-5">
                  <div class="text-center">
                    <h1 class="h4 text-gray-900 mb-4">QUEJAS</h1>
                  </div>

                  <form onsubmit="quejasFormRech(event)" action="/tecnico/Consolidaciones/Rechazado/Quejas/<%= consolidacion._id %>" method="POST" autocomplete="off" enctype="multipart/form-data">
                    <input type="text" value="on" id="quejasON" name="quejasON" style="display: none;" readonly>

                    <div class="form-group row">
                      <div class="col-sm-3">
                        <label class="mr-sm-2" for="criterio">Criterio</label>
                        <input type="text" class="form-control form-control-user" value="Rechazado" readonly>
                      </div>
                      <div class="col-sm-9" id="divMotivo">
                        <label class="mr-sm-2" for="motivo">Motivo</label>
                        <textarea maxlength="270" rows="2" name="motivo" id="motivo" class="form-control form-control-user" readonly><%= consolidacion.reporte.motivo %></textarea>
                      </div>
                    </div>

                    <!-- Divider -->
                    <hr class="sidebar-divider" style="border-top: 1px solid rgb(0 0 0)" />

                    <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" id="provinciaID" name="provincia" value="<%= user.provincia %>" readonly>
                      </div>
                      <div class="col my-1">
                        <label class="mr-sm-2" for="muniSelect">Municipio</label>
                        <input type="text" class="form-control form-control-user" id="muniSelect" name="municipio" value="<%= consolidacion.municipio %>" readonly>
                      </div>
                    </div>

                    <% if(consolidacion.hojavida != undefined){ %>
                    <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" value="<%= consolidacion.hojavida.grupo %>" readonly>
                      </div>
                      <div class="col-sm-2">
                        <label class="mr-sm-2" for="codEsta">Codigo</label>
                        <input type="text" class="form-control form-control-user" value="<%= consolidacion.hojavida.codigo %>" readonly />
                      </div>
                      <div class="col-sm-2">
                        <label class="mr-sm-2" for="Nriesgo">Nivel de Riesgo</label>
                        <input type="text" class="form-control form-control-user" value="<%= consolidacion.hojavida.nivelRiesgo %>" readonly />
                      </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" value="<%= consolidacion.hojavida.tipo %>" readonly />
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-5">
                        <label class="mr-sm-2" for="rSocial">Razón Social</label>
                        <input type="text" class="form-control form-control-user" value="<%= consolidacion.hojavida.razonSocial %>" readonly />
                      </div>
                      <div class="col-sm-2">
                        <label class="mr-sm-3" for="tIden">Tipo </label>
                        <input type="text" value="<%= consolidacion.hojavida.tipoIdentificacion %>" class="form-control form-control-user" readonly>
                      </div>
                      <div class="col-sm-3">
                        <label class="mr-sm-2" for="inputIden">Identificación</label>
                        <input type="number" value="<%= consolidacion.hojavida.identificacion %>" class="form-control form-control-user" readonly>
                      </div>
                      <div class="col-sm-2">
                        <label class="mr-sm-2" for="phone">Telefono</label>
                        <input type="number" value="<%= consolidacion.hojavida.telefono %>" class="form-control form-control-user" 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="<%= consolidacion.hojavida.repreLegal %>" readonly />
                      </div>
                      <div class="col-sm-3">
                        <label class="mr-sm-2" for="direccion">Dirección</label>
                        <input type="text" class="form-control form-control-user" value="<%= consolidacion.hojavida.direccion %>" readonly />
                      </div>
                      <div class="col-sm-3">
                        <label class="mr-sm-2" for="estado">Estado</label>
                        <input type="text" class="form-control form-control-user" value="<%= consolidacion.hojavida.estado %>" readonly />
                      </div>
                    </div>
                    <% } %>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="tipQueja">Tipo de Queja</label>
                        <select id="tipQueja" name="tipQueja" class="custom-select mr-sm-2">
                          <option selected disabled>
                            Seleccione
                          </option>
                          <option value="AGUA (CONSUMO - RECREATIVAS)">AGUA
                            (CONSUMO - RECREATIVAS)
                          </option>
                          <option value="AGUAS RESIDUALES">AGUAS RESIDUALES
                          </option>
                          <option value="AIRE – RUIDO">AIRE – RUIDO</option>
                          <option value="ALIMENTOS">ALIMENTOS</option>
                          <option value="ZOONOSIS">ZOONOSIS</option>
                          <option value="RESIDUOS SOLIDOS Y ESPECIALES">RESIDUOS
                            SOLIDOS Y ESPECIALES</option>
                          <option value="USO Y MANEJO DE PLAGUICIDAS Y OTRAS SUSTANCIAS QUIMICAS">
                            USO Y MANEJO DE PLAGUICIDAS Y OTRAS SUSTANCIAS
                            QUIMICAS</option>
                          <option value="OTROS">OTROS</option>
                        </select>
                      </div>
                      <div class="col-sm-3">
                        <label class="mr-sm-2" for="fechRece">Fecha de
                          Recepción</label>
                        <input type="date" class="form-control form-control-user" id="fechRece" name="fechRece" value="<%= moment(consolidacion.ForQuejas.frecep).add(1, 'days').format('YYYY-MM-DD'); %>" onkeyup="mayus(this);" />
                      </div>
                      <div class="col-sm-3">
                        <label class="mr-sm-2">Fecha de
                          Visita</label>
                        <input type="date" name="fVisit" class="form-control form-control-user" value="<%= moment(consolidacion.fvisit).add(1, 'days').format('YYYY-MM-DD'); %>" readonly />
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="perCausa">Persona Que Causa La
                          Queja</label>
                        <input type="text" class="form-control form-control-user" id="perCausa" name="perCausa" value="<%= consolidacion.ForQuejas.perCausaQueja %>" onkeyup="mayus(this);" />
                      </div>
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="perAfec">Persona
                          Afectada</label>
                        <input type="text" class="form-control form-control-user" id="perAfec" name="perAfec" value="<%= consolidacion.ForQuejas.perAfectQueja %>" onkeyup="mayus(this);" />
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="descQueja">Descripción De La
                          Queja</label>
                        <textarea name="descQueja" id="descQueja" maxlength="270" rows="2" onkeyup="mayus(this);" class="form-control form-control-user"><%= consolidacion.ForQuejas.descQueja %></textarea>
                      </div>
                      <div class=" col-sm-6">
                        <label class="mr-sm-2" for="requeQueja">Requerimientos</label>
                        <textarea name="requeQueja" id="requeQueja" maxlength="270" rows="2" onkeyup="mayus(this);" class="form-control form-control-user"><%= consolidacion.ForQuejas.reqQueja %></textarea>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-12">
                        <label class="mr-sm-2" for="observacion">Observaciones
                          (Opcional)</label>
                        <textarea name="observacion" id="observacion" onkeyup="mayus(this);" maxlength="270" rows="2" class="form-control form-control-user"><%= consolidacion.observaciones %></textarea>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-12">
                        <label class="mr-sm-2">Archivos Adjuntos</label>
                        <a href="/tecnico/evidencia/<%= consolidacion._id %>" target="_blank" type="button" class="btn btn-info">Descargar</a>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-12">
                        <label class="mr-sm-2" for="fields">Adjuntar
                          Archivo(s) Nuevos</label>
                        <div class="drop-zone">
                          <span class="drop-zone__prompt">Arrastra el archivo o da click para buscar</span>
                          <input type="file" name="myFile" id="myFile" class="drop-zone__input" />
                        </div>
                      </div>
                    </div>

                    <button class="btn btn-primary btn-user btn-block" type="submit">
                      Enviar Corrección
                    </button>
                  </form>
                </div>
              </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="/tecnico/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>

  <!-- Validations -->
  <script type="text/JavaScript" src="/js/tools/dropzone.js"></script>
  <script type="text/JavaScript" src="/js/Tecnico/formularios.js"></script>

  <!-- Alert -->
  <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></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>
  <% } %>

  <script>
    $(window).bind('load', function() {
      var nav = document.getElementById('nav2');
      $('#navlink1').removeClass('collapsed');
      var nav3 = document.getElementById('collapseOne');
      var nav4 = document.getElementById('show1');
      nav.className += "  active";
      nav3.className += "  show";
      nav4.className += "  active";
    });
    document.getElementById("tipQueja").value = "<%= consolidacion.ForQuejas.tipoQueja %>"
  </script>

</body>

</html>