<div class="col-sm-8">
    <div class="row ">
        <div class="col-sm-12 ">
            <div class="col-sm-12">
                <div class="col-sm-6">
                  
                </div>

                <div class="col-sm-6 ">
                </div>

                <div id="join_group" class="modal fade" role="dialog">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal">&times;</button>
                                <h4 class="modal-title">Join Group</h4>
                            </div>
                            <div class="modal-body">

                                <form action="my_group.html" >

                                    <div class="col-sm-6 col-sm-offset-3">
                                        <br><br>
                                        <div class="input-group">
                                            <input type="text" class="form-control" placeholder="Please Type Group Code.." >
                                            <span class="input-group-addon" ><i class="fa fa-group"></i></span>
                                        </div>
                                    </div>   

                                    <div class="col-sm-12"><br> <br></div>



                                    <div class="col-sm-3"></div>
                                    <div class="col-sm-6">

                                        <input type="submit" class="green-btn btn btn-default" value="Join Group !"><br/><br/>
                                    </div>
                                    <div class="col-sm-3"></div>
                                </form>
                            </div>
                            <div class="col-sm-12"><hr></div>
                            <div class="modal-footer">

                                <button type="button" class="btn btn-danger pull-right" data-dismiss="modal">Close</button>
                            </div>
                        </div>
                    </div>
                </div>


                <hr>

            </div>

            <div class="col-sm-12"><hr></div>
            <div class="col-sm-12" style="padding: 0">


                <div class="col-sm-12 gray_ttc text-center" style="border-bottom: 2px solid #8CC73F;padding: 10px 0 10px 0;font-weight: bold">

                    <div class="col-sm-6" style="padding: 0">Name</div>
<!--                    <div class="col-sm-3" style="padding: 0">Quiz</div>-->
                    <div class="col-sm-3" style="padding: 0">Join Date</div>
                    <div class="col-sm-3" style="padding: 0">Action</div>
                </div>

                <div class="col-sm-12"><br></div> 
                <?php
                  $user_id = $this->session->userdata('user_id');
                foreach ($group_member_list as $v_group_member) { ?>
                    <div class="col-sm-12 gray text-center" >

                        <div class="col-sm-6" style="padding: 10px 0 0 0  ">
                            <a href="<?php echo base_url() . $v_group_member->url . '/profile/' ?>">
                                <?php 
                                    //echo $v_group_member->person_first_name . ' ' . $v_group_member->person_last_name 
                                    if(strlen($v_group_member->person_first_name) && strlen($v_group_member->person_last_name) < 20){
                                        echo $v_group_member->person_first_name . ' ' . $v_group_member->person_last_name;
                                        }
                                    else{
                                        echo substr($v_group_member->person_first_name, 0, 30).' '.substr($v_group_member->person_last_name, 0, 20).'...';
                                        }
                                ?></a>
                        </div>

<!--                        <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                            <a href="<?php // echo base_url() . 'group/quiz/' . $v_group_member->url; ?>"><?php //echo count($group_member_quiz[$v_group_member->group_member_id]); ?></a>
                        </div>-->

                        <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                            <?php echo date('Y-m-d', strtotime($v_group_member->group_join_date_time)); ?>
                        </div>
                        
                        <?php 
                    if($user_id==$group_details->group_created_by){
                        if ($v_group_member->person_id != $group_details->group_created_by) { ?>
                            <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                                <?php
                                $group_member_status = $v_group_member->group_member_status;
                                ?>

                                <a href="#" onclick="return checkForAction('<?php echo base_url() . 'make-block-group-member/' . $v_group_member->group_member_id; ?>', 'Block')">
                                    <i class="fa  fa-lock" title="Block Member"></i>
                                </a>&nbsp;&nbsp;

                                <a href="#" onclick="return checkForAction('<?php echo base_url() . 'make-pending-group-member/' . $v_group_member->group_member_id; ?>', 'Pending')">
                                    <i class="fa  fa-user-times" title="Make Pending"></i>
                                </a>&nbsp;&nbsp;

                                <a href="#" onclick="return checkForDelete('<?php echo base_url() . 'make-archive-group-member/' . $v_group_member->group_member_id; ?>')">
                                    <i class="fa fa-trash-o" title="Delete"></i>
                                </a>&nbsp;&nbsp;

                            </div>
                        <?php } else {
                            ?>
                            <div class="col-sm-3 text-center">Group Owner</div>
                        <?php }
                            }
                        ?>
                    </div>
                    <div class="col-sm-12">
                        <br>
                    </div>
                <?php } ?>

                <script>

                    function checkForAction(url, action) { // check for Active Inactives
                        swal({
                            title: "",
                            text: "Are you sure you want to " + action + " this Member?",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonColor: '#8CC73F',
                            confirmButtonText: 'Yes',
                            cancelButtonText: "No",
                            closeOnConfirm: true,
                            closeOnCancel: true
                        },
                        function (isConfirm) {
                            if (isConfirm) {
                                document.location.href = url;
                            }
                        });
                    }

                    function checkForDelete(url) {
                        swal({
                            title: "",
                            text: "Are you sure you want to Delete this Group Member?",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonColor: '#8CC73F',
                            confirmButtonText: 'Yes',
                            cancelButtonText: "No",
                            closeOnConfirm: true,
                            closeOnCancel: true
                        },
                        function (isConfirm) {
                            if (isConfirm) {
                                document.location.href = url;
                            }
                        });
                    }
                </script>
                 <?php
                // echo $total_limit_value->total_type;
                 $totall_count=count($totall_member);
                $total_page = ceil($totall_count / 10);
                if ($total_page > 1) {
                    ?>
                    <nav class="course-pagination">
                        <ul class="pagination">
                            <?php
                            if ($page > 2) {
                                ?>
                                <li>
                                    <a href="<?php echo base_url() . 'group/'.$group_url.'/members' ?>" aria-label="Previous">
                                        <span aria-hidden="true" title="First Page">&laquo;&laquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo base_url() . 'group/'.$group_url.'/members'.'/'. ($page - 1); ?>" aria-label="Previous">
                                        <span aria-hidden="true" title="Previous Page">&laquo;</span>
                                    </a>
                                </li>
                            <?php } elseif ($page > 1) { ?>
                                <li>
                                    <a href="<?php echo base_url() . 'group/'.$group_url.'/members'.'/'. ($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="' . base_url() . 'group/'.$group_url.'/members'.'/'. ($i + 1) . '">' . ($i + 1) . '</a></li>';
                            }
                            if ($total_page != $page) {
                                ?>
                                <li>
                                    <a href="<?php echo base_url() .'group/'.$group_url.'/members'.'/'. ($page + 1); ?>" aria-label="Next">
                                        <span aria-hidden="true" title="Next Page">&raquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo base_url() . 'group/'.$group_url.'/members'.'/'. $total_page; ?>" aria-label="Next">
                                        <span aria-hidden="true" title="Last Page">&raquo;&raquo;</span>
                                    </a>
                                </li>
                            <?php } ?>
                        </ul>
                    </nav>
                <?php } ?>

            </div>


        </div>
    </div>

</div>