219 lines
8.3 KiB
PHP
219 lines
8.3 KiB
PHP
<!--begin::Table-->
|
|
{{ $dataTable->table() }}
|
|
<!--end::Table-->
|
|
|
|
{{-- Inject Scripts --}}
|
|
@section('scripts')
|
|
<script>
|
|
$(function() {
|
|
var keterangan = "";
|
|
window.LaravelDataTables = window.LaravelDataTables || {};
|
|
window.LaravelDataTables["konfirmasibank-table"] = $("#konfirmasibank-table").DataTable({
|
|
"serverSide": true,
|
|
"processing": true,
|
|
"ajax": {
|
|
"url": "{{ route('konfirmasibank.index') }}",
|
|
"type": "GET",
|
|
"data": function(data) {
|
|
for (var i = 0, len = data.columns.length; i < len; i++) {
|
|
if (!data.columns[i].search.value) delete data.columns[i].search;
|
|
if (data.columns[i].searchable === true) delete data.columns[i].searchable;
|
|
if (data.columns[i].orderable === true) delete data.columns[i].orderable;
|
|
if (data.columns[i].data === data.columns[i].name) delete data.columns[i]
|
|
.name;
|
|
}
|
|
delete data.search.regex;
|
|
data.kodebank = $('#kodebank').val();
|
|
data.periode = $('#periode').val();
|
|
}
|
|
},
|
|
"columns": [{
|
|
"data": "DT_RowIndex",
|
|
"name": "DT_RowIndex",
|
|
"title": "No",
|
|
"orderable": false,
|
|
"searchable": false
|
|
}, {
|
|
"data": "account_number",
|
|
"name": "account_number",
|
|
"title": "No Rekening",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-center"
|
|
}, {
|
|
"data": "co_code",
|
|
"name": "co_code",
|
|
"title": "Cabang",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-left"
|
|
}, {
|
|
"data": "product",
|
|
"name": "product",
|
|
"title": "Jenis Rekening",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-center"
|
|
}, {
|
|
"data": "currency",
|
|
"name": "currency",
|
|
"title": "Mata Uang",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-center"
|
|
}, {
|
|
"data": "working_balance",
|
|
"name": "working_balance",
|
|
"title": "Saldo",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-center"
|
|
}, {
|
|
"data": "batch_date",
|
|
"name": "batch_date",
|
|
"title": "Periode",
|
|
"orderable": true,
|
|
"searchable": true,
|
|
"className": "text-center"
|
|
}, {
|
|
"data": "action",
|
|
"name": "action",
|
|
"title": "Action",
|
|
"orderable": false,
|
|
"searchable": false,
|
|
"className": "text-center accNo"
|
|
}],
|
|
"stateSave": false,
|
|
"responsive": true,
|
|
"autoWidth": true,
|
|
"order": [
|
|
[1, "desc"]
|
|
],
|
|
"scrollX": true,
|
|
"drawCallback": function() {
|
|
KTMenu.createInstances();
|
|
}
|
|
});
|
|
})
|
|
</script>
|
|
@endsection
|
|
|
|
@push('customscript')
|
|
@php
|
|
$route = explode('.', Route::currentRouteName());
|
|
@endphp
|
|
|
|
<script>
|
|
$("#btnSearch").on("click", function() {
|
|
var cif = $("#cif").val();
|
|
var kodecabang = $("#kodeCabang").val();
|
|
var periode = $("#peridoe").val();
|
|
$("input[name=cus_no]").val(cif)
|
|
$("input[name=kode_cabang]").val(kodecabang)
|
|
$("input[name=periode]").val(periode)
|
|
var data = [cif,kodecabang,periode];
|
|
LaravelDataTables["{{ $route[0] }}-table"].search(data).draw();
|
|
});
|
|
|
|
$(function() {
|
|
const documentTitle = '{{ ucfirst($route[0]) }} Report';
|
|
var buttons = new $.fn.dataTable.Buttons(LaravelDataTables["{{ $route[0] }}-table"], {
|
|
buttons: [{
|
|
extend: 'copyHtml5',
|
|
title: documentTitle
|
|
},
|
|
{
|
|
extend: 'excelHtml5',
|
|
title: documentTitle
|
|
},
|
|
{
|
|
extend: 'csvHtml5',
|
|
title: documentTitle
|
|
},
|
|
{
|
|
extend: 'pdfHtml5',
|
|
title: documentTitle
|
|
},
|
|
{
|
|
extend: 'print',
|
|
title: documentTitle
|
|
}
|
|
]
|
|
}).container().appendTo($('#kt_datatable_example_buttons'));
|
|
|
|
// Hook dropdown menu click event to datatable export buttons
|
|
const exportButtons = document.querySelectorAll('#kt_datatable_example_export_menu [data-kt-export]');
|
|
exportButtons.forEach(exportButton => {
|
|
exportButton.addEventListener('click', e => {
|
|
e.preventDefault();
|
|
// Get clicked export value
|
|
const exportValue = e.target.getAttribute('data-kt-export');
|
|
const target = document.querySelector('.dt-buttons .buttons-' + exportValue);
|
|
|
|
// Trigger click event on hidden datatable export buttons
|
|
target.click();
|
|
});
|
|
});
|
|
|
|
LaravelDataTables["{{ $route[0] }}-table"].on('click', '.btn-download', function(event) {
|
|
var form = $(this).closest("a");
|
|
event.preventDefault();
|
|
Swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "Request download file?",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: form.attr('href'), // serializes the form's elements.
|
|
success: function(data) {
|
|
toastr.success(
|
|
'{{ ucfirst($route[0]) }} menunggu approval untuk mencetak dokumen.',
|
|
'Success!', {
|
|
timeOut: 5000
|
|
});
|
|
LaravelDataTables["{{ $route[0] }}-table"].draw();
|
|
}
|
|
});
|
|
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
var acc_no = [];
|
|
LaravelDataTables["{{ $route[0] }}-table"].on('change', 'tr td.accNo input[type=checkbox]', function(event) {
|
|
var form = $(this).closest("form");
|
|
event.preventDefault();
|
|
if ($(this).is(':checked')) {
|
|
// Do something...
|
|
acc_no.push($(this).val());
|
|
$("input[name=acc_no]").val(acc_no)
|
|
};
|
|
})
|
|
|
|
var arr = [];
|
|
$("#selectAll").on('click', function() {
|
|
$("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
|
|
|
|
@section('styles')
|
|
<style>
|
|
.dataTables_filter {
|
|
display: none;
|
|
}
|
|
</style>
|
|
@endsection
|