<?php
require_once "../../includes/db.php";
header('Content-Type: application/json');

$id = $_POST['id'] ?? 0;

$stmt = $pdo->prepare("
    SELECT id, co_id, acc_name, acc_type , acc_categ , entry_form, status, PnL, bl_sheet
    FROM accounts
    WHERE id = ?
");

$stmt->execute([$id]);
echo json_encode($stmt->fetch(PDO::FETCH_ASSOC));
exit;