<?php require_once __DIR__.'/includes/db.php'; if(session_status()===PHP_SESSION_NONE) session_start(); if(!isset($_SESSION['uid'])){header('Location: login.php'); exit;} include __DIR__.'/includes/header.php';
$c_prof=$mysqli->query("SELECT COUNT(*) c FROM profil_desa")->fetch_assoc()['c'];
$c_lem=$mysqli->query("SELECT COUNT(*) c FROM lembaga")->fetch_assoc()['c'];
$c_info=$mysqli->query("SELECT COUNT(*) c FROM infografis")->fetch_assoc()['c'];
$c_berita=$mysqli->query("SELECT COUNT(*) c FROM berita")->fetch_assoc()['c'];
$c_galeri=$mysqli->query("SELECT COUNT(*) c FROM galeri")->fetch_assoc()['c'];
$c_peng=$mysqli->query("SELECT COUNT(*) c FROM pengumuman")->fetch_assoc()['c']; ?>
<div class="card" style="padding:18px"><div class="kpi">
<div class="item"><span>Profil</span><strong><?php echo $c_prof; ?></strong></div>
<div class="item"><span>Lembaga</span><strong><?php echo $c_lem; ?></strong></div>
<div class="item"><span>Infografis</span><strong><?php echo $c_info; ?></strong></div>
<div class="item"><span>Berita</span><strong><?php echo $c_berita; ?></strong></div>
<div class="item"><span>Galeri</span><strong><?php echo $c_galeri; ?></strong></div>
<div class="item"><span>Pengumuman</span><strong><?php echo $c_peng; ?></strong></div>
</div></div>
<?php include __DIR__.'/includes/footer.php'; ?>