<?php
date_default_timezone_set('America/Lima');
session_start();

$y=date('Y');
$m=date('m');
$d=date('d');

$fec1="$d-$m-$y";
$fec2="$d-$m-$y";

$y1 = $y +3;

require_once("../formatos/formato.php");

?>
<section class="content">
	<div class="container-fluid">
	<div class="row">
	    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		    <div class="card">
		        <div class="card-header">
    		<div class="row">
						
						<form name="for_fil_pro" id="for_fil_pro" target="_blank" action="compra_reporte.php" method="post">
												<?php //echo '--'.$m;?>
							<div class="row">
							
							<div class="col-lg-2 col-sm-2 col-xs-6">
													<label for="cmb_fil_per_mes1">Mes:</label>
												
													<select name="cmb_fil_per_mes1" id="cmb_fil_per_mes1" class="form-control">													
														<option value="01" <?php if($m=='01') echo 'selected';?> >Enero</option>
													    <option value="02" <?php if($m=='02') echo 'selected';?> >Febrero</option>
														<option value="03" <?php if($m=='03') echo 'selected';?> >Marzo</option>
														<option value="04" <?php if($m=='04') echo 'selected';?> >Abril</option>
													    <option value="05" <?php if($m=='05') echo 'selected';?> >Mayo</option>
														<option value="06" <?php if($m=='06') echo 'selected';?> >Junio</option>
														<option value="07" <?php if($m=='07') echo 'selected';?> >Julio</option>
													    <option value="08" <?php if($m=='08') echo 'selected';?> >Agosto</option>
														<option value="09" <?php if($m=='09') echo 'selected';?> >Septiembre</option>
														<option value="10" <?php if($m=='10') echo 'selected';?> >Octubre</option>
													    <option value="11" <?php if($m=='11') echo 'selected';?> >Noviembre</option>
														<option value="12" <?php if($m=='12') echo 'selected';?> >Diciembre</option>
																
													</select>									
							</div>
												
												
							<div class="col-lg-2 col-sm-2 col-xs-6">
													<label for="cmb_fil_per_anio1">Año:</label>
												
													<select name="cmb_fil_per_anio1" id="cmb_fil_per_anio1" class="form-control">
													<?php  
													for($i=2017;$i<= $y1 ;$i++){
														
														?>
														<option value="<?php echo $i;?>"  <?php if($i==$y) echo ''; ?> ><?php echo $i;?></option>
														<?php
													}
													?>
													</select>
												
							</div>					
												
												
							<div class="col-lg-2 col-sm-2 col-xs-6">
													<label for="cmb_fil_per_mes2">Mes:</label>
												
													<select name="cmb_fil_per_mes2" id="cmb_fil_per_mes2" class="form-control">													
														<option value="01" <?php if($m=='01') echo 'selected';?> >Enero</option>
													    <option value="02" <?php if($m=='02') echo 'selected';?> >Febrero</option>
														<option value="03" <?php if($m=='03') echo 'selected';?> >Marzo</option>
														<option value="04" <?php if($m=='04') echo 'selected';?> >Abril</option>
													    <option value="05" <?php if($m=='05') echo 'selected';?> >Mayo</option>
														<option value="06" <?php if($m=='06') echo 'selected';?> >Junio</option>
														<option value="07" <?php if($m=='07') echo 'selected';?> >Julio</option>
													    <option value="08" <?php if($m=='08') echo 'selected';?> >Agosto</option>
														<option value="09" <?php if($m=='09') echo 'selected';?> >Septiembre</option>
														<option value="10" <?php if($m=='10') echo 'selected';?> >Octubre</option>
													    <option value="11" <?php if($m=='11') echo 'selected';?> >Noviembre</option>
														<option value="12" <?php if($m=='12') echo 'selected';?> >Diciembre</option>
																
													</select>
																									
							</div>
												
												
							<div class="col-lg-2 col-sm-2 col-xs-6">
													<label for="cmb_fil_per_anio2">Año:</label>
												
													<select name="cmb_fil_per_anio2" id="cmb_fil_per_anio2" class="form-control">
													<?php  
													for($i=2017;$i<= $y1 ;$i++){
														
														?>
														<option value="<?php echo $i;?>"  <?php if($i==$y) echo ''; ?> ><?php echo $i;?></option>
														<?php
													}
													?>
													</select>
												
							</div>					
												
												
												
							
							<div class="col-lg-2 col-xs-12">
								<label for="txt_fil_lab">Marca:</label>
								<input type="text" id="txt_fil_lab" name="txt_fil_lab" autocomplete="off" class="form-control"  /> 
							</div>
							
							<div style="display: inline-block; white-space: nowrap;padding-top: 30px;" class="col-lg-2 col-sm-3 col-xs-6">		
								<span onClick="productovencimento_cst_tabla()" style="cursor:pointer" id="btn_filtrar"  class="btn btn-primary "><i class="fas fa-search"></i></span>
								<span onClick="productovencimento_cst_filtro()" style="cursor:pointer" id="btn_resfil"  class="btn btn-default ">Restablecer</span>
							</div>   
							</div>   
						</form>	
						
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
</section>

<script type="text/javascript">

	
	$(function(){

		
		$("#txt_fil_lab").keydown(function(e){
			if (e.which == 13){
				
			if($("#txt_fil_lab").val()==""){
			 productovencimento_cst_tabla();
			}
			
			return false;
			}
		});
		
	});	
</script> 