<?php
session_start();
require_once ("../conexion.php");
require_once('../include/sesiones.php');
$mca_id=limpiar($_GET['id']);
$sql=mysqli_query($con,"SELECT * from movimiento_caja Where mca_id='$mca_id' ");
$reg=mysqli_fetch_array($sql);

?>
<form method="post" action="" id="form_cierre" name="form_cierre">
 	<div class="col-md-12">
    	<input type="hidden" name="mca_id" value="<?php echo $reg['mca_id']; ?>">
    	<input type="hidden" name="mca_efectivo" value="<?php  echo $reg['mca_efectivo']; ?>">
    	<div class="form-group">
     		<label>Valor</label>
      		<input type="number" name="valor_cierre" value="<?php echo $reg['mca_valor_cierre']; ?>" class="form-control name_list" autocomplete="off">
   		</div>
 	</div> <!-- /.form-group -->
	<div class="modal-footer">
  		<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
 		<button type="submit" class="btn btn-info" name="btn_cierre" id="btn_cierre">Modificar</button>
 	</div>
</form>
<script>
$("#form_cierre").submit(function( event ) {
$('#btn_cierre').attr("disabled", true);
var parametros = $(this).serialize();
   $.ajax({
      type: "POST",
      url: "php_caja/editar_cierre.php",
      data: parametros,
        beforeSend: function(objeto){
         $('#resultados').html('<center><img src="./img/ajax-loader.gif"> CARGANDO...</center>');
        },
        success: function(datos){
        $("#resultados").html(datos);
        $('#btn_cierre').attr("disabled", false);

        $('#modificar<?php echo $reg['mca_id']; ?>').modal('hide');
        $('body').removeClass('modal-open');
        $('.modal-backdrop').remove();
        load(1);
      }
  });
  event.preventDefault();
})
</script>       