1fcad7d9b2
- Add ExportController: allMiskinPDF (all data) + radiusMiskinPDF
(server-side Haversine filtering per ibadah radius)
- Add two table-based PDF Blade views (dompdf-compatible, no flexbox/grid)
- Add export routes (/export/pdf, /export/pdf/radius/{id}/{radius})
with numeric route constraints
- Add "Ekspor PDF" button to data tabular view
- Add CSV + PDF radius export buttons to map analysis panel;
exportRadiusCSV() reuses existing isInside(); PDF href synced on
ibadah click and radius slider change
- 5 new tests: access control, PDF content-type, 404 + param validation
- Mark K-04 and Section 5 (Cetak & Ekspor) complete in missing_features.md
- Update README with export features
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
82 lines
4.1 KiB
PHP
82 lines
4.1 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Laporan Radius {{ $ibadah->nama }}</title>
|
|
<style>
|
|
body { font-family: DejaVu Sans, sans-serif; font-size: 9px; color: #1f2937; margin: 20px; }
|
|
h1 { font-size: 15px; margin: 0 0 2px 0; }
|
|
.subtitle { font-size: 9px; color: #6b7280; margin: 0 0 12px 0; }
|
|
.info-box { border: 1px solid #d1d5db; padding: 7px 10px; margin-bottom: 10px; font-size: 9px; }
|
|
.info-row { margin-bottom: 2px; }
|
|
.info-label { display: inline-block; width: 100px; font-weight: bold; }
|
|
table { width: 100%; border-collapse: collapse; }
|
|
th { background: #1e40af; color: #fff; padding: 5px 6px; text-align: left; font-size: 8px; text-transform: uppercase; }
|
|
td { padding: 4px 6px; border-bottom: 1px solid #e5e7eb; font-size: 8px; vertical-align: top; }
|
|
tr:nth-child(even) td { background: #f9fafb; }
|
|
.footer { font-size: 7px; color: #9ca3af; text-align: right; border-top: 1px solid #e5e7eb; padding-top: 4px; margin-top: 10px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Laporan Radius: {{ $ibadah->nama }}</h1>
|
|
<p class="subtitle">WebGIS Pemetaan Kemiskinan — Dicetak: {{ now()->format('d/m/Y H:i') }} WIB</p>
|
|
|
|
<div class="info-box">
|
|
<div class="info-row"><span class="info-label">Rumah Ibadah:</span> {{ $ibadah->nama }} ({{ ucfirst($ibadah->jenis ?: '-') }})</div>
|
|
<div class="info-row"><span class="info-label">Alamat:</span> {{ $ibadah->alamat ?: '-' }}</div>
|
|
<div class="info-row"><span class="info-label">Pengurus:</span> {{ $ibadah->pengurus ?: '-' }}</div>
|
|
<div class="info-row"><span class="info-label">Radius Analisis:</span> {{ number_format($radius) }} meter</div>
|
|
</div>
|
|
|
|
<table style="width:auto; border-collapse:collapse; margin-bottom:12px;">
|
|
<tr>
|
|
<td style="border:1px solid #d1d5db; padding:6px 20px; text-align:center;">
|
|
<span style="font-size:18px; font-weight:bold; color:#1e40af; display:block;">{{ $miskin->count() }}</span>
|
|
<span style="font-size:7px; text-transform:uppercase; color:#6b7280;">Rumah</span>
|
|
</td>
|
|
<td style="border:1px solid #d1d5db; padding:6px 20px; text-align:center;">
|
|
<span style="font-size:18px; font-weight:bold; color:#dc2626; display:block;">{{ $totalKK }}</span>
|
|
<span style="font-size:7px; text-transform:uppercase; color:#6b7280;">KK</span>
|
|
</td>
|
|
<td style="border:1px solid #d1d5db; padding:6px 20px; text-align:center;">
|
|
<span style="font-size:18px; font-weight:bold; color:#d97706; display:block;">{{ $totalJiwa }}</span>
|
|
<span style="font-size:7px; text-transform:uppercase; color:#6b7280;">Jiwa</span>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width:20px">#</th>
|
|
<th style="width:70px">ID Rumah</th>
|
|
<th style="width:90px">Nama KK</th>
|
|
<th>Alamat</th>
|
|
<th style="width:20px">KK</th>
|
|
<th style="width:20px">Jiwa</th>
|
|
<th style="width:70px">Pekerjaan</th>
|
|
<th style="width:55px">Kondisi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($miskin as $i => $m)
|
|
<tr>
|
|
<td>{{ $i + 1 }}</td>
|
|
<td>{{ $m->id_rumah }}</td>
|
|
<td>{{ $m->nama_kk ?: '-' }}</td>
|
|
<td>{{ Str::limit($m->alamat, 40) }}</td>
|
|
<td style="text-align:center">{{ $m->jumlah_kk }}</td>
|
|
<td style="text-align:center">{{ $m->jumlah_orang }}</td>
|
|
<td>{{ $m->pekerjaan ?: '-' }}</td>
|
|
<td>{{ str_replace('_', ' ', $m->kondisi_rumah ?: '-') }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="8" style="text-align:center;padding:12px;">Tidak ada keluarga miskin dalam radius ini.</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
|
|
<p class="footer">Dokumen ini dibuat otomatis oleh sistem WebGIS Pemetaan Kemiskinan.</p>
|
|
</body>
|
|
</html>
|