399 lines
19 KiB
PHP
399 lines
19 KiB
PHP
<x-default-layout>
|
|
@php
|
|
$route = explode('.', Route::currentRouteName());
|
|
@endphp
|
|
<!--begin::Card-->
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
<!-- CDN untuk jQuery Validation -->
|
|
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
|
|
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
|
<style>
|
|
.bd-example-modal-lg .modal-dialog{
|
|
display: table;
|
|
position: relative;
|
|
margin: 0 auto;
|
|
top: calc(50% - 24px);
|
|
}
|
|
|
|
.bd-example-modal-lg .modal-dialog .modal-content{
|
|
background-color: transparent;
|
|
border: none;
|
|
}
|
|
</style>
|
|
<div class="card card-xxl-stretch mb-5 mb-xl-8">
|
|
<!--begin::Card body-->
|
|
<div class="card-body pt-6">
|
|
<div class="container">
|
|
<div class="row" >
|
|
<div class="col-md-3"></div>
|
|
<div class="col-md-6" style="border: 1px solid grey;padding: 20px;background-color:#f4f4f4">
|
|
<form id="myForm">
|
|
<div class="row mb-3">
|
|
<label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">No CIF <span style="color:red">*</span></label>
|
|
<div class="col-sm-10">
|
|
<input type="text" class="form-control form-control-sm" name="cif" id="cif" placeholder="No CIF" >
|
|
</div>
|
|
</div>
|
|
<div class="row mb-3">
|
|
<label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">Cabang</label>
|
|
<div class="col-sm-10">
|
|
<input type="text" class="form-control form-control-sm" name="kodecabang" id="kodecabang" placeholder="Nama Cabang">
|
|
</div>
|
|
</div>
|
|
<div class="row mb-3">
|
|
<label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">Periode <span style="color:red">*</span></label>
|
|
<div class="col-sm-10">
|
|
<input type="number" class="form-control form-control-sm" min="{{$data['pastYear']}}" max="{{$data['currentYear']}}" name="periode" clear id="periode" placeholder="Periode">
|
|
</div>
|
|
</div>
|
|
<div class="text-end">
|
|
<button type="submit" class="btn btn-primary btn-sm ms-auto">Cari</button>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<div class="col-md-3 d-flex justify-content-end">
|
|
<form class="form_customer2" id="exportForm">
|
|
@csrf
|
|
|
|
<div class="d-flex flex-column mb-8 fv-row">
|
|
{{-- <input type="text" style="margin-bottom: 5px" name="cus_no" id="acc_no2" /> --}}
|
|
<input type="hidden" style="margin-bottom: 5px" name="acc_no" />
|
|
{{-- <input type="hidden" style="margin-bottom: 5px" name="kode_cabang" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="periode" /> --}}
|
|
<div class="text-right ">
|
|
<div class="d-flex justify-content-end ">
|
|
<button type="button" class="btn btn-light-primary btn-sm exportPdf" style="display:none" id="buttonExport1">
|
|
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span
|
|
class="path2"></span></i>
|
|
Export Report
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<form class="formFasilitas" action="{{ route($route[0].'.fasilitas') }}" >
|
|
@csrf
|
|
<input type="text" style="margin-bottom: 5px" name="cus_no_fasilitas" id="cus_no_fasilitas" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="batch_date" id="batch_date" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="company_name" id="company_name" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="status" value="1" />
|
|
<button type="submit" class="btn btn-light-info btn-sm fasilitasButton " style="margin-left:5px;display:none">
|
|
<i class="ki-duotone ki-plus fs-2"><span class="path1"></span><span class="path2"></span></i>
|
|
Fasilitas
|
|
</a>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="card-body pt-6">
|
|
<form class="form_customer3" method="POST" action="{{ route($route[0] . '.export') }}">
|
|
<div class="form-check d-flex justify-content-end " style ="margin-right:45px">
|
|
<input class="form-check-input mycheck" type="checkbox" value="" id="selectAll">
|
|
<label class="form-check-label mycheck" for="" style="padding-left:5px">
|
|
All
|
|
</label>
|
|
</div>
|
|
<!-- Button to trigger the modal -->
|
|
|
|
<div class="table-responsive " style="overflow-x:auto;">
|
|
<div id="user_table">
|
|
@include('konfirmasibank::pages.table')
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<!--end::Card body-->
|
|
</div>
|
|
|
|
<!-- The Modal -->
|
|
<div class="modal" id="myModal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<!-- Modal Header -->
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Tambah Fasilitas</h4>
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
</div>
|
|
|
|
<!-- Modal body -->
|
|
<div class="modal-body">
|
|
<!-- Your horizontal form goes here -->
|
|
<form class="form-horizontal" id="myForm">
|
|
<div class="form-group row">
|
|
<label for="name" class="col-sm-4 col-form-label">No Rekening:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control form-control-sm" id="norek" name="norek" placeholder="Nomor Rekening">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="name" class="col-sm-4 col-form-label">Cabang:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control form-control-sm" name="cabang" placeholder="Pilih Cabang">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="name" class="col-sm-4 col-form-label">Jenis Rekening:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control form-control-sm" name="jns_rekening" placeholder="Jenis Rekening">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="name" class="col-sm-4 col-form-label">Jenis Pinjaman:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control form-control-sm" name="jns_pinjaman" placeholder="Jenis Pinjaman">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="name" class="col-sm-4 col-form-label">Jenis Fasilitas:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control form-control-sm" name="jns_fasilitas" placeholder="Jenis Fasilitas">
|
|
</div>
|
|
</div>
|
|
<!-- Add more form fields as needed -->
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Modal footer -->
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal" id ="cancelBtn">Close</button>
|
|
<button type="button" class="btn btn-primary btn-sm" id="submitFormBtn">Submit</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="signerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
|
aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<!-- Modal header -->
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="myModalLabel">Tambah Signer</h5>
|
|
<button type="button" class="closeButton" data-dismiss="modal" aria-label="Close"
|
|
style="display:none">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Modal body -->
|
|
<div class="modal-body">
|
|
<form class="form-horizontal" id="formSigner">
|
|
@csrf
|
|
<!-- Add your form fields here -->
|
|
<input type="hidden" style="margin-bottom: 5px" name="cus_no" id="acc_no2" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="kode_cabang" />
|
|
<input type="hidden" style="margin-bottom: 5px" name="periode" />
|
|
<select class="form-select form-select-sm" aria-label="Small select example" id="signer-select" name="signer">
|
|
<option selected>Select Signer</option>
|
|
@foreach ($data['signer'] as $item)
|
|
<option value="{{$item->id}}">{{$item->signer_type}}</option>
|
|
@endforeach
|
|
</select>
|
|
<!-- Modal footer -->
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-sm closeButtonSigner"
|
|
data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-primary btn-sm" id="submitSigner">Submit</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal loading spiner -->
|
|
|
|
<div class="modal fade bd-example-modal-lg modalSpiner" data-backdrop="static" data-keyboard="false" tabindex="-1">
|
|
<div class="modal-dialog modal-sm">
|
|
<div class="modal-content" style="width: 48px">
|
|
<div class="spinner-border" role="status">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@push('customscript')
|
|
<script>
|
|
$(function() {
|
|
$('.mycheck').hide();
|
|
$('#cif_null').hide();
|
|
|
|
$("#myForm").submit(function (event) {
|
|
event.preventDefault(); // Prevent the form from submitting normally
|
|
if ($("#cif").val() === "") {
|
|
alert("Nomor CIF harus diisi.");
|
|
return; // Stop form submission
|
|
}
|
|
if ($("#periode").val() === "") {
|
|
alert("Periode harus diisi.");
|
|
return; // Stop form submission
|
|
}
|
|
|
|
$('.row-none').hide();
|
|
$('.mycheck').show();
|
|
$('.firstrow').remove();
|
|
$('.secondrow').remove();
|
|
$('.loading1').show();
|
|
var actionUrl = $(".form_customer3").attr('action');
|
|
var cif = $("input[name=cif]").val();
|
|
var kodecabang = $("input[name=kodecabang]").val();
|
|
var periode = $("input[name=periode]").val();
|
|
$("input[name=cus_no]").val(cif);
|
|
$("input[name=kode_cabang]").val(kodecabang);
|
|
$("input[name=periode]").val(periode);
|
|
var no = 1;
|
|
|
|
$.ajax({
|
|
url: "{{ route('getData') }}",
|
|
type: "GET",
|
|
data: $(this).serialize(),
|
|
dataType: "json",
|
|
success: function (items) {
|
|
$('.loading1').hide();
|
|
let dateString ='';
|
|
$.each(items, function(i, index) {
|
|
$('#dataBody').append('<tr class="secondrow"><td>' + (
|
|
no++) +
|
|
'</td><td>' + items[i]['ACCOUNT_NUMBER'] +
|
|
'</td><td>' + items[i]['COMPANY_NAME'] +
|
|
'</td><td>' + items[i]['SHORT_TITLE'] +
|
|
'</td><td>' + items[i]['WORKING_BALANCE'] +
|
|
'</td><td>' + items[i]['PRODUCT'] +
|
|
'</td><td>' + items[i]['CURRENCY']+
|
|
'</td><td class="text-center">'+ items[i]['MATURITY_DATE'] +
|
|
'</td><td class="tes"><div style="padding-left:22px" class="form-check form-check-custom form-check-solid me-10"><input class=" form-check-input h-20px w-20px acc_no" type="checkbox" name="account_number" value="' +
|
|
items[i]['ACCOUNT_NUMBER'] + '"></div></td></tr>'
|
|
);
|
|
});
|
|
|
|
$(".fasilitasButton").show();
|
|
var kdcabang = $("#kodecabang").val();
|
|
var periode = $("#periode").val();
|
|
$("#cus_no_fasilitas").val(cif);
|
|
$("#company_name").val(kdcabang);
|
|
$("#batch_date").val(periode);
|
|
|
|
},
|
|
error: function (error) {
|
|
console.error("Form submission failed!");
|
|
// Handle the error if needed
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
|
|
var acc_no = [];
|
|
$('#table4 tbody').on('change', 'tr td.tes input[type=checkbox]', function() {
|
|
$('.exportPdf').show();
|
|
if ($(this).is(':checked')) {
|
|
// Do something...
|
|
acc_no.push($(this).val());
|
|
$("input[name=acc_no]").val(acc_no)
|
|
};
|
|
|
|
});
|
|
|
|
var arr = [];
|
|
$("#selectAll").on('click', function() {
|
|
$('.exportPdf').show();
|
|
$("input[type=checkbox]").prop('checked', $(this).prop('checked'));
|
|
$.each($("input[name='account_number']:checked"), function() {
|
|
arr.push($(this).val());
|
|
$("input[name=acc_no]").val(arr)
|
|
});
|
|
});
|
|
|
|
|
|
// Open the modal when the button is clicked
|
|
$("#openModalBtn").click(function() {
|
|
$("#myModal").modal('show');
|
|
});
|
|
|
|
// Handle form submission when the "Submit" button is clicked
|
|
$("#submitFormBtn").click(function() {
|
|
var formData = $("#myForm2").serialize();
|
|
console.log(formData);
|
|
$("#myModal").modal('hide');
|
|
});
|
|
|
|
$("#cancelBtn").click(function() {
|
|
$("#myModal").modal('hide');
|
|
});
|
|
|
|
$(".closeButtonSigner").click(function() {
|
|
$("#signerModal").modal('hide');
|
|
});
|
|
|
|
//submit signer
|
|
$("#buttonExport1").click(function(){
|
|
$("#signerModal").modal('show');
|
|
|
|
})
|
|
|
|
// Handle form submission when the "Submit" button inside the modal is clicked
|
|
$("#submitSigner").click(function(e) {
|
|
e.preventDefault();
|
|
var cif = $('input[name="cus_no"]').val();
|
|
var cabang = $('input[name="kode_cabang"]').val();
|
|
var periode = $('input[name="periode"]').val();
|
|
var acc_no = $('input[name="acc_no"]').val();
|
|
var signer = $("#signer-select").find('option:selected').val();
|
|
$("#signerModal").modal('hide');
|
|
$('.modalSpiner').modal('show');
|
|
var dt = new Date();
|
|
var date = dt.getYear() + ":" + dt.getDate() + ":" + dt.getHours();
|
|
// var formData = $("#formSigner").serialize();
|
|
var dataToSend = {
|
|
_token: $('meta[name="csrf-token"]').attr('content'),
|
|
cus_no: cif,
|
|
kode_cabang: cabang,
|
|
periode:periode,
|
|
acc_no:acc_no,
|
|
signer:signer
|
|
|
|
};
|
|
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{{ route('konfirmasibank.export') }}",
|
|
data: dataToSend, // serializes the form's elements.
|
|
xhrFields: {
|
|
responseType: 'blob'
|
|
},
|
|
success: function(response) {
|
|
console.log(response);
|
|
$('.modalSpiner').modal('hide');
|
|
var blob = new Blob([response]);
|
|
var link = document.createElement('a');
|
|
link.href = window.URL.createObjectURL(blob);
|
|
link.download = "konfirmasibank_" + date + ".pdf";
|
|
link.click();
|
|
|
|
},
|
|
error: function(data, textStatus, errorThrown) {
|
|
var errors = data.responseJSON.errors;
|
|
$.each(errors, function(key, value) {
|
|
toastr.error(value);
|
|
});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|
|
</x-default-layout>
|