function render()
 {
     // invite status
     // if we have array of collection ids then find the invitation of each collection (group)
     if (is_array($this->collection_id_array) && count($this->collection_id_array) > 0) {
         $accepted = Invitation::get_accepted_invitations($_SESSION['user']['id'], '-1', $this->collection_id_array);
     } else {
         $accepted = Invitation::get_accepted_invitations($_SESSION['user']['id']);
     }
     $accepted_invitation = array();
     if (!empty($accepted)) {
         $i = 0;
         foreach ($accepted as $ac) {
             $inv_user = new User();
             $inv_user->load((int) $ac['inv_user_id']);
             $accepted_invitation[$i]['user_name'] = $inv_user->login_name;
             $accepted_invitation[$i]['first_name'] = $inv_user->first_name;
             $accepted_invitation[$i]['last_name'] = $inv_user->last_name;
             $accepted_invitation[$i]['picture'] = $inv_user->picture;
             $accepted_invitation[$i]['user_id'] = $inv_user->user_id;
             $i++;
         }
     }
     // if we have array of collection ids then find the invitation of each collection (group)
     if (is_array($this->collection_id_array) && count($this->collection_id_array) > 0) {
         $pending = Invitation::get_pending_invitations($_SESSION['user']['id'], '-1', $this->collection_id_array);
     } else {
         $pending = Invitation::get_pending_invitations($_SESSION['user']['id']);
     }
     $pending_invitation = array();
     if (!empty($pending)) {
         $i = 0;
         foreach ($pending as $pe) {
             $pending_invitation[$i]['user_email'] = $pe['inv_user_email'];
             $i++;
         }
     }
     $this->accepted_invitation = $accepted_invitation;
     $this->pending_invitation = $pending_invitation;
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
 }
 if (Group::is_admin((int) $group->collection_id, (int) $_SESSION['user']['id'])) {
     $is_admin = TRUE;
     if ($group->is_moderated || $group->reg_type == $group->REG_MODERATED) {
         $total_in_mod_queue = count($group->get_moderation_queue('content')) + count($group->get_moderation_queue('user'));
     }
     $invs = Invitation::get_all((int) $_SESSION['user']['id'], $group->collection_id);
     foreach ($invs as $i) {
         if ($i['status'] == 0) {
             $pending[] = $i['id'];
         } elseif ($i['status'] == 1) {
             $accepted[] = $i['id'];
         }
     }
 } else {
     $pending = Invitation::get_pending_invitations($group->collection_id, $_SESSION['user']['id']);
     $accepted = Invitation::get_accepted_invitations($group->collection_id, $_SESSION['user']['id']);
 }
 $members = count($group->get_members());
 //print_r($pending);exit;
 for ($i = 0; $i < count($accepted); $i++) {
     $inv = Invitation::load((string) $accepted[$i]);
     //print_r($inv);exit;
     $accepted_invitations[$i]['id'] = $accepted[$i];
     if ($inv->inv_username) {
         $accepted_invitations[$i]['user'] = '******' . $inv->inv_user_id . '">' . $inv->inv_username . '</a>';
     } else {
         $accepted_invitations[$i]['user'] = $inv->inv_user_first_name . ' ' . $inv->inv_user_last_name . ' Email: <a href="mailto:' . $inv->inv_email . '">' . $inv->inv_email . '</a>';
     }
     $accepted_invitations[$i]['sent_by'] = '<a href="user.php?uid=' . $inv->user_id . '">' . $inv->username . '</a>';
     $accepted_invitations[$i]['time'] = invitation_date($inv->inv_data['sent_on']);
    $error = TRUE;
}
$accepted = Invitation::get_accepted_invitations($_SESSION['user']['id']);
if (!empty($accepted)) {
    $i = 0;
    foreach ($accepted as $ac) {
        $user_info = User::get_user_data($ac['inv_user_email']);
        $accepted_invitation[$i]['user_name'] = $user_info['login_name'];
        $accepted_invitation[$i]['first_name'] = $user_info['first_name'];
        $accepted_invitation[$i]['last_name'] = $user_info['last_name'];
        $accepted_invitation[$i]['picture'] = $user_info['picture'];
        $accepted_invitation[$i]['user_id'] = $user_info['user_id'];
        $i++;
    }
}
$pending = Invitation::get_pending_invitations($_SESSION['user']['id']);
if (!empty($pending)) {
    $i = 0;
    foreach ($pending as $pe) {
        $pending_invitation[$i]['user_email'] = $pe['inv_user_email'];
        $i++;
    }
}
if (isset($_POST['submit'])) {
}
$login_name = $user->login_name;
$first_name = $user->first_name;
$last_name = $user->last_name;
$email = $user->email;
$user_picture = $user->picture;
if ($user->picture) {