<?php
include 'confing.php';

header('Content-Type: application/json');

if (isset($_GET['user_id'])) {
    $user_id = $_GET['user_id'];
    $query = "SELECT id, vendor_name, service_name, vendor_address, service_charge, vendor_image FROM booking WHERE user_id = '$user_id' AND status = 1";
    $result = mysqli_query($conn, $query);

    $data = [];

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

    echo json_encode($data);
} else {
    echo json_encode(["error" => "user_id not provided"]);
}
?>
