%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php
/**
* Halaman detail dokumen informasi publik.
*/
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/includes/queries.php';
$id = (int) get_param('id', '0');
$dok = $id ? get_dokumen($id) : null;
if (!$dok || $dok['status'] !== 'publish') {
http_response_code(404);
$pageTitle = 'Dokumen tidak ditemukan';
require __DIR__ . '/partials/head.php';
require __DIR__ . '/partials/navbar.php';
echo '<main class="max-w-3xl mx-auto px-4 py-24 text-center w-full">'
. '<i class="fas fa-file-circle-question text-5xl text-slate-300 mb-4"></i>'
. '<h1 class="text-2xl font-bold text-slate-800 mb-2">Dokumen Tidak Ditemukan</h1>'
. '<p class="text-slate-500 mb-6">Dokumen yang Anda cari tidak tersedia atau telah dihapus.</p>'
. '<a href="' . e(url('informasi.php')) . '" class="inline-flex items-center gap-2 bg-mateng-green text-white px-5 py-2.5 rounded-lg font-semibold">'
. '<i class="fas fa-arrow-left"></i> Kembali ke Daftar Informasi</a></main>';
require __DIR__ . '/partials/footer.php';
exit;
}
// Tambah penghitung dilihat.
$upd = db()->prepare('UPDATE dokumen_informasi SET views = views + 1 WHERE id = ?');
$upd->execute([$id]);
$c = kategori_warna($dok['warna'] ?? 'slate');
$adaFile = !empty($dok['file_name']) && is_file(UPLOAD_PATH . '/dokumen/' . $dok['file_name']);
$pageTitle = $dok['judul'] . ' — ' . APP_NAME_SHORT;
$activeNav = $dok['kategori_tipe'] === 'regulasi' ? 'regulasi' : 'layanan';
require __DIR__ . '/partials/head.php';
require __DIR__ . '/partials/navbar.php';
?>
<main class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-10 w-full">
<nav class="text-sm text-slate-500 mb-6">
<a href="<?= e(url('index.php')) ?>" class="hover:text-mateng-green">Beranda</a>
<span class="mx-2">/</span>
<a href="<?= e(url('informasi.php?kategori=' . $dok['kategori_slug'])) ?>" class="hover:text-mateng-green"><?= e($dok['kategori_nama']) ?></a>
<span class="mx-2">/</span>
<span class="text-slate-700">Detail</span>
</nav>
<article class="bg-white rounded-2xl border border-slate-100 shadow-sm overflow-hidden">
<div class="p-8 border-b border-slate-100">
<div class="flex items-center gap-3 mb-5">
<div class="w-12 h-12 <?= $c['icon_bg'] ?> <?= $c['icon_text'] ?> rounded-xl flex items-center justify-center text-xl">
<i class="fas <?= e($dok['icon'] ?? 'fa-file') ?>"></i>
</div>
<span class="px-3 py-1 rounded-full bg-slate-100 text-slate-600 text-xs font-semibold uppercase tracking-wide"><?= e($dok['kategori_nama']) ?></span>
</div>
<h1 class="text-2xl md:text-3xl font-bold text-slate-900 leading-snug mb-4"><?= e($dok['judul']) ?></h1>
<div class="flex flex-wrap gap-4 text-sm text-slate-500">
<?php if ($dok['tahun']): ?><span><i class="far fa-calendar mr-1.5"></i>Tahun <?= e($dok['tahun']) ?></span><?php endif; ?>
<?php if ($dok['unit_kerja']): ?><span><i class="far fa-building mr-1.5"></i><?= e($dok['unit_kerja']) ?></span><?php endif; ?>
<span><i class="far fa-eye mr-1.5"></i><?= (int) $dok['views'] ?> kali dilihat</span>
<span><i class="fas fa-download mr-1.5"></i><?= (int) $dok['downloads'] ?> unduhan</span>
</div>
</div>
<div class="p-8">
<h2 class="font-bold text-slate-800 mb-3">Deskripsi</h2>
<p class="text-slate-600 leading-relaxed whitespace-pre-line"><?= e($dok['deskripsi'] ?: 'Tidak ada deskripsi.') ?></p>
<div class="mt-8 bg-slate-50 border border-slate-200 rounded-xl p-5 flex flex-col sm:flex-row items-center gap-4">
<?php if ($adaFile): ?>
<div class="flex items-center gap-3 flex-grow">
<i class="fas <?= e(file_icon($dok['file_original'] ?? $dok['file_name'])) ?> text-3xl"></i>
<div>
<p class="font-semibold text-slate-800 text-sm"><?= e($dok['file_original'] ?: 'Berkas dokumen') ?></p>
<p class="text-xs text-slate-500"><?= e(format_size((int) $dok['file_size'])) ?></p>
</div>
</div>
<a href="<?= e(url('unduh.php?id=' . $dok['id'])) ?>" class="w-full sm:w-auto text-center bg-mateng-green hover:bg-green-700 text-white px-6 py-3 rounded-lg font-semibold transition-colors flex items-center justify-center gap-2">
<i class="fas fa-download"></i> Unduh Dokumen
</a>
<?php else: ?>
<div class="flex items-center gap-3 text-slate-500">
<i class="fas fa-circle-info text-xl"></i>
<p class="text-sm">Berkas dokumen belum tersedia untuk diunduh. Anda dapat mengajukan permohonan informasi untuk memperoleh dokumen ini.</p>
</div>
<?php endif; ?>
</div>
<div class="mt-6 flex flex-wrap gap-3">
<a href="<?= e(url('informasi.php?kategori=' . $dok['kategori_slug'])) ?>" class="inline-flex items-center gap-2 text-slate-600 hover:text-mateng-green text-sm font-medium">
<i class="fas fa-arrow-left"></i> Kembali ke <?= e($dok['kategori_nama']) ?>
</a>
<a href="<?= e(url('permohonan.php')) ?>" class="inline-flex items-center gap-2 text-mateng-blue hover:underline text-sm font-medium ml-auto">
<i class="fas fa-paper-plane"></i> Ajukan Permohonan Informasi
</a>
</div>
</div>
</article>
</main>
<?php require __DIR__ . '/partials/footer.php'; ?>