<?php
session_start();
date_default_timezone_set('America/Lima');
//require_once ("../formatos/formatos.php");
	$y=date('Y');
	$m=date('m');
	$d=date('d');
	
	$fec1="$d-$m-$y";
	//$d=ultimoDia($m,$y);
	$fec2="$d-$m-$y";
	//$fec2="$d-$m-$y";
	
	$punven_id=$_SESSION['puntoventa_id'];
	$id_usuario = $_SESSION['usuariogrupo_id'];
?>
<script type="text/javascript">

function cmb_fil_mar_id()
	{	
		$.ajax({
			type: "POST",
			url: "../marca/cmb_mar_id.php",
			async:true,
			dataType: "html",                      
			data: ({
			//cat_id: "<?php //echo $cat_id?>"
		}),
			beforeSend: function() {
				$('#cmb_fil_mar_id').html('<option value="">Cargando...</option>');
			},
			success: function(html){
				$('#cmb_fil_mar_id').html(html);
			}
		});
	}

function cmb_fil_punven_id(idf)
{	
	$.ajax({
		type: "POST",
		url: "../puntoventa/cmb_punven_id.php",
		async:false,
		dataType: "html",                      
		data: ({
			punven_id: idf
		}),
		beforeSend: function() {
			$('#cmb_fil_punven_id').html('<option value="">Cargando...</option>');
        },
		success: function(html){
			$('#cmb_fil_punven_id').html(html);
		},
		complete: function(){
			//venta_tabla();
		}
	});
}

$(function() {
	
	cmb_fil_punven_id(<?php echo $punven_id?>);
	cmb_fil_mar_id();
	
$('#txt_fil_rep_fec1, #txt_fil_rep_fec2').datepicker({
			format: 'dd-mm-yyyy',
			autoclose:true
		}).on('changeDate', function(e){
			reporteDigemid_tabla();
		}); 
	
	
	$('#cmb_fil_punven_id, #cmb_fil_mar_id').change(function(e) {
        reporteDigemid_tabla();
    });
	
});
</script>


<section class="content" id="filter" style="min-height:0px;padding-bottom:0px;margin-bottom:-30px;">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-body">
					<div class="row">
					
<form name="for_fil_rep" id="for_fil_rep" target="_blank" action="" method="post">
<input name="hdd_modo" id="hdd_modo" type="hidden" value="../venta_cst/venta_tabla.php">

	
	<div class="col-lg-3 col-xs-3">
	<label for="cmb_fil_mar_id">Marca:</label>
	<select name="cmb_fil_mar_id" id="cmb_fil_mar_id" class="form-control  input-sm"></select>
	</div>
	
	
	<div class="col-lg-2 col-xs-2">
    <label for="txt_fil_rep_fec1">Fecha 1:</label>
    <input name="txt_fil_rep_fec1" type="text" class="form-control" id="txt_fil_rep_fec1" value="<?php echo $fec1?>" >
	</div>
	<div class="col-lg-2 col-xs-2">
	<label for="txt_fil_rep_fec2">Fecha 2:</label>
    <input name="txt_fil_rep_fec2" type="text" class="form-control" id="txt_fil_rep_fec2" value="<?php echo $fec2?>">
    </div>
	  
	<div class="col-lg-3 col-xs-3">
    <label for="cmb_fil_punven_id">Punto Venta:</label><br />
    <select name="cmb_fil_punven_id" class="form-control input-sm" id="cmb_fil_punven_id">
    </select>
	</div>
	
		
	<div class="col-lg-2 col-xs-2">
	<br />	
  	<span onClick="reporteDigemid_tabla()" class=" btn btn-primary glyphicon glyphicon-search"></span>
    <span onClick="reporteDigemid_filtro()" class="btn btn-default">Restablecer</span>
	</div>
		
</form>
	</div>
				</div>
			</div>
		</div>
	</div>
</section>