<?php
  $page_title = 'Agregar Proyeccion';
  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>
  <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>Proyeccion</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>Proyeccion</span>
                  </strong> 
                </div>
                 <div class="card-body">
		              <div class="form-group">
		                <div class="row">		                  	
		                    <div class="col-md-3">
		                      <label for="proyectado" class="control-label">Proyectado:</label>
		                      <div class="input-group">   
		                              <select id="proyectado" name="proyectado" class="form-control">
		                              	<option>Seleccionar</option>
		                                <?php   
																			  $consulta = $db->query("SELECT * FROM programaabastecimiento");
																			    while ($row = $db->fetch_assoc($consulta)) {   
																			      $id = $row['id'];  
																			      $IdTipoCombustible = $row['IdTipoCombustible'];   
																			      echo "<option value='$id'>$id</option>";
																			    }
																			?>
		                              </select> 
		                              <input type="hidden" name="tipocombustible" id="tipocombustible">                           
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="granja" class="control-label">Granja:</label>
		                      <div class="input-group">  
		                             <input type="hidden" id="idgranja" name="idgranja"> 
		                             <input type="text" class="form-control" id="granja" name="granja" readonly>                             
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="t_granja" class="control-label">Tipo Granja:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <input type="text" class="form-control" id="t_granja" name="t_granja" readonly>                                            
		                      </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="f_inicio" class="control-label">Fecha Inicio:</label>
		                      <div class="input-group">   
		                              <input type="date" class="form-control" id="f_inicio" name="f_inicio" required>                            
		                        </div>               
		                    </div>
		                    
		                </div>
		               </div>

		               <div class="form-group">
		                <div class="row">
		                	<div class="col-md-3">
		                      <label for="f_final" class="control-label">Fecha Final:</label>
		                      <div class="input-group">   
		                              <input type="date" class="form-control" id="f_final" name="f_final" required>                            
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="galones" class="control-label">Galones Ingresados:</label>
		                      <div class="input-group">   
	                              <input type="text" class="form-control" id="galones" name="galones" required>                             
		                        </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">
		                                <?php   
										  $consulta = $db->query("SELECT * FROM responsableabastecimiento");
										    while ($row = $db->fetch_assoc($consulta)) {   
										      $id = $row['IdResponsableAbastecimiento']; 
										      $Responsable = $row['NombreResponsableAbastecimiento'];    
										      echo "<option value='$id'>$Responsable</option>";
										    }
										?>
		                              </select>                                       
		                        </div>               
		                    </div>
		                    <div class="col-md-3">
		                      <label for="placa" class="control-label">Placa Vehiculo:</label>
		                      <div class="input-group"> 
		                        <span class="input-group-addon">
		                          <i class="fi fi-sr-interlining"></i>
		                        </span>  
		                              <select id="placa" name="placa" class="form-control">
		                                <?php   
										  $consulta = $db->query("SELECT * FROM activo");
										    while ($row = $db->fetch_assoc($consulta)) {   
										      $id = $row['id']; 
										      $activo = $row['PlacaActivo'];    
										      echo "<option value='$id'>$activo</option>";
										    }
										?>
		                              </select>                                       
		                        </div>               
		                    </div>
		                </div>
		              </div>
                     <div class="text-center">
                   		 <button type="submit" class="btn btn-success" id="button" name="button" disabled><i class="glyphicon glyphicon-floppy-disk"></i>Guardar</button>
                   		  <a href="listado_abastecimiento.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/abastecimiento.js"></script>


