<?php
    try {
        include("../main.php");
        $request = json_decode(file_get_contents('php://input'));
        extract((array) $request);
        $query = "SELECT * FROM `bookings` WHERE `status` = '1' ORDER BY `id` DESC";
        $dbobjx->query($query);
        $result = $dbobjx->resultset();
        if (count($result) > 0 && !empty($result)) {
            echo response(1, "SUCCESSFULLY OPERATED", $result);
        } else {
            echo response(0, "BAD REQUEST!", []);
        }
        $dbobjx->close();
    } catch (Exception $error) {
        echo response(0, "API ERROR!, UNPROCESSABLE ENTITY", $error->getMessage());
    }
#code ends
#mtech