<?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, acc_source, status, PnL, bl_sheet
    FROM accounts
    WHERE id = ?
");

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