<?php if(!empty($data['data'])) { ?>
    <?php foreach($data['data'] as $group) { ?>
        <tr>
            <td class="user-page">
                <img alt="" src="https://graph.facebook.com/<?php echo $group['id'];?>/picture" class="user-pic">
                <span class="user-name"><?php echo $group['name'];?> <?php echo ($group['closed']) ? '(Closed Group)' : ''?></span>
                                            <span class="user-info">
                                                <!--<span class="user-num"><?php echo $group['likes'];?> Fans</span>-->
                                                <a target="_blank" href="https://facebook.com/<?php echo $group['id'];?>" class="user-link"> <i class="fa fa-facebook"></i>View group </a>
                                            </span>
            </td>


            <td class="text-right">
                <?php if(!$group['closed']) { ?>
                    <a data-id="<?php echo $group['id'];?>" type="button" class="choose_page btn btn-gray btn-sm">
                        SELECT GROUP <i class="fa fa-arrow-right"></i>
                    </a>
                <?php } ?>
            </td>
        </tr>
    <?php }
} ;?>