<!DOCTYPE html>
<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 my-5">
              <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">EVENTOS EN SALUD PUBLICA</h1>
                  </div>

                  <form onsubmit="eventSalud(event)" action="/tecnico/Consolidaciones/Enviar/EventosSaludPublica/<%= user.user %>" method="POST" autocomplete="off" enctype="multipart/form-data">
                    <input type="text" value="on" id="EvenSaludPubliON" name="EvenSaludPubliON" style="display: none;" readonly>

                    <div class="form-row align-items-center mb-sm-2">
                      <div class="col my-1">
                        <label class="mr-sm-2" for="mes">Mes</label>
                        <input type="text" class="form-control form-control-user" id="mes" name="mes" onkeyup="mayus(this);" readonly>
                      </div>
                      <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>
                        <select id="muniSelect" name="municipio" class="custom-select mr-sm-2">
                          <option selected disabled>Seleccione el Municipio
                          </option>
                          <option value="<%= user.municipio %>">
                            <%= user.municipio %>
                          </option>
                          <% if(user.municipioExtra1 !="" ){ %>
                          <option value="<%= user.municipioExtra1 %>">
                            <%= user.municipioExtra1 %>
                          </option>
                          <% } %>
                          <% if(user.municipioExtra2 !="" ){ %>
                          <option value="<%= user.municipioExtra2 %>">
                            <%= user.municipioExtra2 %>
                          </option>
                          <% } %>
                          <% if(user.municipioExtra3 !="" ){ %>
                          <option value="<%= user.municipioExtra3 %>">
                            <%= user.municipioExtra3 %>
                          </option>
                          <% } %>
                        </select>
                      </div>
                    </div>

                    <div class="row" style="text-align: center !important;">
                      <div class="col-sm-12">
                        <label class="mr-sm-12">ETAS</label>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="etasPresent">Presentadas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="etasPresent" name="etasPresent" />
                      </div>
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="etasAtend">Atendidas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="etasAtend" name="etasAtend" />
                      </div>
                    </div>

                    <div class="row" style="text-align: center !important;">
                      <div class="col-sm-12">
                        <label class="mr-sm-12">INTOXICACIONES POR
                          SUSTANCIAS QUIMICAS</label>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="intoxPresent">Presentadas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="intoxPresent" name="intoxPresent" />
                      </div>
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="intoxAtend">Atendidas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="intoxAtend" name="intoxAtend" />
                      </div>
                    </div>

                    <div class="row" style="text-align: center !important;">
                      <div class="col-sm-12">
                        <label class="mr-sm-12">AGRESIONES</label>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="agrePresent">Presentadas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="agrePresent" name="agrePresent" />
                      </div>
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="agreAtend">Atendidas</label>
                        <input type="number" value="0" min="0" class="form-control form-control-user" id="agreAtend" name="agreAtend" />
                      </div>
                    </div>

                    <div class="row" style="text-align: center !important;">
                      <div class="col-sm-12">
                        <label class="mr-sm-12">PARTICIPACIÓN EN
                          COVE</label>
                      </div>
                    </div>

                    <div class="form-group row">
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="trueFalse">Si o No</label>
                        <select id="trueFalse" name="trueFalse" class="custom-select mr-sm-2">
                          <option selected disabled>
                            Seleccione
                          </option>
                          <option value="SI">SI</option>
                          <option value="NO">NO</option>
                        </select>
                      </div>
                      <div class="col-sm-6">
                        <label class="mr-sm-2" for="fReunion">Fecha de Reunion</label>
                        <input type="date" class="form-control form-control-user" id="fReunion" name="fReunion" readonly />
                      </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" placeholder="Escribe las Observaciones Que Creas Necesarias"></textarea>
                      </div>
                    </div>

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

                    <div class="form-group row">
                      <div class="col-sm-12">
                        <label class="mr-sm-2" for="fields">Adjuntar
                          Archivo(s)</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">
                      Registrar Consolidación
                    </button>
                    <a href="/tecnico/Consolidaciones/Enviar" class="btn btn-secondary btn-user btn-block">
                      Cancelar
                    </a>

                  </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/Tecnico/formularios.js"></script>
  <script type="text/JavaScript" src="/js/tools/dropzone.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('show2');
      nav.className += "  active";
      nav3.className += "  show";
      nav4.className += "  active";
    });

    $("#trueFalse").change(function() {
      if (document.getElementById("trueFalse").value == "SI") {
        $("#fReunion").attr("readonly", false);
        document
          .getElementById("fReunion")
          .setAttribute("max", new Date().toJSON().substring(0, 10));
      } else {
        document.getElementById("fReunion").value = "dd/mm/aaaa"
        $("#fReunion").attr("readonly", true);
      }
    });
  </script>
</body>

</html>