<?php
  $page_title = 'Agregar Recurso';
  require_once('../../includes/load.php');
  // Checkin What level user has permission to view this page
  page_require_level(5);
?>
<?php
  $programa = find_by_id('programa',(int)$_GET['id']);
  if(!$programa){
  $session->msg("d","Error: No se encontr¨® id del programa.");
  redirect('programa.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-plus"></span>
            <span>Registar Recurso</span>
         </strong>
        </div> 
 <!-- FORMULARIO PARA GUARDAR EL PROGRAMA-->
        <form  enctype="multipart/form-data" autocomplete="off" id="form" onSubmit="validar()">
          <div class="panel-body">
            <div class="col-md-12">
        		<div class="card-header">
                  <strong>
                     <span>Recursos</span>
                  </strong> 
                </div>

                 <div class="card-body">
		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="programa" class="control-label">Programa:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" name="programa" id="programa" class="form-control" value="<?php echo (int)$programa['id'];?>" readonly>
		                                                                        
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="operario" class="control-label">Operario:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="operario" name="operario" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="trac_110" class="control-label">Tractor 110 Hp:</label>
		                      <div class="input-group">  
		                      	<span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>
		                              <input type="number" id="trac_110" name="trac_110" class="form-control" value="0">                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="rufa_inicial" class="control-label">Rufa Inicial:</label>
		                      <div class="input-group">
		                         <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="rufa_inicial" name="rufa_inicial" class="form-control" value="0">                        
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="rebobinadora" class="control-label">Rebobinadora:</label>
		                      <div class="input-group">   
		                              <input type="number" id="rebobinadora" name="rebobinadora" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="caleadora" class="control-label">Caleadora:</label>
		                      <div class="input-group">   
		                              <input type="number" id="caleadora" name="caleadora" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="actividad" class="control-label">Actividad:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <select id="actividad" name="actividad" class="form-control">
		                                <?php   
																		  $consulta = $db->query("SELECT * FROM `actividad`");
																		    while ($row = $db->fetch_assoc($consulta)) {   
																		      $id = $row['IdActividad']; 
																		      $ANombre = $row['ANombre'];    
																		      echo "<option value='$id'>$ANombre</option>";
																		    }
																		?>
		                              </select> 
		                                                                        
		                        </div>               
		                    </div>		            
		                    <div class="col-md-2">
		                      <label for="tractorista" class="control-label">Tractorista:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="tractorista" name="tractorista" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="minitractor" class="control-label">Minitractor:</label>
		                      <div class="input-group">   
		                              <input type="number" id="minitractor" name="minitractor" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="compostera" class="control-label">Composteadora:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span> 
		                              <input type="number" id="compostera" name="compostera" class="form-control" value="0">                           
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="motofumigadora" class="control-label">Motofumigadora:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span> 
		                              <input type="number" id="motofumigadora" name="motofumigadora" class="form-control" value="0">                           
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="ru_tumbado" class="control-label">Rufa Tumbado:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="ru_tumbado" name="ru_tumbado" class="form-control" value="0">                          
		                        </div>               
		                    </div>
		                </div>
		              </div>


		              <div class="form-group">
		                <div class="row">
		                  	<div class="col-md-2">
		                      <label for="fecha" class="control-label">Fecha:</label>
		                      <div class="input-group">   
		                              <input type="date" id="fecha" name="fecha" class="form-control" required>                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="tractor_75" class="control-label">Tractor 75 Hp:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                             <input type="number" id="tractor_75" name="tractor_75" class="form-control" value="0">                                         
		                        </div>               
		                    </div>		                    
		                    <div class="col-md-2">
		                      <label for="carreta" class="control-label">Carreta:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span> 
		                              <input type="number" id="carreta" name="carreta" class="form-control" value="0">                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="trituradora" class="control-label">Trituradora:</label>
		                      <div class="input-group">   
		                              <input type="number" id="trituradora" name="trituradora" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="clasificador" class="control-label">Clasificador:</label>
		                      <div class="input-group">   
		                              <input type="number" id="clasificador" name="clasificador" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="rot_final" class="control-label">Roturado Final:</label>
		                      <div class="input-group">  
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span> 
		                              <input type="number" id="rot_final" name="rot_final" class="form-control" value="0">                           
		                        </div>               
		                    </div>		                    
		                </div>
		              </div>
		              <div class="form-group">
		                <div class="row">		                 	
		                    <div class="col-md-2">
		                      <label for="Observaciones" class="control-label">Observaciones:</label>
		                      <div class="input-group">  
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>   

		                              <input type="text" id="Observaciones" name="Observaciones" class="form-control">
		                        </div>
		                    </div>
		                    <div class="col-md-2">
		                      <label for="trac_95" class="control-label">Tractor 95 Hp:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="trac_95" name="trac_95" class="form-control" value="0">                           
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="roturado" class="control-label">Roturado:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="number" id="roturado" name="roturado" class="form-control" value="0">                             
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="lamina" class="control-label">Lamina bordeadora:</label>
		                      <div class="input-group">   
		                              <input type="number" id="lamina" name="lamina" class="form-control" value="0">                                            
		                        </div>               
		                    </div>
		                    <div class="col-md-2">
		                      <label for="aireador" class="control-label">Aireador:</label>
		                      <div class="input-group">
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>   

		                              <input type="number" id="aireador" name="aireador" class="form-control" value="0">                             
		                        </div>               
		                    </div>
		                    
		                </div>
		              </div>
			               <div class="text-center">
	                     		 <button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-floppy-disk"></i>Guardar</button>
	                     		 <a href="listado_recursos.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'); ?>
<script type="text/javascript" src="js/recurso.js"></script>


