MIF_E31231754/resources/views/admin/exports/pdf.blade.php

351 lines
9.6 KiB
PHP

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Laporan Hasil SAW {{ $periode->nama }}</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'DejaVu Sans', sans-serif;
font-size: 11px;
color: #000;
background: #fff;
margin: 20px 30px;
}
/* ── KOP SURAT ── */
.kop {
display: table;
width: 100%;
border-bottom: 3px solid #000;
padding-bottom: 8px;
margin-bottom: 4px;
}
.kop-logo {
display: table-cell;
width: 70px;
vertical-align: middle;
text-align: center;
}
.kop-logo img {
width: 62px;
height: 62px;
}
.kop-teks {
display: table-cell;
vertical-align: middle;
text-align: center;
padding: 0 10px;
}
.kop-teks .baris1 {
font-size: 11px;
font-weight: normal;
}
.kop-teks .baris2 {
font-size: 11px;
font-weight: normal;
}
.kop-teks .baris3 {
font-size: 15px;
font-weight: bold;
letter-spacing: 1px;
}
.kop-teks .baris4 {
font-size: 9.5px;
margin-top: 2px;
}
/* ── JUDUL SURAT ── */
.judul {
text-align: center;
margin: 10px 0 2px;
}
.judul h3 {
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
text-decoration: underline;
letter-spacing: 0.5px;
}
.judul p {
font-size: 10px;
margin-top: 2px;
}
/* ── INFO PERIODE ── */
.info {
margin: 10px 0 12px;
font-size: 10.5px;
}
.info table {
border-collapse: collapse;
}
.info td {
padding: 1.5px 0;
vertical-align: top;
}
.info .lbl {
width: 140px;
}
.info .sep {
width: 10px;
}
/* ── TABEL DATA ── */
.tbl {
width: 100%;
border-collapse: collapse;
font-size: 10px;
margin-top: 4px;
}
.tbl thead tr {
background-color: #000;
color: #fff;
}
.tbl thead th {
padding: 5px 6px;
text-align: center;
border: 1px solid #000;
font-size: 10px;
}
.tbl tbody td {
padding: 4px 6px;
border: 1px solid #555;
vertical-align: middle;
}
.tbl tbody tr:nth-child(even) {
background-color: #f5f5f5;
}
.tbl .center {
text-align: center;
}
.tbl .mono {
font-family: monospace;
font-size: 9.5px;
}
/* ── RINGKASAN ── */
.ringkasan {
margin-top: 10px;
font-size: 10px;
}
.ringkasan table {
border-collapse: collapse;
}
.ringkasan td {
padding: 2px 6px;
border: 1px solid #aaa;
}
.ringkasan .lbl-r {
background: #eee;
font-weight: bold;
}
/* ── TTD ── */
.ttd {
margin-top: 30px;
text-align: right;
font-size: 10.5px;
}
.ttd .kota-tgl {
margin-bottom: 4px;
}
.ttd .jabatan {
margin-bottom: 48px;
}
.ttd .garis {
display: inline-block;
border-top: 1px solid #000;
width: 180px;
padding-top: 3px;
text-align: center;
font-weight: bold;
}
/* ── CATATAN KAKI ── */
.catatan {
margin-top: 20px;
font-size: 8.5px;
color: #555;
border-top: 1px dashed #aaa;
padding-top: 5px;
}
</style>
</head>
<body>
{{-- ══════════ KOP SURAT ══════════ --}}
@php
$logoPath = public_path('images/logo-kab.png');
$logoData = file_exists($logoPath)
? 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath))
: '';
@endphp
<div class="kop">
<div class="kop-logo">
@if($logoData)
<img src="{{ $logoData }}" alt="Logo">
@endif
</div>
<div class="kop-teks">
<div class="baris1">PEMERINTAH KABUPATEN MOJOKERTO</div>
<div class="baris2">KECAMATAN PUNGGING</div>
<div class="baris3">DESA PUNGGING</div>
<div class="baris4">Jalan Raya Pungging No. 27 Pungging, Mojokerto, Jawa Timur</div>
<div class="baris4">Kode Pos 61384 &nbsp;&nbsp; Telp. (0321) 532733</div>
</div>
</div>
{{-- ══════════ JUDUL ══════════ --}}
<div class="judul">
<h3>Laporan Hasil Seleksi Penerima BLT Dana Desa</h3>
<p>Metode Simple Additive Weighting (SAW) Sistem Pendukung Keputusan</p>
</div>
{{-- ══════════ INFO PERIODE ══════════ --}}
<div class="info">
<table>
<tr>
<td class="lbl">Periode Seleksi</td>
<td class="sep">:</td>
<td>{{ $periode->nama }}</td>
</tr>
<tr>
<td class="lbl">Tanggal</td>
<td class="sep">:</td>
<td>
{{ \Carbon\Carbon::parse($periode->tanggal_mulai)->translatedFormat('d F Y') }}
&nbsp;s.d.&nbsp;
{{ \Carbon\Carbon::parse($periode->tanggal_selesai)->translatedFormat('d F Y') }}
</td>
</tr>
<tr>
<td class="lbl">Kuota Penerima</td>
<td class="sep">:</td>
<td>{{ $periode->kuota_penerima }} orang</td>
</tr>
<tr>
<td class="lbl">Status</td>
<td class="sep">:</td>
<td>{{ ucfirst($periode->status) }}</td>
</tr>
<tr>
<td class="lbl">Dicetak</td>
<td class="sep">:</td>
<td>
{{ \Carbon\Carbon::now()->translatedFormat('d F Y') }},
pukul {{ \Carbon\Carbon::now()->format('H:i') }} WIB
</td>
</tr>
</table>
</div>
{{-- ══════════ TABEL HASIL ══════════ --}}
<table class="tbl">
<thead>
<tr>
<th style="width:28px;">No</th>
<th style="width:50px;">Ranking</th>
<th>Nama Warga</th>
<th style="width:110px;">NIK</th>
<th style="width:70px;">Dusun</th>
<th style="width:30px;">RW</th>
<th style="width:75px;">Skor SAW</th>
<th style="width:65px;">Status</th>
</tr>
</thead>
<tbody>
@forelse($hasil as $i => $h)
<tr>
<td class="center">{{ $i + 1 }}</td>
<td class="center">#{{ $h->ranking }}</td>
<td>{{ $h->warga->nama ?? '-' }}</td>
<td class="center mono">{{ substr($h->warga->nik ?? '', 0, 8) . '********' }}</td>
<td>{{ $h->warga->dusun ?? '-' }}</td>
<td class="center">{{ $h->warga->rw ?? '-' }}</td>
<td class="center mono">{{ number_format($h->skor_akhir, 6) }}</td>
<td class="center">
@if($h->status === 'penerima') Penerima
@else Tidak
@endif
</td>
</tr>
@empty
<tr>
<td colspan="8" class="center" style="padding:12px; color:#999;">
Belum ada data.
</td>
</tr>
@endforelse
</tbody>
</table>
{{-- ══════════ RINGKASAN ══════════ --}}
@php
$jmlPenerima = $hasil->where('status', 'penerima')->count();
$jmlTidak = $hasil->where('status', '!=', 'penerima')->count();
@endphp
<div class="ringkasan">
<table>
<tr>
<td class="lbl-r">Total Peserta</td>
<td>{{ $hasil->count() }} orang</td>
<td class="lbl-r" style="padding-left:16px;">Penerima BLT</td>
<td>{{ $jmlPenerima }} orang</td>
<td class="lbl-r" style="padding-left:16px;">Tidak Menerima</td>
<td>{{ $jmlTidak }} orang</td>
</tr>
</table>
</div>
{{-- ══════════ TANDA TANGAN ══════════ --}}
<div class="ttd">
<div class="kota-tgl">
Pungging, {{ \Carbon\Carbon::now()->translatedFormat('d F Y') }}
</div>
<div class="jabatan">Kepala Desa Pungging</div>
<div class="garis">( ________________________ )</div>
</div>
{{-- ══════════ CATATAN KAKI ══════════ --}}
<div class="catatan">
* NIK disamarkan (8 digit terakhir) untuk menjaga privasi data warga. &nbsp;|&nbsp;
Dokumen ini digenerate otomatis oleh Sistem SPK BLT-DD.
</div>
</body>
</html>