
<?php 
if($group){
      
    foreach($group as $val){?>
                            <div class="col-sm-12 gray text-left" >

                                <div class="col-sm-6" style="padding-top: 10px ">
                                   <a href="<?php echo base_url().'group/'. $val->url; ?>"><?php echo $val->group_name;?></a><br>
                                    BY
                                    <?php if($group_creator_info[$val->group_id]->person_role==1 || $group_creator_info[$val->group_id]->person_role==6){?>
                                      <?php echo $group_creator_info[$val->group_id]->person_first_name." ".$group_creator_info[$val->group_id]->person_last_name;?>
                                   <?php }
                                     else{ ?>
                                    <a href="<?php echo base_url().$group_creator_info[$val->group_id]->url.'/profile' ?>"> <?php echo $group_creator_info[$val->group_id]->person_first_name." ".$group_creator_info[$val->group_id]->person_last_name;?></a>
                                    <?php }?>
                                </div>
                                  
                                
                                <div class="col-sm-3" style="padding-top: 10px"><?php echo count($all_member[$val->group_id]); ?></div>
                                <?php $user_id=$this->session->userdata("user_id");?>
                                <div class="col-sm-3" style="padding-top: 10px"><a href="javascript:;" onclick="joinGroupRequext('<?php echo $user_id ?>','<?php echo $val->group_id;?>' ,'<?php echo $val->url;?>')"><i class="fa fa-user-plus" title="Join Group"></i></a>
                                    <br> <div id="error_join<?php echo $val->group_id; ?>" style="color:red;"></div>
                                </div>

                            </div>
                            <div class="col-sm-12"><br></div>
                     <?php } } ?>
   <?php
                // echo $total_limit_value->total_type;
                 $totall_count=count($group_list);
                $total_page = ceil($totall_count / 10);
                if ($total_page > 1) {
                    ?>
                    <nav class="course-pagination">
                        <ul class="pagination">
                            <?php
                            if ($page > 2) {
                                ?>
                                <li>
                                    <a href="javascript:;" onclick="more_View_catogorize_group(0)" onaria-label="Previous">
                                        <span aria-hidden="true" title="First Page">&laquo;&laquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:;" onclick="more_View_catogorize_group(<?php echo $page - 1;?>)" aria-label="Previous">
                                        <span aria-hidden="true" title="Previous Page">&laquo;</span>
                                    </a>
                                </li>
                            <?php } elseif ($page > 1) { ?>
                                <li>
                                    <a href="javascript:;" onclick="more_View_catogorize_group(<?php echo $page - 1;?>)" aria-label="Previous">
                                        <span aria-hidden="true" title="Previous Page">&laquo;</span>
                                    </a>
                                </li>
                                <?php
                            }
                            for ($i = 0; $total_page > $i; $i++) {
                               echo '<li><a href="javascript:;" onclick="more_View_catogorize_group('.($i + 1).')">' . ($i + 1) . '</a></li>';
                            }
                         if ($total_page != $page) {
                                ?>
                                <li>
                                    <a href="javascript:;"  onclick="more_View_catogorize_group(<?php echo $page + 1;?>)"  aria-label="Next">
                                        <span aria-hidden="true" title="Next Page">&raquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a  href="javascript:;"  onclick="more_View_catogorize_group(<?php echo  $total_page;?>)" aria-label="Next">
                                        <span aria-hidden="true" title="Last Page">&raquo;&raquo;</span>
                                    </a>
                                </li>
                            <?php } ?>
                        </ul>
                    </nav>
                <?php } ?>