fix skit2
This commit is contained in:
@@ -1083,17 +1083,17 @@
|
||||
}
|
||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
|
||||
// let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
// let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
|
||||
// if(+harini !== +tarikhgadai1){
|
||||
// Swal.fire({
|
||||
// icon: 'error',
|
||||
// title: 'Amaran',
|
||||
// text: 'Ubah Gadai Tidak Dibenarkan'
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
if(+harini !== +tarikhgadai1){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Ubah Gadai Tidak Dibenarkan'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(ubahid == null && $("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
@@ -1529,92 +1529,103 @@
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||
cluster: 'ap1',
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : id
|
||||
},
|
||||
success:function(data){
|
||||
if(data != 0){
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
var channel = pusher.subscribe('notice-ubahhapus');
|
||||
channel.bind('my-ubahhapus', function(data) {
|
||||
|
||||
if(data.norujukan == id)
|
||||
{
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan'
|
||||
}).then(function(){
|
||||
}).then(function(){
|
||||
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
|
||||
data: { 'kodlaluan' : teller },
|
||||
success:function(data){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/komuditi/batal',
|
||||
dataType:'json',
|
||||
data:{
|
||||
norujukan: hapusid
|
||||
},
|
||||
success:function(batalkomuditi){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Maklumat gadaian telah dihapuskan.',
|
||||
'success'
|
||||
).then(function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
})
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url + '/api/tebus/hapus/' + kodcaw + '/' + hapusidsudah,
|
||||
data: { 'kodlaluan' : teller },
|
||||
success:function(data){
|
||||
if(data != "Bukan-Tebus"){
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + id,
|
||||
data: { 'kodlaluan' : teller },
|
||||
success:function(data){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/komuditi/batal',
|
||||
dataType:'json',
|
||||
data:{
|
||||
norujukan: hapusid
|
||||
},
|
||||
success:function(batalkomuditi){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Maklumat gadaian telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
).then(function(){
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
clearInterval(timerInterval);
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Tebus Tidak Dibenarkan, Hanya untuk tebus sahaja!',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
console.log(xhr.responseText);
|
||||
})
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url + '/api/tebus/hapus/' + kodcaw + '/' + id,
|
||||
data: { 'kodlaluan' : teller },
|
||||
success:function(data){
|
||||
if(data != "Bukan-Tebus"){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Maklumat gadaian telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Tebus Tidak Dibenarkan, Hanya untuk tebus sahaja!',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
console.log(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
else if(data.kelulusan == 'batal')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Telah Dibatalkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
}).then(function(){
|
||||
// $("#terima_gadai").prop('disabled', false);
|
||||
location.reload();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
|
||||
Reference in New Issue
Block a user