<?php
require_once "../../includes/db.php";

$id              = $_POST['edit_Ledg_id'];
$name            = $_POST['edit_account_name'];
$acc_type        = $_POST['edit_acc_type'];
$entry_form      = $_POST['edit_entry_form'];
$acc_categ       = $_POST['edit_acc_categ'];
$acc_source      = $_POST['edit_acc_source'];
$status          = $_POST['edit_status'];
$pnl             = $_POST['edit_pnl'];
$bl_sheet        = $_POST['edit_bl_sheet'];


$stmt = $pdo->prepare("
    UPDATE accounts 
    SET acc_name = ?, 
        acc_type = ?, 
        entry_form = ?, 
        acc_categ = ?,
        acc_source =?,
        status = ?, 
        PnL = ?, 
        bl_sheet = ?
    WHERE id = ?
");

$stmt->execute([
    $name,
    $acc_type,
    $entry_form,
    $acc_categ,
    $acc_source,
    $status,
    $pnl,
    $bl_sheet,
    $id
]);

echo "success";
exit;