<script type="text/javascript">

	$('#btn_filtrar').button({

		icons: {primary: "ui-icon-search"},

		text: false

	});

	$('#btn_resfil').button({

		icons: {primary: "ui-icon-arrowrefresh-1-w"},

		text: false

	});

	

	

	function cmb_fil_cat_id()

	{	

		$.ajax({

			type: "POST",

			url: "../categoria/cmb_cat_id.php",

			async:true,

			dataType: "html",                      

			data: ({

			//cat_id: "<?php //echo $cat_id?>"

		}),

			beforeSend: function() {

				$('#cmb_fil_cat_id').html('<option value="">Cargando...</option>');

			},

			success: function(html){

				$('#cmb_fil_cat_id').html(html);

			}

		});

	}

	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_alm_id()

	{	

		$.ajax({

			type: "POST",

			url: "../almacen/cmb_alm_id.php",

			async:false,

			dataType: "html",                      

			data: ({

				alm_id: '<?php echo $alm_id?>'

			}),

			beforeSend: function() {

			//$('#cmb_fil_pro_alm').html('<option value="">Cargando...</option>');

		},

		success: function(html){

			$('#cmb_fil_alm_id').html(html);

			$('#cmb_fil_alm_id').val(1);

		},

		complete: function(){

		}

	});

	}

	$(function() {

		cmb_fil_cat_id();

		cmb_fil_mar_id();

		cmb_fil_alm_id();

		stockcheck_tabla();

		$("#txt_fil_pro_codbar").focus();

		$( "#txt_fil_pro_nom" ).autocomplete({

			minLength: 1,

			source: "../producto/producto_complete_nom.php",

			select: function() {

				stockcheck_tabla();

			}

		});

		$( "#txt_fil_pro_nom" ).keydown(function(e){

			if(e.which==13)

			{

				stockcheck_tabla();

				e.preventDefault();

			}

		});



		$( "#chk_fil_stockvacio" ).click(function(event) {

			stockcheck_tabla();

		});





		

		$("#txt_fil_pro_codbar").keydown(function(e)

		{

			if(e.which==13)

			{

				$("#txt_fil_pro_nom").val('');				

				stockcheck_tabla();

				$(this).val('');

			//$(this).focus();

			e.preventDefault();

		}

	});



		$('#cmb_fil_cat_id, #cmb_fil_mar_id,#cmb_fil_alm_id, #cmb_fil_condicion').change(function(){

			stockcheck_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 id="for_fil_pro" method="POST">

								

                             <div class="col-lg-2 col-xs-6">

								<label>Código de Barras:</label>

								<input name="txt_fil_pro_codbar" type="text" id="txt_fil_pro_codbar" class="form-control input-sm">

						     </div>



                             <div class="col-lg-2 col-xs-6">

								<label>Nombre:</label>

								<input name="txt_fil_pro_nom" type="text" id="txt_fil_pro_nom" class="form-control input-sm">

							 </div>

								

							 <div class="col-lg-2 col-xs-6">	

								<label>Categoría:</label>

								<select name="cmb_fil_cat_id" id="cmb_fil_cat_id" class="form-control input-sm">

								</select>

							 </div>



								

						     <div class="col-lg-2 col-xs-6">		

								<label>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-6">	

								<label>Almacén:</label>

								<select name="cmb_fil_alm_id" id="cmb_fil_alm_id" class="form-control input-sm"></select>

							 </div>	

								

						     <div class="col-lg-1 col-xs-6">		

								<label>Mostrar:</label>

								<select name="cmb_fil_condicion" id="cmb_fil_condicion" class="form-control input-sm">

									<option value="1">Menor al Stock Mínimo</option>

									<option value="2">Mayor al Stock Máximo</option>

								</select>

							 </div>	

								

	                        <div class="col-lg-1 col-xs-6" style="display: inline-block; white-space: nowrap;padding-top: 23px;">

								<button   href="#" onClick="stockcheck_tabla()"  class="btn btn-primary btn-sm" ><i class="fa fa-search"></i></button>

								<button  onClick="stockcheck_filtro()"  class="btn btn-default  btn-sm" ><i class="fa fa-refresh"></i></button>

     	                   </div>



						</div>

					</form>

				</div>

			</div>

		</div>

	</div>

</section>





