fix kelulusan
This commit is contained in:
@@ -313,12 +313,12 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Gadai</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Margin</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Margin</th>
|
||||
<th>Kos Keuntungan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -330,12 +330,12 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Gadai</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Margin</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Margin</th>
|
||||
<th>Kos Keuntungan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -355,6 +355,8 @@
|
||||
<script>
|
||||
var api_url = "<?php echo $api_url ?>";
|
||||
|
||||
|
||||
|
||||
var tablegadai = $('#myTable').DataTable({
|
||||
"scrollX": true
|
||||
});
|
||||
@@ -571,6 +573,39 @@
|
||||
function ubahfunc(e)
|
||||
{
|
||||
let ubahid = $('input[name="belum"]:checked').val();
|
||||
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
|
||||
if(+harini !== +tarikhgadai2)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Ubah gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
if(+harini !== +tarikhgadai1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Ubah gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(ubahid == null && $("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
@@ -593,6 +628,9 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin
|
||||
({
|
||||
@@ -707,6 +745,40 @@
|
||||
let hapusid = $('input[name="belum"]:checked').val();
|
||||
let hapusidsudah = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
|
||||
if(+harini !== +tarikhgadai2)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Hapus gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
if(+harini !== +tarikhgadai1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Hapus gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hapusid == null && $("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
@@ -746,154 +818,155 @@
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
let mohon = "Hapus Gadai";
|
||||
let id = 0;
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
id = hapusid;
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
id = hapusidsudah;
|
||||
}
|
||||
let mohon = "Hapus Gadai";
|
||||
let id = 0;
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : id,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function()
|
||||
{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : id
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
if(data != 0)
|
||||
{
|
||||
console.log('berjaya');
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
|
||||
success:function(data)
|
||||
{
|
||||
console.log(data);
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan 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,
|
||||
success:function(data)
|
||||
{
|
||||
if(data != "Bukan-Tebus")
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
id = hapusid;
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
id = hapusidsudah;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : id,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function()
|
||||
{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : id
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
if(data != 0)
|
||||
{
|
||||
console.log('berjaya');
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
|
||||
success:function(data)
|
||||
{
|
||||
console.log(data);
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan 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,
|
||||
success:function(data)
|
||||
{
|
||||
if(data != "Bukan-Tebus")
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Hanya Untuk Jenis Tebus Sahaja!',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
console.log(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Hanya Untuk Jenis Tebus Sahaja!',
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function gadaiOptionButton(noic){
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
<td>{{ $cawangan_info['details_caw'] }}</td>
|
||||
<td>{{ $k['norujukan'] }}</td>
|
||||
<td>{{ $k['komen'] }}</td>
|
||||
<td><button class="btn btn-primary mr-2" onclick="updatelulus(this)" data-norujukan="{{ $k['norujukan'] }}"><i class="fas fa-thumbs-up"></i></button><button class="btn btn-danger"><i class="fas fa-thumbs-down"></i></button></td>
|
||||
<td>{{ $k['pelulus'] }}</td>
|
||||
<td><button class="btn btn-primary mr-2" data-pelulus="{{ $k['pelulus'] }}" onclick="updatelulus(this)" data-norujukan="{{ $k['norujukan'] }}"><i class="fas fa-thumbs-up"></i></button>
|
||||
<button class="btn btn-danger"><i class="fas fa-thumbs-down"></i></button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($kelulusanmohonid as $index=>$km)
|
||||
@@ -78,13 +80,16 @@
|
||||
function updatelulus(e)
|
||||
{
|
||||
let norujukan = $(e).data('norujukan');
|
||||
let pelulus = $(e).data('pelulus');
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: "{{ route('khazanah.updatekelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
"norujukan" : norujukan,
|
||||
"pelulus" : pelulus
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
|
||||
@@ -122,12 +122,18 @@
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var cawangankhazanah = '{{ $auth_user["cawangan"] }}';
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
// let message = JSON.stringify(data);
|
||||
|
||||
|
||||
if(cawangankhazanah == data.cawangan)
|
||||
{
|
||||
|
||||
$('#bell').css("color", "red");
|
||||
$('#linkz').text("Teller Pohon Kelulusan");
|
||||
$('#linkz').text(data.namateller + " Memohon Kelulusan");
|
||||
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
||||
|
||||
const Toast = Swal.mixin({
|
||||
@@ -146,6 +152,8 @@
|
||||
icon: 'error',
|
||||
title: 'Kelulusan Dipohon Sekarang!'
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -223,12 +223,12 @@
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
var channel = pusher.subscribe('operasi-notify');
|
||||
channel.bind('operasi-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
|
||||
$('#bell').css("color", "red");
|
||||
$('#linkz').text("Teller Pohon Kelulusan");
|
||||
$('#linkz').text(data.namateller + " Pohon Kelulusan");
|
||||
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
||||
|
||||
const Toast = Swal.mixin({
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
Try publishing an event to channel <code>my-channel</code>
|
||||
with event name <code>my-event</code>.
|
||||
</p>
|
||||
<button onclick="trigtest()">Click</button>
|
||||
<button>Click</button>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -121,10 +121,12 @@
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
|
||||
console.log(data);
|
||||
console.log(message);
|
||||
console.log(data);
|
||||
|
||||
if(data.message == 'KOK LANAS')
|
||||
console.log(data.message);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user