<div id="content" class='content'>
    <div class='row'>
        <div class="col-lg-12">
            <div class="pull-right">
                <?= anchor('menu/create/', '<i class="fa fa-plus"></i> Tambah Data', array('class' => 'btn btn-success btn-sm')); ?>
            </div>
        </div>
    </div>
    <br>
    <div class="row">
        <div class='col-lg-12'>
            <div class='panel <?= $web_box_color ?>'>
                <div class='panel-heading'>
                    <h3 class='panel-title bold'>MENU LIST</h3>
                </div>
                <div class='panel-body'>
                    <table class="table table-striped" id="mytable" style="width: 100%;">
                        <thead>
                            <tr>
                                <th class="text-center valign-middle" width="10px">No</th>
                                <th class="text-center valign-middle">Nama Menu</th>
                                <th class="text-center valign-middle">Link</th>
                                <th class="text-center valign-middle" width="30">Icon</th>
                                <th class="text-center valign-middle">Pengguna</th>
                                <th class="text-center valign-middle">Parent</th>
                                <th class="text-center valign-middle"><span><i class="fa fa-cogs"></i></span></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $start = 0;
                            foreach ($menu_data as $menu) {
                                if ($menu->is_active == '1') {
                                    $active = 'Admin';
                                } else if ($menu->is_active == '2') {
                                    $active = 'Absensi';
                                } else if ($menu->is_active == '3') {
                                    $active = 'Pegawai';
                                } else if ($menu->is_active == '4') {
                                    $active = 'Kesor';
                                } else if ($menu->is_active == '5') {
                                    $active = 'PTP';
                                } else if ($menu->is_active == '0') {
                                    $active = 'Tidak Aktif';
                                } else {
                                    $active = 'Undefine';
                                }
                                $parent = $menu->is_parent > 1 ? 'MAINMENU' : 'SUBMENU';
                                $ikon = explode(" ", $menu->icon);
                                $bg_ikon = "bg-grey";
                            ?>
                                <tr>
                                    <td class="text-center"><?= ++$start ?></td>
                                    <td><?= $menu->name ?></td>
                                    <td class="text-center"><?= $menu->link ?></td>
                                    <td class="text-center">
                                        <button class="btn <?= $bg_ikon ?> btn-icon" style="border-radius: 8px;">
                                            <i class='<?= $ikon[0] . " " . $ikon[1] ?>'></i>
                                        </button>
                                    </td>
                                    <td class="text-center"><?= $active ?></td>
                                    <td class="text-center"><?= $parent ?></td>
                                    <td class="text-center" width="140px">
                                        <?php
                                        echo '  ';
                                        echo anchor(site_url('menu/update/' . $menu->id), '<i class="fa fa-pencil-alt"></i>', array('title' => 'edit', 'class' => 'btn btn-primary btn-icon btn-circle'));
                                        echo '  ';
                                        echo anchor(site_url('menu/delete/' . $menu->id), '<i class="fa fa-trash-alt"></i>', 'title="delete" class="btn btn-danger btn-icon btn-circle tombol-hapus" onclick="javasciprt: return confirm(\'Are You Sure ?\')"');
                                        ?>
                                    </td>
                                </tr>
                            <?php
                            }
                            ?>
                        </tbody>
                    </table>

                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div><!-- /.col -->
    </div><!-- /.row -->
</div><!-- /.content -->