update confirm box

This commit is contained in:
Aung Myo
2017-10-19 18:17:56 +06:30
parent 034685e1e9
commit 78c6304748
21 changed files with 364 additions and 556 deletions

View File

@@ -360,7 +360,7 @@
$( "#loading_wrapper" ).show();
if($('#balance').text() > 0){
alert(" Insufficient Amount!")
swal ( "Oops" , "Insufficient Amount!" , "error" );
$( "#loading_wrapper" ).hide();
}else{
var sale_id = $('#sale_id').text();
@@ -389,33 +389,19 @@
}
$( "#loading_wrapper" ).hide();
if($('#balance').text() < 0){
$.confirm({
title: 'Infomation!',
content: 'Changed amount ' + $('#balance').text() * (-1),
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-green',
action: function(){
window.location.href = '/origami';
}
}
}
swal({
title: "Infomation!",
text: 'Changed amount ' + $('#balance').text() * (-1),
}, function () {
window.location.href = '/origami';
});
}else{
$('#pay').text("Pay")
$.confirm({
title: 'Infomation!',
content: 'Thank you !',
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-green',
action: function(){
window.location.href = '/origami';
}
}
}
$('#pay').text("Pay");
swal({
title: "Infomation!",
text: 'Thank You !',
}, function () {
window.location.href = '/origami';
});
}
}
@@ -424,20 +410,20 @@
});
$('#void').on('click',function () {
var sure = confirm("Are you sure want to Void");
if (sure == true) {
swal({
title: "Infomation!",
text: 'Are you sure want to Void !',
}, function () {
var sale_id = $('#sale_id').text();
var ajax_url = "/origami/sale/" + sale_id + '/void';
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
}
})
} else {
}
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
}
})
});
});
});
@@ -472,18 +458,11 @@
$( "#loading_wrapper" ).hide();
if (cash > 0) {
$.confirm({
title: 'Infomation!',
content: 'Thank you !',
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-green',
action: function(){
window.location.href = '/origami';
}
}
}
swal({
title: "Infomation!",
text: 'Thank You !',
}, function () {
window.location.href = '/origami';
});
}