<div class="row">
    <!-- begin col-8 -->
    <div class="col-lg-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=personil'); ?>" class="btn btn-primary m-b-5">Tambah Data</a>
                <hr>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <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">Nama Personil</th>
                                <th class="text-center">Jabatan</th>
                                <th class="text-center">No. Telepon</th>
                                <th>Aksi</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['nama']; ?></td>
                                    <td>
                                    <?php $r['id_jabatan'];
                                        $jabat = ''; 
                                        $jabatan = explode('|', $r['id_jabatan']);
                                        foreach($jabatan as $j){
                                            if($j != ''){
                                                $jabat .= '<label class="btn btn-default btn-xs mb-1">'.$this->m_akun->getJabatan($j)->row_array()['nama_jenis'].'</label>, ';
                                            }
                                        }

                                        $jabat = substr($jabat, 0, -2);
                                        echo $jabat;
                                    ?>
                                    </td>
                                    <td><?php echo $r['no_telp']; ?></td>                                    <td class="text-center">
                                        <a href="<?php echo site_url('akun/create_edit?type=personil&id_personil='.$r['id_personil']); ?>" class="btn btn-xs btn-grey mb-1" title="Edit">Edit</a>
                                        <a href="<?php echo site_url('akun/hapus_personil?id_personil='.$r['id_user']); ?>" class="btn btn-xs btn-inverse" title="Edit">Hapus</a>
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </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>
            <!-- end panel -->
        </div>
    </div>
