<?php
require_once __DIR__ . '/config/database.php';
$db = getDB();

// Check total dana_pensiun records
$result = $db->query("SELECT COUNT(*) as count FROM simpanan WHERE jenis='dana_pensiun'")->fetch();
?>
<pre>
Total dana_pensiun records: <?= $result['count'] ?>

Latest 5 records:
<?php
$records = $db->query("SELECT s.id, s.anggota_id, a.nama, s.tipe, s.jumlah, s.tanggal FROM simpanan s LEFT JOIN anggota a ON s.anggota_id=a.id WHERE s.jenis='dana_pensiun' ORDER BY s.id DESC LIMIT 5")->fetchAll();
echo json_encode($records, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
?>

All jenis values in simpanan:
<?php
$jenis = $db->query("SELECT DISTINCT jenis FROM simpanan")->fetchAll();
echo json_encode($jenis, JSON_PRETTY_PRINT);
?>
</pre>
