<?php
include '../config/database.php';
$db = new Database();
$conn = $db->getConnection();

$id = $_POST['id'];
$stmt = $conn->prepare("SELECT * FROM keuangan WHERE id=?");
$stmt->execute([$id]);
$data = $stmt->fetch(PDO::FETCH_ASSOC);

header('Content-Type: application/json');
echo json_encode(['data' => $data]);
?>