$(document).ready(function() {
$(document.body).on("click", "#sendgateway", function() {
var overlay = jQuery('
');
overlay.appendTo(document.body)
var id = $(this).data("gateway");
var crc = $(this).data("crc");
$.ajax({
url: "ajax_setup_gateway.php",
data: "hotel=campanile&id=" + id + "&crc=" + crc,
type: "POST",
success: function(data) {
if(data) {
console.log(data);
}
else {
var refresh = setInterval(function() {
$.ajax({
url: "ajax_check_gateway.php",
data: "hotel=campanile&id=" + id,
type: "POST",
success: function(data) {
if(data != "0000-00-00 00:00:00") {
$("#overlay").remove();
location.reload();
clearInterval(refresh);
}
}
});
}, 1000);
}
}
});
})
})