<?php
  $page_title = 'Visualizar Maquinaria';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(4);
?>
<?php
  $maquinaria = find_by_id('activo',(int)$_GET['id']);
  if(!$maquinaria){
  $session->msg("d","Error: No se encontró id del maquinaria.");
  redirect('maquinaria.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> Produccion</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> Visualizar</span>
                  </strong> 
                </div>
                 <div class="card-body">
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="activo" class="control-label">Activo:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo (int)$maquinaria['id'];?></span>                                            
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="nombre" class="control-label">Nombre:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['NombreActivo']); ?></span>                                               
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="cod_patrimonial" class="control-label">Codigo:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['CodigoPatrimonialActivo']); ?></span>                                              
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="marca" class="control-label">Marca:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['MarcaActivo']); ?></span>                                 
		                        </div>               
		                    </div>		                    		     
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="modelo" class="control-label">Modelo:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['ModeloActivo']); ?></span>                                
		                        </div>               
		                    </div>
		                	<div class="col-md-3">
		                      <label for="placa" class="control-label">Placa:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['PlacaActivo']); ?></span>                                                                          
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="color" class="control-label">Color:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['ColorActivo']); ?></span>                                          
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="potencia" class="control-label">Potencia:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['PotenciaActivo']); ?></span>                                 
		                        </div>               
		                    </div>
		                                
		                </div>
		              </div>


		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="cilindro" class="control-label">Clindro:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['CilindroActivo']); ?></span>                                
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="traccion" class="control-label">Traccion:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                             <span class="form-control"><?php echo remove_junk($maquinaria['TraccionActivo']); ?></span>    		                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="sal_hidraulica" class="control-label">S.Hidraulica:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                             <span class="form-control"><?php echo remove_junk($maquinaria['SalidaHidraulicaActivo']); ?></span>                                                
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="cap_levante" class="control-label">C. Levante:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['CapacidadLevanteActivo']); ?></span>                                
		                        </div>               
		                    </div>		                			                    
		                </div>
		              </div>
              
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="cap_freno" class="control-label">C.Freno:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['CapacidadFrenoActivo']); ?></span>                                
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="dim_llanta" class="control-label">D.Llanta:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['DimencionLlantaActivo']); ?></span>                                 
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="peso" class="control-label">Peso:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['PesoActivo']); ?></span>                                
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="tamaño" class="control-label">Tamaño:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['TamañoActivo']); ?></span>     	                                                                        
		                        </div>               
		                    </div>		                	        	                   
		                </div>
		               </div>


		               <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="accesorio" class="control-label">Accesorios:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['AccesoriosActivo']); ?></span>    	                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="anio_produccion" class="control-label">A.Produccion:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['AñoProduccionActivo']); ?></span>                                          
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="anio_compra" class="control-label">A.Compra:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['AñoCompraActivo']); ?></span>                                  
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="pre_compra" class="control-label">P.Compra:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['PrecioCompraActivo']); ?></span>                                
		                        </div>               
		                    </div>		                	
		                </div>
		              </div>

		              <div class="form-group">
		                <div class="row">
		                    <div class="col-md-3">
		                      <label for="combustible" class="control-label">Combustible:</label>
		                      <div class="input-group">   
		                              <select id="combustible" name="combustible" class="form-control" disabled>
		                                <?php
																	        $consulta = $db->query("SELECT * FROM combustible");
																	        $idCom =$maquinaria['IdCombustible'];
																	        while ($Combustible = $db->fetch_array($consulta)) {
																	        $def='';
																	        if($Combustible['IdCombustible']==$idCom){
																	            $def='selected';
																	        }
																	    ?>
																				    <option value="<?php echo $Combustible['IdCombustible']?>" <?php echo $def?> ><?php echo $Combustible['NombreCombustible'] ?></option>
																				    <?php
																	        }
																	    ?>
		                              </select>                               
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="responsable" class="control-label">Responsable:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>   
		                              <select id="responsable" name="responsable" class="form-control" disabled>
		                                <?php
																	        $consulta = $db->query("SELECT * FROM responsableactivo");
																	        $idResposable =$maquinaria['IdResponsableActivo'];
																	        while ($Responsable = $db->fetch_array($consulta)) {
																	        $def='';
																	        if($Responsable['id']==$idResposable){
																	            $def='selected';
																	        }
																	    ?>
																				    <option value="<?php echo $Responsable['id']?>" <?php echo $def?> ><?php echo $Responsable['NombreResponsableActivo'].' '.$Responsable['ApellidoResponsableActivo'] ?></option>
																				    <?php
																	        }
																	    ?>
		                              </select>                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="t_activo" class="control-label">T.Activo:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <select id="t_activo" name="t_activo" class="form-control" disabled>
		                                <?php
																        $consulta = $db->query("SELECT * FROM tipoactivo");
																        $idt_com =$maquinaria['IdTipoActivo'];
																        while ($T_Activo = $db->fetch_array($consulta)) {
																        $def='';
																        if($T_Activo['IdTipoActivo']==$idt_com){
																            $def='selected';
																        }
																    ?>
																			    <option value="<?php echo $T_Activo['IdTipoActivo']?>" <?php echo $def?> ><?php echo $T_Activo['NombreTipoActivo']?></option>
																			    <?php
																        }
																    ?>
		                              </select>                                                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="observacion" class="control-label">Observaciones:</label>
		                      <div class="input-group">  

		                              <span class="form-control"><?php echo remove_junk($maquinaria['ObservacionesActivo']); ?></span>                                 
		                        </div>               
		                    </div>                	
		                </div>
		              </div>
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="trasmision" class="control-label">Tansmision:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['TrasmisionActivoVehiculo']); ?></span>    	                                                                        
		                        </div>               
		                    </div>
		              		<div class="col-md-3">
		                      <label for="motor" class="control-label">Motor:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['SerieMotorActivoVehiculo']); ?></span>                                          
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="chasis" class="control-label">Chasis:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['SerieChasisMaquinaria']); ?></span>                                           
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="costo" class="control-label">Costo x Hr:</label>
		                      <div class="input-group">   

		                              <span class="form-control"><?php echo remove_junk($maquinaria['CostoHoraActivo']);?></span>                                 
		                        </div>               
		                    </div>                     
		              	</div>
		              </div>
		              <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="voltaje" class="control-label">Voltaje:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo remove_junk($maquinaria['VoltajeActivoEquipo']); ?></span>                                 
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="corriente" class="control-label">Corriente:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['CorrienteActivoEquipo']); ?></span>    	                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="generador" class="control-label">Generador:</label>
		                      <div class="input-group">  
		                              <span class="form-control"><?php echo remove_junk($maquinaria['GeneradorActivoEquipo']); ?></span>                                
		                        </div>               
		                    </div>  
		                    <div class="col-md-3">
		                      <label for="estado" class="control-label">Estado:</label>
		                      <div class="input-group">   
		                              <select id="estado" name="estado" class="form-control" disabled> 
		                               <option value="Operativo" <?php if ($maquinaria['EstadoActivoMI']=='Operativo'){echo 'selected';} ?>>Operativo</option>
					                         <option value="Inoperativo" <?php if ($maquinaria['EstadoActivoMI']=='Inoperativo'){echo 'selected';} ?>>Inoperativo</option>
					                         <option value="Baja" <?php if ($maquinaria['EstadoActivoMI']=='Baja'){echo 'selected';} ?>>Baja</option>
		                              </select>                             
		                        </div>               
		                    </div>       
		              	</div>
		              </div>
	                   <div class="text-center">
	                     		  <a href="listado_maquinaria.php" class="btn btn-primary"><i class="glyphicon glyphicon-th-list"></i>Listado</a>
                     </div>
          			  </div>
	          	    </div>
	             </div>
	           </div>   
            </div>
          </div>           
        </form>
     </div>
    </div>
  </div>
</div>
</div>
<?php include_once('../../layouts/footer.php'); ?>



