<?php 
session_start();
?>
<section class="content">
	<div class="container-fluid">
	<div class="row">
	    <div class="col-lg-12 col-md-12 col-sm-12 col-12">
		    <div class="card">
		        <div class="card-header">
    		<div class="row">
			
			
    		<form id="for_fil_tal" >
	        	<input type="hidden" id="hdd_fil_cli_id" name="hdd_fil_cli_id" />
				<div class="row">
				
	        	<div class="col-lg-3 col-sm-3 col-6">
                  	<label>Módulo:</label>
                  	<select name="cmb_fil_mod_id" id="cmb_fil_mod_id" class="form-control"> </select>
                </div>
	        	<div class="col-lg-3 col-sm-3 col-6">
                  	<label>Documento:</label>
                  	<select name="cmb_fil_doc_id" id="cmb_fil_doc_id" class="form-control"></select> 
                </div>
				
				<div class="col-lg-3 col-sm-3 col-6">
					<label for="cmb_fil_punven_id">Punto V.:</label>
					<select   name="cmb_fil_punven_id" id="cmb_fil_punven_id" class="form-control "></select>
				</div>
				
				 <div class="col-lg-3 col-sm-3 col-6" style="padding-top: 30px;"> 
                	<span onClick="talonario_tabla()" title="Mostrar busquedas" class="btn btn-primary "><i class="fas fa-search"></i></span>
					<span onClick="talonario_filtro()" title="Restablecer filtro" class="btn btn-default">Restablecer</span>
                </div>
				
				</div>
												
             </form>
               
				
				
        	</div>
        </div>
      </div>
    </div>
  </div>
  </div>
</section>
<script type="text/javascript">
cmb_fil_punven_id('<?php echo '';?>');
	
 function cmb_fil_punven_id(punven_id){
	
	  	$.ajax({
			type: "POST",
			url: "../puntoventa/cmb_punven_id.php",
			async:true,
			dataType: "html",                      
			data: ({
				punven_id:punven_id
			}),
			beforeSend: function(){
				$('#cmb_fil_punven_id').html('<option value="">Cargando...</option>');
			},
			success: function(html){		
				$('#cmb_fil_punven_id').html(html);
				
			}
		});		
	} 
function cmb_fil_mod_id(modid)
	{	
		$.ajax({
			type: "POST",
			url: "../modulo/cmb_mod_id.php",
			async : true,
			dataType: "html",                      
			data: ({
				mod_id: modid
			}),
			beforeSend: function() {
				$('#cmb_fil_mod_id').html('<option value="">Cargando...</option>');
			},
			success: function(html){
				$('#cmb_fil_mod_id').html(html);
				//cmb_fil_doc_id('$('#cmb_fil_mod_id').val()','')
			}
		});
	}
	function cmb_fil_doc_id(modid,docid)
	{	
		$.ajax({
			type: "POST",
			url: "../documento/cmb_doc_id.php",
			async:true,
			dataType: "html",                      
			data: ({
				mod_id: modid,
				doc_id: docid
			}),
			beforeSend: function() {
				$('#cmb_fil_doc_id').html('<option value="">Cargando...</option>');
			},
			success: function(html){
				$('#cmb_fil_doc_id').html(html);
			}
		});
	}
	$(function(){
		cmb_fil_mod_id();
		
		$('#cmb_fil_mod_id').change(function(){
			cmb_fil_doc_id($('#cmb_fil_mod_id').val(),'<?php echo $doc_id?>');
		});
		
		$("#cmb_fil_empresa_id").change(function(){
			talonario_tabla();
		});
		$("#cmb_fil_mod_id, #cmb_fil_doc_id,#cmb_fil_punven_id").change(function(){
			talonario_tabla();
		});
		talonario_tabla();
		
	});	
</script>