<?php
  $page_title = 'Ver Operacion';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(5);
?>
<?php
  $operacion = find_by_id('operacion',(int)$_GET['id']);
  //variables para los select
  $operacionid = $operacion['id'];
  $programaid = $operacion['IdPrograma'];

  if(!$operacion){
  $session->msg("d","Error: No se encontró id del operacion.");
  redirect('operacion.php');  
}
?>
<?php include_once('../../layouts/header.php'); ?>
<div class="row">
  <div class="col-md-12">
    <?php echo display_msg($msg); ?>
  </div>
</div>
  <div class="row">
  <div class="col-md-16">
      <div class="panel panel-default">
        <div class="panel-heading">
          <strong>
            <span class="glyphicon glyphicon-info-sign"></span>
            <span>Visualizar Operacion</span>
         </strong>
        </div> 
 <!-- FORMULARIO PARA GUARDAR EL PROGRAMA-->
        <form  enctype="multipart/form-data" autocomplete="off" id="form">
          <div class="panel-body">
            <div class="col-md-12">
        		<div class="card-header">
                  <strong>
                     <span>Programa</span>
                  </strong> 
                </div>
                 <div class="card-body">
                 	<div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="galpones" class="control-label">Programa:</label>
		                      <div class="input-group">   
		                              <span name="programa" id="programa" class="form-control" ><?php echo (int)$operacion['IdPrograma'];?></span>		                                                                        
		                      </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="operacion" class="control-label">Operación:</label>
		                      <div class="input-group"> 
		                              <span name="operacion" id="operacion" class="form-control"><?php echo (int)$operacion['id'];?></span>		                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="campana" class="control-label">Campaña:</label>
		                      <div class="input-group">  
									 	  <?php
									        $consulta = $db->query("SELECT * FROM programa WHERE id = $programaid");
									        $campana = $db->fetch_array($consulta)  
									       ?>      
									       <span id="campana" name="campana" class="form-control" ><?php echo remove_junk($campana['Campana']); ?></span>                                   
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="reuso" class="control-label">Reuso:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($operacion['Reuso']); ?></span>                                      
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="servicio" class="control-label">Servicio:</label>
		                      <div class="input-group"> 	                               
		                              <?php
		                                    $consultaid = $db->query("SELECT * FROM programa WHERE id = $programaid");
									        $idTS = $db->fetch_array($consultaid);

									        $consulta = $db->query("SELECT * FROM tiposervicio WHERE IdTipoServicio = {$idTS['IdTipoServicio']}");
									        $servicio = $db->fetch_array($consulta);  
									   ?>   
									       <span class="form-control"><?php echo remove_junk($servicio['TSNombre']); ?></span> 
											                                       
		                        </div>               
		                    </div>
		                </div>
		               </div>
		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="granja" class="control-label">Granja:</label>
		                      <div class="input-group">  
										<?php
									        $consultaId = $db->query("SELECT * FROM programa WHERE id = $programaid");
									        $IdGranja = $db->fetch_array($consultaId);
									        $consulta = $db->query("SELECT * FROM granja WHERE IdGranja={$IdGranja['IdGranja']}");
									        $area = $db->fetch_array($consulta) 
									   ?>
										<span class="form-control" ><?php echo remove_junk($area['GNombre']); ?></span>
															                                                                       
		                        </div>                
		                    </div>
		                    <div class="col-md-2">
		                      <label for="ult_venta" class="control-label">Ultima Venta:</label>
		                      <div class="input-group">    
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaUltimaVenta']); ?></span>                          
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="ini_limpieza" class="control-label">Inicio Limpieza:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaInicioLimpieza']); ?></span>                         
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="ini_recepcion" class="control-label">Inicio Recepción:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaInicioRecepcion']); ?></span>                             
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="ter_recepcion" class="control-label">Termino de Recepción:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaTerminoRecepcion']); ?></span>                             
		                        </div>               
		                    </div>	                    
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                  	 <div class="col-md-2">
			                      <label for="ini_compost" class="control-label">Inicio Compost:</label>
			                      <div class="input-group">   
			                           <span class="form-control"><?php echo remove_junk($operacion['FechaInicioCompost']); ?></span>                             
			                      </div>               
			                 </div>
		                     <div class="col-md-2">
		                      <label for="ter_compost" class="control-label">Termino compost:</label>
		                           <div class="input-group">   
		                                 <span class="form-control"><?php echo remove_junk($operacion['FechaTerminoCompost']); ?></span>                             
		                            </div>               
		                     </div>
		                     <div class="col-md-2">
			                      <label for="ini_tumbado" class="control-label">Inicio Tumbado:</label>
			                      <div class="input-group">   
			                              <span class="form-control"><?php echo remove_junk($operacion['FechaInicioTumbadoCompost']); ?></span>                              
			                        </div>               
		                    </div>
		                    <div class="col-md-2">
			                      <label for="ter_tumbado" class="control-label">Termino Tumbado:</label>
			                      <div class="input-group">   
			                              <span class="form-control"><?php echo remove_junk($operacion['FechaTerminoTumbadoCompost']); ?></span>                              
			                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="red_dragon" class="control-label">Red Dragon:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaRedDragon']); ?></span>                             
		                        </div>               
		                    </div>		                    
		                </div>
		              </div>


		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="ent_granja" class="control-label">Entrega Granja:</label>
		                      <div class="input-group">    
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaEntregaGranja']); ?></span>                           
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="pollo" class="control-label">Pollo BB:</label>
		                      <div class="input-group">    
		                              <span class="form-control"><?php echo remove_junk($operacion['FechaIngresoPollosBB']); ?></span>                                            
		                        </div>
		                    </div>               		             		                    
		                </div>
		              </div>	            
			               <div class="text-center">
	                     		 <a href="listado_operacion.php" class="btn btn-primary"><i class="glyphicon glyphicon-th-list"></i>Listado</a>
	                     		 <a href="../maquinaria/maquinaria.php" class="btn btn-primary"><i class="glyphicon glyphicon-th-list"></i>Produccion MI</a>
	                       </div>
          			  </div>
	          	    </div>
	             </div>
	           </div>   
            </div>
          </div>           
        </form>
     </div>
    </div>
  </div>
</div>
</div>

<?php include_once('../../layouts/footer.php'); ?>



