255 lines
13 KiB
PHP
255 lines
13 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() }}" />
|
|
<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</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</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 ">
|
|
<form class="form_customer2" method="POST" action="{{ route($route[0] . '.export') }}">
|
|
@csrf
|
|
|
|
<div class="d-flex flex-column mb-8 fv-row">
|
|
<input type="hidden" 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="submit" class="btn btn-light-primary btn-sm exportPdf" style="display:none">
|
|
<i class="ki-duotone ki-exit-down fs-2"><span class="path1"></span><span
|
|
class="path2"></span></i>
|
|
Export Report
|
|
</button>
|
|
<a href="{{ route($route[0] . '.addFasilitas') }}" type="button" class="btn btn-light-info btn-sm " style="">
|
|
<i class="ki-duotone ki-plus fs-2"><span class="path1"></span><span
|
|
class="path2"></span></i>
|
|
Fasilitas
|
|
</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</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>
|
|
@push('customscript')
|
|
<script>
|
|
$(function() {
|
|
$('.mycheck').hide();
|
|
$('#cif_null').hide();
|
|
$("#myForm").submit(function (event) {
|
|
event.preventDefault(); // Prevent the form from submitting normally
|
|
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>'
|
|
);
|
|
});
|
|
|
|
},
|
|
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');
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
@endpush
|
|
</x-default-layout>
|