<?php
$fac_id=$_GET['id']; 
?>
<div class="alert alert-danger alert-dismissable">
    <strong>Desea Anular?</strong> 
</div>
<div id="resul_fac"></div>
<form method="post" action="" id="anular_fac" name="anular_fac">
    <input type="hidden" id="fac_id" name="fac_id" value="<?php echo $fac_id;?>" class="form-control name_list" readonly>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
        <button id="btn_anular" type="submit" class="btn btn-success"><i class="icon-ok"></i> <strong>Anular</strong></button>
    </div>
</form>
<script>
$( "#anular_fac" ).submit(function( event ) {
$('#btn_anular').attr("disabled", true);

var parametros = $(this).serialize();
   $.ajax({
      type: "POST",
      url: "php_facturacion_periodica/anular.php",
      data: parametros,
        beforeSend: function(objeto){
         $('#resul_fac').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
        success: function(datos){
        $("#resul_fac").html(datos);
        $('#btn_anular').attr("disabled", false);

        $('#anular').modal('hide');
        $('body').removeClass('modal-open');
        $('.modal-backdrop').remove();
       load(1);
      }
  });
  event.preventDefault();
})
</script>
