feat: add data completeness indicator badge to province table
This commit is contained in:
@@ -17,9 +17,12 @@ class ProvinsiController extends Controller
|
|||||||
$perPage = $request->query('per_page', 10);
|
$perPage = $request->query('per_page', 10);
|
||||||
$search = $request->query('search', '');
|
$search = $request->query('search', '');
|
||||||
|
|
||||||
$provinsi = Provinsi::where('nama', 'like', "%$search%")
|
$provinsi = Provinsi::withCount('kabupatenKota')
|
||||||
->orWhere('kode', 'like', "%$search%")
|
->where(function($query) use ($search) {
|
||||||
->orWhere('iso', 'like', "%$search%")
|
$query->where('nama', 'like', "%$search%")
|
||||||
|
->orWhere('kode', 'like', "%$search%")
|
||||||
|
->orWhere('iso', 'like', "%$search%");
|
||||||
|
})
|
||||||
->paginate($perPage);
|
->paginate($perPage);
|
||||||
|
|
||||||
return view('master.provinsi.index', compact('title', 'provinsi'));
|
return view('master.provinsi.index', compact('title', 'provinsi'));
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container-xxl flex-grow-1 container-p-y">
|
<div class="container-xxl flex-grow-1 container-p-y">
|
||||||
|
<div class="mb-6">
|
||||||
|
<x-wilayah-dashboard />
|
||||||
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body border-bottom">
|
<div class="card-body border-bottom">
|
||||||
<form method="GET" action="{{ route('provinsi.index') }}" class="d-flex justify-content-between align-items-center row gap-3 gap-md-0">
|
<form method="GET" action="{{ route('provinsi.index') }}" class="d-flex justify-content-between align-items-center row gap-3 gap-md-0">
|
||||||
@@ -35,6 +38,7 @@
|
|||||||
<th>No</th>
|
<th>No</th>
|
||||||
<th>Kode Provinsi</th>
|
<th>Kode Provinsi</th>
|
||||||
<th>Nama Provinsi</th>
|
<th>Nama Provinsi</th>
|
||||||
|
<th class="text-center">Status Kelengkapan</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -62,6 +66,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td class="text-center">
|
||||||
|
@if($prov->kabupaten_kota_count > 0)
|
||||||
|
<span class="badge bg-label-success d-inline-flex align-items-center" style="border-radius: 20px; padding: 6px 10px;">
|
||||||
|
<i class="ti tabler-check me-1" style="font-size: 16px;"></i> Aktif (Ada Kabupaten)
|
||||||
|
</span>
|
||||||
|
@else
|
||||||
|
<span class="badge bg-label-warning d-inline-flex align-items-center" style="border-radius: 20px; padding: 6px 10px;">
|
||||||
|
<i class="ti tabler-alert-circle me-1" style="font-size: 16px;"></i> Belum Ada Wilayah
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill edit-record" data-id="{{ $prov->id }}"><i class="ti tabler-edit ti-md"></i></a>
|
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill edit-record" data-id="{{ $prov->id }}"><i class="ti tabler-edit ti-md"></i></a>
|
||||||
@@ -72,7 +89,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
@empty
|
@empty
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-center py-4">Tidak ada data ditemukan.</td>
|
<td colspan="5" class="text-center py-4">Tidak ada data ditemukan.</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user