120 lines
6.1 KiB
PHP
120 lines
6.1 KiB
PHP
@use('App\Services\Produktivitas\KelengkapanPetani')
|
|
|
|
@if (($bagian ?? 'tabel') === 'rincian')
|
|
{{-- ============ Isi kartu rincian: petani yang diinput enumerator ini ============ --}}
|
|
<div class="d-flex align-items-center mb-6">
|
|
<div class="avatar avatar-md me-3 flex-shrink-0">
|
|
<span class="avatar-initial rounded bg-label-primary">{{ Str::upper(Str::substr($user->name, 0, 2)) }}</span>
|
|
</div>
|
|
<div style="min-width: 0;">
|
|
<h6 class="mb-0 text-truncate">{{ $user->name }}</h6>
|
|
<small class="d-block text-body-secondary">{{ $daftarPetani->count() }} petani diinput</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive text-nowrap">
|
|
<table class="table table-sm table-hover mb-0">
|
|
<thead class="border-top">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Nama Petani</th>
|
|
<th class="text-center" title="Pertanyaan skor Kesiapan Adopsi">Skor</th>
|
|
<th class="text-center" title="Isian yang dipakai dashboard">Wajib</th>
|
|
<th class="text-center" title="Isian lainnya">Lainnya</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($daftarPetani as $item)
|
|
@php $r = $ringkasan[$item->id]; @endphp
|
|
<tr>
|
|
<td>{{ $loop->iteration }}</td>
|
|
<td class="text-wrap">
|
|
<a href="{{ route('petani.edit', $item->id) }}" class="text-heading fw-medium">{{ $item->nama }}</a>
|
|
<small class="d-block text-body-secondary">{{ $item->komoditas?->nama ?? '-' }}</small>
|
|
</td>
|
|
@foreach (['skor', 'wajib', 'lainnya'] as $jenis)
|
|
<td class="text-center">
|
|
<span class="badge bg-label-{{ KelengkapanPetani::warna($r[$jenis]) }}">{{ $r[$jenis]['terisi'] }}/{{ $r[$jenis]['total'] }}</span>
|
|
</td>
|
|
@endforeach
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="text-center py-4">Belum ada petani.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@else
|
|
{{-- ============ Tabel enumerator; klik jumlah petani → kartu rincian ============ --}}
|
|
<div class="monitoring-split">
|
|
<div class="kolom-tabel">
|
|
<form method="GET" action="{{ route('monitoring-verifikasi.petani.monitoring') }}" class="d-flex justify-content-between align-items-center row gap-3 gap-md-0 mb-4">
|
|
<input type="hidden" name="sub" value="enumerator">
|
|
<div class="col-md-auto">
|
|
<div class="d-flex align-items-center">
|
|
<label class="me-2 text-nowrap">Show</label>
|
|
<select name="per_page_enumerator" class="form-select form-select-sm w-auto" onchange="this.form.submit()">
|
|
@foreach ($perPage as $n)
|
|
<option value="{{ $n }}" @selected($enumerator->perPage() == $n)>{{ $n }}</option>
|
|
@endforeach
|
|
</select>
|
|
<label class="ms-2 text-nowrap">entries</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-auto">
|
|
<div class="input-group input-group-sm w-auto">
|
|
<input type="text" name="search_enumerator" class="form-control" placeholder="Cari nama enumerator..." value="{{ request('search_enumerator') }}">
|
|
<button type="submit" class="btn btn-outline-primary"><i class="icon-base ti tabler-search"></i></button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="table-responsive text-nowrap">
|
|
<table class="table table-hover">
|
|
<thead class="border-top">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Enumerator</th>
|
|
<th class="text-center">Jumlah Petani</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($enumerator as $index => $user)
|
|
<tr>
|
|
<td>{{ $enumerator->firstItem() + $index }}</td>
|
|
<td>
|
|
<span class="text-heading fw-medium d-block">{{ $user->name }}</span>
|
|
<small class="text-body-secondary">{{ $user->email }}</small>
|
|
</td>
|
|
<td class="text-center">
|
|
@if ($user->jumlah_petani > 0)
|
|
<button type="button" class="btn btn-sm btn-label-primary btn-buka-rincian"
|
|
data-url="{{ route('monitoring-verifikasi.petani.monitoring.enumerator', $user->id) }}"
|
|
data-judul="Petani oleh {{ $user->name }}" title="Lihat petani yang diinput">
|
|
{{ $user->jumlah_petani }} petani
|
|
</button>
|
|
@else
|
|
<span class="badge bg-label-secondary">0 petani</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="3" class="text-center py-4">Tidak ada data ditemukan.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-center justify-content-md-end border-top pt-4">
|
|
{{ $enumerator->links('pagination::bootstrap-5') }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="kolom-detail" aria-hidden="true"></div>
|
|
</div>
|
|
@endif
|