diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 0016655..acd0bf9 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -2333,15 +2333,28 @@ success: function(success){ $('#btnsave').css('display','none'); $('#btnotp').show(); - Swal.fire({ - icon: 'success', - title: 'Berjaya', - text: 'Berjaya mengemaskini maklumat pelanggan' - }).then((result) => { - if (result.isConfirmed) { - location.reload(); - } - }); + if(success == 1){ + Swal.fire({ + icon: 'success', + title: 'Berjaya', + text: 'Berjaya mengemaskini maklumat pelanggan', + allowEscapeKey : false, + allowOutsideClick: false, + }).then((result) => { + if (result.isConfirmed) { + location.reload(); + } + }); + }else{ + Swal.fire({ + icon: 'error', + title: 'Tidak Berjaya', + text: 'Tidak berjaya mengemaskini maklumat pelanggan', + allowEscapeKey : false, + allowOutsideClick: false, + }); + } + }, error: function (request, status, error) { alert(request.responseText); diff --git a/resources/views/homepage/khazanah/home.blade.php b/resources/views/homepage/khazanah/home.blade.php index 9c232fa..88ca38d 100644 --- a/resources/views/homepage/khazanah/home.blade.php +++ b/resources/views/homepage/khazanah/home.blade.php @@ -408,19 +408,33 @@ Swal.fire({ icon: 'error', title: 'Tidak Berjaya', - text: 'Tidak berjaya mengemaskini denominasi' + text: 'Tidak berjaya mengemaskini denominasi', + allowEscapeKey : false, + allowOutsideClick: false, }).then((result) => { if (result.isConfirmed) { - location.reload(); + $('#editbtn').removeClass('d-none'); + $('#tutupbtn').removeClass('d-none'); + $('#simpanbtn').addClass('d-none'); + $('#batalbtn').addClass('d-none'); + $('.editfunc').prop('readonly', true); } }); }else{ Swal.fire({ icon: 'success', title: 'Berjaya', - text: 'Berjaya mengemaskini denominasi' + text: 'Berjaya mengemaskini denominasi', + allowEscapeKey : false, + allowOutsideClick: false, }).then((result) => { if (result.isConfirmed) { + + $('#editbtn').removeClass('d-none'); + $('#tutupbtn').removeClass('d-none'); + $('#simpanbtn').addClass('d-none'); + $('#batalbtn').addClass('d-none'); + $('.editfunc').prop('readonly', true); location.reload(); } }); @@ -667,20 +681,12 @@ confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Simpan' - }).then((result) => { + }).then(async (result) => { if (result.isConfirmed) { + + let savedata = await saveData(); - saveData(); - - $('#editbtn').removeClass('d-none'); - $('#tutupbtn').removeClass('d-none'); - $('#simpanbtn').addClass('d-none'); - $('#batalbtn').addClass('d-none'); - - $('.editfunc').prop('readonly', true); - - location.reload(); } else if (result.isDismissed) { } diff --git a/resources/views/khazanah/info.blade.php b/resources/views/khazanah/info.blade.php index f8760a1..ee78649 100644 --- a/resources/views/khazanah/info.blade.php +++ b/resources/views/khazanah/info.blade.php @@ -1254,15 +1254,26 @@ success: function(success){ $('#btnsave').css('display','none'); $('#btnotp').show(); - Swal.fire({ - icon: 'success', - title: 'Berjaya', - text: 'Berjaya mengemaskini maklumat pelanggan' - }).then((result) => { - if (result.isConfirmed) { - location.reload(); - } - }); + if(success == 1){ + Swal.fire({ + icon: 'success', + title: 'Berjaya', + text: 'Berjaya mengemaskini maklumat pelanggan' + }).then((result) => { + if (result.isConfirmed) { + location.reload(); + } + }); + }else{ + Swal.fire({ + icon: 'error', + title: 'Tidak Berjaya', + text: 'Tidak berjaya mengemaskini maklumat pelanggan', + allowEscapeKey : false, + allowOutsideClick: false, + }); + } + }, error: function (request, status, error) { diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php index 166cfdf..0a00866 100644 --- a/resources/views/penebusan/index.blade.php +++ b/resources/views/penebusan/index.blade.php @@ -247,7 +247,7 @@