<?php
  $page_title = 'Visualizar mecanico';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(4);
?>
<?php
  $mecanico = find_by_id('mecanicomantenimiento',(int)$_GET['id']);
  if(!$mecanico){
  $session->msg("d","Error: No se encontró id del mecanico.");
  redirect('../lista_mecanico/listado_mecanico.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</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> Mecanico</span>
                  </strong> 
                </div>
                 <div class="card-body">
                 	<div class="form-group">
		              <div class="row">
		                    <div class="col-md-3">
		                      <label for="mecanico" class="control-label">Mecanico:</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)$mecanico['id'];?></span>                                              
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="nombre" class="control-label">Nombres:</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($mecanico['NombreMecanicoMantenimiento']); ?></span>                                               
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="apellido" class="control-label">Apellidos:</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($mecanico['ApellidoMecanicoMantenimiento']); ?></span>                                              
		                      </div>               
		                    </div>
                            <div class="col-md-3">
		                      <label for="dni" class="control-label">DNI:</label>
		                      <div class="input-group">   
		                              <span class="form-control"><?php echo $mecanico['DNIMecanicoMantenimiento'];?></span>                             
		                        </div>               
		                    </div>                    		                                    	  
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                	
		                    <div class="col-md-3">
		                      <label for="direccion" class="control-label">Direccion:</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($mecanico['DireccionMencanicoMantenimiento']); ?></span>  	                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="costo" class="control-label">Costo:</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($mecanico['CostoMecanicoMantenimiento']); ?></span>                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="precio" class="control-label">Area:</label>
		                      <div class="input-group">    
		                              <select id="area" name="area" class="form-control" disabled>
		                                <?php   
											  $consulta = $db->query("SELECT * FROM areagerenciaoperaciones");
											  $idCat =$mecanico['IdAreaGerenciaOperaciones'];
										        while ($Categoria = $db->fetch_array($consulta)) {
										        $def='';
										        if($Categoria['IdAreaGerenciaOperaciones']==$idCat){
										            $def='selected';
										        }
										    ?>
												    <option value="<?php echo $Categoria['IdAreaGerenciaOperaciones']?>" <?php echo $def?> ><?php echo $Categoria['NombreAreaGerenciaOperaciones'] ?></option>
												    <?php
									        }
									    ?>   
		                              </select>                           
		                        </div>               
		                    </div>
                            <div class="col-md-3">
		                      <label for="telefono" class="control-label">Telefono:</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($mecanico['TelefonoMecanicoMantenimiento']);?></span>  	                                                                        
		                        </div>               
		                    </div>	                          	
		                </div>
		              </div>
		              <div class="form-group">
		                <div class="row">
		                	<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="Activo" <?php if ($mecanico['EstadoMantenimientoInterno']=='Activo'){echo 'selected';} ?>>Activo</option>
					                				<option value="Inactivo" <?php if ($mecanico['EstadoMantenimientoInterno']=='Inactivo'){echo 'selected';} ?>>Inactivo</option>
	                              </select>                             
		                        </div>               
		                    </div> 
		                </div>
		              </div>
	                   <div class="text-center">
	                     <a href="listado_mecanico.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'); ?>



