<?php
header('Content-Type: application/json');
$trx_id = $_GET['id'] ?? '';

if ($trx_id) {
    $file = 'data/' . $trx_id . '.json';
    if (file_exists($file)) {
        unlink($file);
        echo json_encode(['status' => 'success', 'message' => 'PO Deleted']);
        exit;
    }
}
echo json_encode(['status' => 'error', 'message' => 'File not found']);
?>