}
    public function delete_flight_details($con, $flight_id)
    {
        $sql = mysqli_query($con, "DELETE FROM flight_details WHERE flight_id='{$flight_id}'");
        $sql1 = mysqli_query($con, "DELETE from flight_availability WHERE flight_id='{$flight_id}'");
        if ($sql && $sql1) {
            return true;
        } else {
            return false;
        }
    }
}
$user_object = new flight();
if (isset($_POST['flight_status'])) {
    $flight_id = $_POST['id'];
    $status = $user_object->flight_status($con, $flight_id);
    //echo mysqli_num_rows($status);
    if (mysqli_num_rows($status) == 0) {
        echo "Flight not available.";
    } else {
        $row = mysqli_fetch_array($status);
        $flight_status = $row['status'];
        $id = $row['flight_id'];
        $_SESSION['flight_id'] = $id;
        $_SESSION['flight_status'] = $flight_status;
        echo $_SESSION['flight_status'];
        $sql1 = mysqli_query($con, "SELECT * FROM flight_details WHERE flight_id='{$id}'");
        $row1 = mysqli_fetch_array($sql1);
        $_SESSION['source'] = $row1['source'];
        $_SESSION['destination'] = $row1['destination'];
        $_SESSION['flight_depart'] = $row1['flight_depart'];