<?php
include "config.php";

if (isset($_POST['comply_order_id'])) {
    $comply_order_id = mysqli_real_escape_string($con, $_POST['comply_order_id']);

    $query = "SELECT cbd.id, cbd.comply_order_id, cbd.bank_id, b.b_name AS bank_name, cbd.account_number, cbd.ifsc_code, cbd.account_holder, cbd.release_amount, cbd.remarks, b.timestamp FROM c_bank_data AS cbd INNER JOIN bank AS b ON cbd.bank_id = b.id WHERE cbd.comply_order_id = '$comply_order_id'";

    $result = mysqli_query($con, $query);

    $data = [];
    while ($row = mysqli_fetch_assoc($result)) {
        $data[] = $row;
    }

    header('Content-Type: application/json');
    echo json_encode($data);
}
?>