<?php
global $bp, $wpdb;

?>
<form action="<?php echo $bp->root_domain . '/eventos-create/' ?>" method="POST" id="create-event-form" class="standard-form" enctype="multipart/form-data">
        <div class="left-menu" style="width: 315px;">
        <script type="text/javascript">
var $ = jQuery;
$(document).ready( function() {
    $('#messages-seleted').click(function(){
        
        var Lis = $('#invite-list li').length;
        var CountList = 0;
        
        for ( x=0; x<Lis;) {
            if ($('#invite-list li p.invite').eq(x).length != 0) {
                $('#invite-list li p.invite').eq(x).click();
            }
            x++;
        }
    });
    
});
</script>
            <div id="invite-list" style="width: 300px;">
                <ul class="event-<?php echo $idEventCreate; ?>">
                    <?php
                    foreach (friends_get_friend_user_ids(wp_get_current_user()->ID) as $id_friend) {
                        echo '<li id="send-invite" class="friend-'.get_userdata($id_friend)->ID.'">' . 
                        jes_get_member_avatar('id='.get_userdata($id_friend)->ID.'&alt='.get_userdata($id_friend)->display_name.'&height=40&width=40') .
                        get_userdata($id_friend)->display_name . '<p class="invite">' . __('Enviar Invitación', 'buddypress') . '</p>' . '<p class="send-invite" style="display: none; color: green;">' . __('Invitación Enviada', 'buddypress') . '</p>' .
                        '</li>';
                    }
                    ?>
                </ul>
            </div>
            
             <p id="messages-seleted">
                <?php _e('Invitar a todos mis amigos', 'buddypress'); ?>
            </p>
        </div><!-- .left-menu -->

        <div class="main-column" style="margin-left: 266px;">
            <div id="message" class="info">
                <p><?php _e('Select people to invite from your friends list.', 'buddypress'); ?></p>
            </div>
        </div><!-- .main-column -->
    <input type="hidden" name="event" value="<?php echo $idEventCreate; ?>">
    <input type="submit" name="Terminar" id="custom-event-invites" value="<?php _e('Terminar', 'buddypress'); ?>" style=" margin-top: 15px; float: right; " />
</form>