feat(bank-data): tambahkan filter tahun pada data bank
- Menambahkan dropdown untuk memilih tahun pada halaman data bank. - Memperbarui logika kueri untuk menyaring data berdasarkan tahun yang dipilih.
This commit is contained in:
@@ -227,6 +227,10 @@
|
|||||||
$query->ofAssetType($search['jenis_asset']);
|
$query->ofAssetType($search['jenis_asset']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($search['tahun']) {
|
||||||
|
$query->where('tahun', $search['tahun']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($search['start_date'] && $search['end_date']) {
|
if ($search['start_date'] && $search['end_date']) {
|
||||||
$query->betweenDates($search['start_date'], $search['end_date']);
|
$query->betweenDates($search['start_date'], $search['end_date']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,15 @@
|
|||||||
<!-- Add village options here -->
|
<!-- Add village options here -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</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>
|
<div>
|
||||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
<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">
|
<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 = {
|
const markerColors = {
|
||||||
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
||||||
penilaian: 'http://maps.google.com/mapfiles/ms/icons/blue-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) {
|
if (lat && lng) {
|
||||||
|
|||||||
Reference in New Issue
Block a user