<div class="content-wrapper">

<!-- Content Header (Page header) -->

<section class="content-header">

  <h1>

    Stock general

    <small>modulo</small>

  </h1>

  <ol class="breadcrumb">

    <li><a href="#"><i class="fa fa-dashboard"></i> Inicio</a></li>

    <li><a href="#">Modulos</a></li>

    <li class="active">Stock general</li>

  </ol>

</section>

<section class="content" style="min-height:0px;padding-bottom:0px;margin-bottom:-30px;">

	<div class="row">

	    <div class="col-xs-12">

		    <div class="box">

		        <div class="box-header">

		          <button id="btn_agregar" onClick="stockgeneral_form('insertar')" class="btn btn-primary">Agregar</button>

		          <button id="btn_actualizar" class="btn btn-default">Actualizar</button>

		          <div id="msj_stockgeneral" class="alert alert-info pull-right" style="padding:2px;margin-bottom:0px;display:none"></div>

		          <!--<h3 class="box-title">Listado de Clientes</h3>-->

		        </div>

		    </div>

		</div>

	</div>

</section>







<!-- Filter content -->

<div id="div_stockgeneral_filtro"></div>

<!-- Table content -->

<div id="div_stockgeneral_tabla"></div>

<!-- Form content -->

</div>







<script type="text/javascript">

	function stockgeneral_filtro()

	{

		$.ajax({

			type: "POST",

			url: "../stockgeneral/stockgeneral_filtro.php",

			async:true,

			dataType: "html",                      

		//data: ({

			//producto: $('#txt_fil_pro').val()

		//}),

		beforeSend: function() {

			$('#div_stockgeneral_filtro').html('Cargando..');

		},

		success: function(html){

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

		},

		complete: function(){

			//stockgeneral_tabla();

		}

	});

	}



	function stockgeneral_tabla()

	{





		if($('#chk_fil_unibas').is(':checked')) {  

			dunibas=1;

		} else {  

			dunibas=0;

		}	



		$.ajax({

			type: "POST",

			url: "../stockgeneral/stockgeneral_tabla.php",

			async:true,

			dataType: "html",                      

			data: $("#for_fil_pro").serialize(),

			beforeSend: function() {

				$('#msj_stockgeneral').html("Cargando...");

				$('#msj_stockgeneral').show(100);

				$('#div_stockgeneral_tabla').addClass("ui-state-disabled");

			},

			success: function(html){

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

			},

			complete: function(){			

				$('#div_stockgeneral_tabla').removeClass("ui-state-disabled");

				$('#msj_stockgeneral').hide();

		}/*,error: function(a){

			console.log(a);

		}*/



	});    

	}





	$(function() {



		$('#btn_actualizar').button({

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

			text: true

		}).click(function() {

			location.reload();

		});



		$('#btn_excel').button({

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

			text: true

		}).click(function() {

			$("#for_fil_pro").attr('action', "stockgeneral_excel_reporte.php");

			$("#for_fil_pro").submit();

		});



		$('#btn_agregar').button({

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

			text: true

		});



		stockgeneral_filtro();		



	});

</script>

