<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('tambah_akun/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="grey">
                                <th class="text-center">No</th>
                                <th class="text-center">Nama Personil</th>
                                <th class="text-center">NIP/NIPTK</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 echo (!is_null($r['nip']) && $r['nip'] != '') ? $r['nip'] : $r['niptk']; ?></td>
                                    <td>
                                    <?php
                                        $rjabatan = json_decode($r['id_jabatan']);
                                        $rj = '';
                                        if($rjabatan) {
                                            foreach ($rjabatan as $j) {
                                                if(isset($j) && $j!=''){
                                                    $rj .= str_replace(' ', '&nbsp;', $this->m_akun->get_data_jabatan($j)['nama']).', ';
                                                }
                                            }
                                            $rj = substr($rj,0,-2);
                                            echo $rj;
                                        }
                                    ?>
                                    </td>
                                    <td><?php echo $r['no_telp']; ?></td>                                    
                                    <td class="text-center">
                                        <div class='btn-group btn-group-justified'>
                                            <a href="<?php echo site_url('edit_akun/personil/'.$r['id']); ?>" class="btn btn-xs btn-info" title="Edit">Edit</a>
                                            <?php $url_hapus = site_url('hapus_akun/personil/'.$r['id']); ?>
                                            <?= toi_notif_modal('user'.$r['id'], $url_hapus, 'HAPUS DATA PERSONIL', 'danger'); ?>
                                            <?= toi_image_modal('image'.$r['id'], $r['file_foto'], ''); ?>
                                        </div>
                                    </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>
