add_action和函数不起作用

I have added the following code to try and add a table to an existing function within a WordPress plugin.

The code I am trying to add below just results in a blank page on my site (i.e Does not load).

The code is as below

function my_attendee_form ()
{
    $people = array();
    $EM_Bookings = $EM_Event->get_bookings();
    if (count($EM_Bookings->bookings) > 0) 
    {
        echo "
";
        ?>
        <table class="event-attendees">
            <tr class="">
                <th class="attendee-name">Name</th>
                <th class="attendee-country">Golf Link</th>
                <th class="attendee-discipline">Handicap</th>
                <th class="attendee-status">Home Club</th>
            </tr>
            <?php
            $guest_bookings = get_option('dbem_bookings_registration_disable');
            $guest_booking_user = get_option('dbem_bookings_registration_user');
            $counter = 0;
            foreach ($EM_Bookings as $EM_Booking) {
                $attendees_list = "";
                $attendees = $EM_Booking->booking_meta['attendees'];
                if (!empty($attendees)) {
                    $attendees_list = "";
                    foreach ($attendees as $key => $value) {
                        foreach ($value as $key_attendee => $value_attendee) {
                            $attendees_list .= "<tr>";
                            $attendees_list .= "<td>".$value_attendee["attendee_name"]."</td>";
                            $attendees_list .= "<td>".$value_attendee["golflink"]."</td>";
                            $attendees_list .= "<td>".$value_attendee["handicap"]."</td>";
                            $attendees_list .= "    <td>".$value_attendee["home_club"]."</td>";
                            $attendees_list .= "</tr>";
                        }
                    }   
                }
                echo $attendees_list;
            }
            echo "
";
            ?>
        </table>
        <?php
        if (count($EM_Bookings->bookings) == 0) 
        {
            echo '<p>No one registered yet... Will you be the first ?</p>'
        };

Is there any suggestions why this may fail?

The code itself works if I add it to a page as a HTML div, but when I add it to as a function no luck.

Any thoughts would be great?