Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -66,6 +66,15 @@
|
||||
<!-- Add village options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tahun" class="block text-sm font-medium text-gray-700">Tahun</label>
|
||||
<select id="tahun" name="tahun" class="select tomselect w-full @error('tahun') border-danger bg-danger-light @enderror">
|
||||
<option value="">Semua Tahun</option>
|
||||
@for ($year = date('Y'); $year >= 2000; $year--)
|
||||
<option value="{{ $year }}">{{ $year }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||
<input type="date" id="start_date" name="start_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
@@ -253,7 +262,7 @@
|
||||
const markerColors = {
|
||||
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
||||
penilaian: 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
|
||||
input_manual: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'
|
||||
input: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'
|
||||
};
|
||||
|
||||
if (lat && lng) {
|
||||
|
||||
257
resources/views/laporan_permohonan/index.blade.php
Normal file
257
resources/views/laporan_permohonan/index.blade.php
Normal file
@@ -0,0 +1,257 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-permohonan') }}--}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-permohonan-table" data-api-url="{{ route('laporan-permohonan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Permohonan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Permohonan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-permohonan.export') }}" id="export-btn"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return window.formatTanggalIndonesia(data.tanggal_permohonan);
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.branch ? data.branch.name : '';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
console.log(data);
|
||||
return data.tujuan_penilaian ? data.tujuan_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return data.jenis_fasilitas_kredit ? data.jenis_fasilitas_kredit.name : '';
|
||||
},
|
||||
},
|
||||
jenis_penilaian: {
|
||||
title: 'Jenis Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.jenis_penilaian ? data.jenis_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
user: {
|
||||
title: 'Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user ? data.user.name : '';
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let statusClass = '';
|
||||
let statusText = '';
|
||||
|
||||
switch (data.status) {
|
||||
case 'pending':
|
||||
statusClass = 'badge-warning';
|
||||
statusText = 'Pending';
|
||||
break;
|
||||
case 'approved':
|
||||
statusClass = 'badge-success';
|
||||
statusText = 'Approved';
|
||||
break;
|
||||
case 'rejected':
|
||||
statusClass = 'badge-danger';
|
||||
statusText = 'Rejected';
|
||||
break;
|
||||
default:
|
||||
statusClass = 'badge-secondary';
|
||||
statusText = data.status;
|
||||
}
|
||||
|
||||
return `<span class="badge ${statusClass}">${statusText}</span>`;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user