182 lines
8.8 KiB
PHP
182 lines
8.8 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="text" class="form-control form-control-sm" name="periode" min="{{$data["currentYear"]}}" max="{{$data["pastYear"]}}" 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 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>
|
|
</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>
|
|
<div class="table-responsive " style="overflow-x:auto;">
|
|
<div id="user_table">
|
|
@include('konfirmasibank::pages.table')
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<!--end::Card body-->
|
|
</div>
|
|
<!--end::Card-->
|
|
@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) {
|
|
if (items[i]['MATURITY_DATE']) {
|
|
dateString = moment(items[i]['MATURITY_DATE']).format("YYYY-MM-DD");
|
|
} else {
|
|
dateString = '-';
|
|
}
|
|
$('#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">'+ dateString +
|
|
'</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)
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
@endpush
|
|
</x-default-layout>
|