<div class="content-wrapper">

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

<section class="content-header">

  <h1>

    Venta pago

    <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"> Venta Pago</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="ventapago_form('insertar')" class="btn btn-primary">Agregar</button>

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

		          <div id="msj_ventapago" 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_ventapago_filtro"></div>

<!-- Table content -->

<div id="div_ventapago_tabla"></div>

<!-- Form content -->

<!--  <div id="div_cotizacion_form"></div> -->

</div>



<script type="text/javascript">



function ventapago_filtro()

{

	$.ajax({

		type: "POST",

		url: "../ventapago/ventapago_filtro.php",

		async:true,

		dataType: "html",                      

		beforeSend: function() {

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

        },

		success: function(html){

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

		},

		complete: function(){

			ventapago_tabla();

		}

	});

}



function ventapago_tabla()

{

	$.ajax({

		type: "POST",

		url: "../ventapago/ventapago_tabla.php",

		async:true,

		dataType: "html",

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

		beforeSend: function() {

			$('#msj_ventapago_tabla').html("Cargando datos...");

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

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

        },

		success: function(html){

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

		},

		complete: function(){			

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

			$('#msj_ventapago_tabla').hide(100);

		}

	});     

}



function venta_form(act,idf){

		$.ajax({

			type: "POST",

			url: "../venta/venta_form.php",

			async:true,

			dataType: "html",                      

			data: ({

				action: act,

				ven_id:	idf

			}),

			beforeSend: function() {

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

				$('#div_venta_form').dialog("open");

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

			},

			success: function(html){

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

			},

			complete: function(){

			}

		});

	}







$(function() {

	

	$('#btn_actualizar').button({

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

		text: true

		}).click(function() {

		location.reload();

	});

	

	$('#btn_agregar').button({

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

		text: true

	});

	$('.btn_modo').button({

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

		text: true

	});

	$('.imprimir_pdf').button({

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

		text: true

	});

	

	$('#btn_imprimir_xls').button({

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

		text: true

	});

		

	ventapago_filtro();	

	setTitle("Venta Pago- "+nameofempresa);	

	

	$( "#div_venta_form" ).dialog({

		title:'Información de Venta',

		autoOpen: false,

		resizable: false,

		height: 600,

		width: 980,

		zIndex: 1,

		modal: true,

		position: "top",

		closeOnEscape: false,

		buttons: {

			Cerrar: function() {

				$( this ).dialog( "close" );

			}

		},

		close: function(event, ui) {

			$('#div_catalogo_venta').dialog( "close" );

			$('#div_venta_form').html('venta_form');

		}

	});

	

});

</script>



















