<?php
$page_title = 'Granjas Cerradas PSP';
require_once('../../includes/load.php');
// Checkin What level user has permission to view this page
page_require_level(5);
?>
<?php include_once('../../layouts/header.php'); ?>
<div class="row">
 <div class="col-md-12">
   <?php echo display_msg($msg); ?>
 </div>
<div class="col-md-16">
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
        <strong>
          <span class="glyphicon glyphicon-th-list"></span>
          <span>REPORTE GRANJAS CERRADAS PSP</span> 
        </strong>
    </div>
    <div class="col-12">          
            <div class="panel-body">
                <div class="col-md-2"></div>
            <div class="col-md-12">
            <div class="card-header">
                  <strong>
                     <span>GRANJAS CERRADAS PSP</span>
                  </strong> 
            </div>
                  <form class="form-inline" action="data/data_granjasoperacion.php" method="POST">
                    <div class="card-body">
                          <label class="from-addon">Seleccione los Campos:</label>
                        <div class="panel-heading clearfix "> 
                            <div class="form-group">
                                <div class="col-md-6">
                                    <div class="select-checkbox">
                                      <div class="select-dropdown">
                                        <div class="select-selected">AÑO</div>
                                            <div class="select-options">
                                              <div class="select-option select-all">
                                                <input type="checkbox" id="select-all-checkbox">
                                                <label for="select-all-checkbox">Selec. todo</label>
                                              </div>
                                              <?php 
                                                $year = date("Y");
                                                for ($i=2020; $i<=$year; $i++){
                                                    echo '<div class="select-option"><input type="checkbox" name="opciones[]" value="'.$i.'" id="'.$i.'"> '.$i.' </div>';                                                  
                                                }
                                                ?>
                                            </div>                                             
                                      </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-6">
                                    <div class="select-checkbox">
                                      <div class="select-dropdown">
                                        <div class="select-selected">MES</div>
                                        <div class="select-options">
                                          <div class="select-option select-all">
                                            <input type="checkbox" id="select-all-checkbox">
                                            <label for="select-all-checkbox">Selec. todo</label>
                                          </div>
                                            <?php 
                                              for ($i=1; $i<=12; $i++){
                                                $value = ($i < 10)?'0'.$i:$i;
                                                 switch ($value) {
                                                   case '01': $mes = 'ENERO';break;
                                                   case '02': $mes = 'FEBRERO';break;
                                                   case '03': $mes = 'MARZO';break;
                                                   case '04': $mes = 'ABRIL';break;
                                                   case '05': $mes = 'MAYO';break;
                                                   case '06': $mes = 'JUNIO';break;
                                                   case '07': $mes = 'JULIO';break;
                                                   case '08': $mes = 'AGOSTO';break;
                                                   case '09': $mes = 'SETIEMBRE';break;
                                                   case '10': $mes = 'OCTUBRE';break;
                                                   case '11': $mes = 'NOVIEMBRE';break;
                                                   case '12': $mes = 'DICIEMBRE';break;
                                                   default: $mes = 'Non'; break;
                                                 }
                                                  echo '<div class="select-option"><input type="checkbox" name="opciones1[]" value="'.$i.'" id="'.$mes.'"> '.$mes.' </div>';
                                              }
                                            ?>
                                        </div>
                                      </div>
                                    </div>
                                </div>
                            </div> 

                            
                            <div class="form-group">
                                <div class="col-md-6">
                                    <div class="select-checkbox">
                                      <div class="select-dropdown">
                                        <div class="select-selected">TIPO GRANJA</div>
                                            <div class="select-options">
                                              <div class="select-option select-all">
                                                <input type="checkbox" id="select-all-checkbox">
                                                <label for="select-all-checkbox">Selec. todo</label>
                                              </div>
                                              <div class="select-option">
                                                <input type="checkbox" name="opciones2[]" value="Mercado" id="Mercado"> Mercado <br>
                                              </div>
                                              <div class="select-option">
                                                <input type="checkbox" name="opciones2[]" value="Camal" id="Camal"> Camal <br>
                                              </div>
                                            </div>
                                      </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-6">
                                    <div class="select-checkbox">
                                      <div class="select-dropdown">
                                        <div class="select-selected">ZONA</div>
                                        <div class="select-options">
                                          <div class="select-option select-all">
                                            <input type="checkbox" id="select-all-checkbox">
                                            <label for="select-all-checkbox">Selec. todo</label>
                                          </div>
                                          <?php
                                          $consulta = $db->query("SELECT ZNombre FROM zona");
                                          while ($Nombre = $db->fetch_array($consulta)) {
                                           ?>
                                              <?php 
                                                  echo '<div class="select-option"><input type="checkbox" name="opciones3[]" value="'.$Nombre['ZNombre'].'" id="'.$Nombre['ZNombre'].'"> '.$Nombre['ZNombre'].' </div>';
                                              ?>
                                          <?php
                                          }
                                          ?>
                                        </div>
                                      </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-md-6">
                                      <button type="submit" class="btn btn-primary" id="report" class="form-control">Reporte</button>
                                </div>
                            </div>    
                        </div>
                  </form>
            </div>
        </div>
    </div>
  </div>
</div>
</div>
<?php include_once('../../layouts/footer.php'); ?>

