<?php
include 'includes/config.php';
session_start();

$input = json_decode(file_get_contents('php://input'), true);
$id = $input['id'];
$amount = $input['amount'];

try {
    $query = "UPDATE cash_deposit SET amount = :amount WHERE id = :id";
    $stmt = $conn->prepare($query);
    $stmt->execute(['amount' => $amount, 'id' => $id]);
    
    echo json_encode(['success' => true]);
} catch (PDOException $e) {
    echo json_encode(['success' => false, 'error' => $e->getMessage()]);
}
