fix skit2

This commit is contained in:
hafifierahman
2022-04-13 10:59:43 +08:00
parent c2b255631d
commit 18cb578ba2
4 changed files with 56 additions and 76 deletions
@@ -1,6 +1,7 @@
@extends('layouts.app')
@section('content')
@include('modal.permohonanwang')
@include('modal.CITModal')
<div class="container">
<div class="row justify-content-center">
@@ -73,7 +74,7 @@
echo '<button data-mohonid="' . $mohon["mohonid"] . '" id="btnterima" class="btn btn-success"><i class="fas fa-check"></i></button>';
}else if(($mohon['tagcit'] === 0 && $mohon['jenismohon'] === 'bayaranbalik'))
{
echo '<button data-mohonid="' . $mohon["mohonid"] . '" id="btncit" class="btn btn-secondary">CIT</button>';
echo '<button data-mohonid="' . $mohon["mohonid"] . '" id="btncit" class="btn btn-secondary" data-toggle="modal" data-target="#CITModal">CIT</button>';
}
else{
echo '<span class="p-2 badge badge-info">DALAM PROSES</span>';
@@ -188,79 +189,5 @@
});
});
$(document).on('click', '#btncit', function(e) {
let mid = $(this).data("mohonid");
var bank = @php echo json_encode($bank) @endphp;
var options = {};
$.map(bank,
function(o) {
options[o.abbreviation] = o.name;
});
Swal.fire({
title: 'BANK CIT',
text: 'Sila Pilih Bank',
input: 'select',
inputOptions: options,
showCancelButton: true,
animation: 'slide-from-top',
inputPlaceholder: 'Sila Pilih Bank',
allowOutsideClick: false,
preConfirm: (value) => {
if(!value){
Swal.showValidationMessage(
`Pilih Bank yang dinyatakan`
);
}
}
}).then(function (result) {
if (result) {
if (result.isConfirmed) {
let cit = result.value;
Swal.fire({
title: 'Masukkan No Resit',
input: 'text',
animation: 'slide-from-top',
inputPlaceholder: 'No Resit',
allowOutsideClick: false,
preConfirm: (value) => {
if(!value){
Swal.showValidationMessage(
`Masukkan No Resit Di dalam kotak disediakan`
);
}
}
}).then(function (response) {
if(response){
$.ajax({
method:"put",
url: api_url + '/admin/permohonan/tagcit',
data: {
"mohonid" : mid,
"bank" : cit,
"resitcit" : response.value
},
success:function(data)
{
if(data === 1)
Swal.fire('Diterima!', '', 'success')
}
});
}
});
}else{
}
}
});
});
</script>
@endsection