<div class="row">
    <!-- begin col-8 -->
    <div class="col-sm-12">
        <!-- begin panel -->
        <div class="panel panel-grey">
            <div class="panel-heading">
                <div class="panel-heading-btn">
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-grey" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-grey" data-click="panel-remove"><i class="fa fa-times"></i></a>
                </div>
                <a href="<?php echo site_url('akun/create_edit?type=user'); ?>"class="btn btn-primary">Tambah Data</a>
                <hr>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <form method="post">
                        <table class="table table-bordered table-hover table-striped table-td-valign-middle">
                            <thead>
                                <tr class="inverse">
                                    <th class="text-center">No</th>
                                    <th class="text-center">Username</th>
                                    <th class="text-center">Email</th>
                                    <th class="text-center">Personil</th>
                                    <th class="text-center">Group/Role</th>
                                    <th class="text-center">Spesifikasi</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $i = 1;
                                foreach ($data as $r) {
                                    ?>
                                    <tr>
                                        <td class="text-center"><?php echo $this->uri->segment(3) + $i++; ?></td>
                                        <td><?php echo $r['username']; ?></td>
                                        <td><?php echo $r['email']; ?></td>
                                        <td><?php echo $r['personil']; ?></td>
                                        <td><?php echo $r['nama_group']; ?></td>
                                        <td>
                                          <?php
                                            //echo $r['role_analis'];
                                            $ranalis = explode('|', $r['role_analis']);
                                            $ra = '';
                                            foreach ($ranalis as $a) {
                                              if(isset($a) && $a!=''){
                                                $ra .= $this->m_akun->get_role_analis($a).', ';
                                              }
                                            }
                                            $ra = substr($ra,0,-2);
                                            echo $ra;
                                          ?>
                                        </td>
                                        <td class="text-center">
                                          <a href="<?php echo site_url('akun/create_edit?type=user&id_user='.$r['id_user']); ?>" class="btn btn-xs btn-grey" title="Edit">Edit</a><br>
                                          <a style="margin-top:5px;" href="<?php echo site_url('akun/hapus_user?id_user='.$r['id_user']); ?>" class="btn btn-xs btn-inverse" title="Edit">Hapus</a>
                                        </td>
                                    </tr>
                                <?php } ?>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12" style="margin-top: 10px;">
                    <?php if ($link_paging) { ?>
                        <ul class="pagination pagination-sm no-margin">
                            <?php echo $link_paging; ?>
                        </ul>
                    <?php } ?>
                </div>
            </div>
        </div>
        <!-- end panel -->
    </div>
</div>
