  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Gestión de KPI</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item"><a href="#">Administración</a></li>
              <li class="breadcrumb-item"><a href="#">Gestión de KPI</a></li>
              <li class="breadcrumb-item active">Registrar resultados</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <?php 

      require_once "../../controlador/administracion.controlador.php";

      // Instancia de la clase UsuarioControlador
      $administracionControlador = new Controladoradministracion();

      // Zonas
      $zonas = $administracionControlador->ctrConsultaZona();
    
    ?>

    <!-- Modal KPI -->
    <div class="modal fade" id="modal_kpi" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">KPI</h5>   
          </div>
          <form class="form-horizontal" autocomplete="off" id="frm_proceso">
            <div class="modal-body"> 
              <div class="row">
                <div class="form-group col-sm-12">
                  <input type="text" class="form-control" name="descripcion_kpi" id="descripcion_kpi" placeholder="DESCRIPCIÓN DE KPI" onkeyup="consultaKPI(this.value, 'consulta_indicador_descripcion', '<?php echo $_GET['id_proceso'] ?>', '<?php echo $_GET['id_perfil'] ?>', '../controlador/administracion.controlador.php');">
                </div>
              </div>
              <div class="table-responsive">
                <table class="table">
                  <thead>
                    <tr>
                      <th>Id</th>
                      <th>Descripcón</th>
                    </tr>
                  </thead>
                  <tbody id="lista_indicadores">
                  </tbody>
                </table>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-success" data-dismiss="modal">Cerrar <i class="fas fa-times ml-3"></i></button>
            </div>

          </form>
        </div>
      </div>
    </div>

    <!-- Main content -->
    <section class="content">

      <div class="container-fluid">
        <div class="row">
          <div class="col-12">
            <!-- Default box -->
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">Registrar resultados</h3>

                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
                    <i class="fas fa-minus"></i></button>
                  <button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
                    <i class="fas fa-times"></i></button>
                </div>
              </div>
              <form autocomplete="off" id="frm_consulta_resultado">  
                <div class="card-body">
                  <div class="row">
                    <!-- <button type="button" class="btn btn-success col-sm-12 mb-3" data-toggle="modal" data-target="#modal_nuevo_proceso">Crear nuevo proceso <i class="fas fa-plus ml-2"></i></button> -->
                    <div class="input-group mb-2 col-sm-3">
                      <input type="hidden" class="form-control" name="id_kpi" id="id_kpi">
                      <input type="text" class="form-control text-uppercase" name="descricion_kpi" id="descricion_kpi" readonly="" placeholder="KPI" aria-label="Buscar KPI" aria-describedby="button-addon2" style="height: 33px">
                      <div class="input-group-append"  style="height: 33px;">
                        <button class="btn btn-success" type="button" id="button-addon2" data-toggle="modal" data-target="#modal_kpi" onclick="consultaKPI(this.value, 'consulta_indicador_descripcion', '<?php echo $_GET['id_proceso'] ?>', '<?php echo $_GET['id_perfil'] ?>', '../controlador/administracion.controlador.php');"><i class="fas fa-search" id=""></i></button>
                      </div>
                    </div>
                    <div class="form-group col-sm-3">
                      <input type="date" class="form-control" name="fecha_desde" id="fecha_desde" data-date="" data-date-format="y/m/d" style="height: 33px;">
                    </div>
                    <!-- <div class="form-group col-sm-3">
                        <div class="input-group date" id="reservationdate" data-target-input="nearest">
                            <input type="text" class="form-control datetimepicker-input" name="fecha_desde" id="timepicker">
                            <div class="input-group-append" data-target="#reservationdate" data-toggle="datetimepicker">
                                <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                            </div>
                        </div>
                    </div> -->
                    <div class="form-group col-sm-3">
                      <input type="date" class="form-control" name="fecha_hasta" id="fecha_hasta" style="height: 33px;">
                    </div>
                    <div class="form-group col-sm-3">
                      <select class="selectproceso form-control text-uppercase" name="id_zona" id="id_zona" style="width: 100%;">
                          <!-- <option value="0"></option> -->
                          <option value="9999">TODAS LAS ZONAS</option>
                          <?php foreach ($zonas as $zona) { ?>
                            <option value="<?php echo $zona['id'] ?>"><?php echo utf8_encode($zona['descripcion']) ?></option> 
                          <?php } ?>
                      </select> 
                    </div>
                    <div class="col-sm-12">
                      <button class="btn btn-success btn-block" type="button" onclick="consultaResultados('frm_consulta_resultado', '<?php echo $_GET['id_usuario'] ?>', '<?php echo $_GET['id_perfil'] ?>', 'consulta_resultados_indicador', '../controlador/administracion.controlador.php');">Buscar <i class="fas fa-search"></i></button>
                      <div class="table-responsive mt-4">
                        <table class="table">
                          <thead>
                            <tr>
                              <th>Proceso</th>
                              <th>Periodo</th>
                              <th>Resultado</th>
                              <th>Usuario registra</th>
                              <th>Fecha registro</th>
                              <th>Estado</th>
                              <th>
                                Guardar
                              </th>
                            </tr>
                          </thead>
                          <tbody id="lista_resultados">
                          </tbody>
                        </table>
                      </div>
                    </div>

                  </div>  
                </div>
                <!-- /.card-body -->
                <div class="card-footer text-right">
                  <!-- <button class="btn btn-success" type="button" >Guardar <i class="far fa-save ml-3"></i></button> -->
                </div>
              </form>
              <!-- /.card-footer-->
            </div>
            <!-- /.card -->
          </div>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>