Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/rabbithabit.com/public_html/application/views/admin/menus/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/dashboard'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Halaman</a></p><br> <h2>Menu Navigation</h2> <?= $this->session->flashdata('success'); //to display success message ?> <?= $this->session->flashdata('result'); //to display result message ?> </div> </div> <div class="row"> <div class="col-sm-12"> <br> <p><?= anchor('admin/menus/add', '<i class="fa fa-plus" aria-hidden="true"></i> <strong>TAMBAH MENU BARU</strong>'); ?></p> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Nama Menu (Id)</th> <th>Nama Menu (En)</th> <th>Turunan (Sub) dari</th> <th>Tipe Menu</th> <th>Urutan Tampilan</th> <th>Aktif ?</th> <th>Edit</th> <th>Hapus</th> </tr> </thead> <tbody> <?php if(count($parent_menus)) : ?> <?php foreach($parent_menus as $menu): ?> <tr> <td><?= ucfirst($menu->menu); ?></td> <td><?= ucfirst($menu->menu_en); ?></td> <td> <?php if ($menu->parent_id == NULL) { echo '-'; } else { //get menu name from menu table $this->db->select('menu, menu_en')->from('menus')->where('id_menus', $menu->parent_id); $menu_name = $this->db->get()->row(); echo ucfirst($menu_name->menu); } ?> </td> <td><?= ucfirst($menu->menu_type); ?></td> <td><?= $menu->priority; ?></td> <td> <?php if ($menu->status == 1) { echo 'Ya'; } else { echo 'Tidak'; } ?> </td> <td><?= bt_edit('admin/menus/edit/' . $menu->id_menus); ?></td> <td><?= bt_delete('admin/menus/delete/' . $menu->id_menus); ?></td> </tr> <?php //GET MENU LEVEL 2 $this->db->select('id_menus, menu, menu_en, parent_id, priority, status, menu_type')->from('menus')->where('parent_id', $menu->id_menus)->order_by('priority', 'ASC'); $menus_level2 = $this->db->get()->result(); ?> <?php foreach($menus_level2 as $menu2): ?> <tr> <td>- <?= ucfirst($menu2->menu); ?></td> <td>- <?= ucfirst($menu2->menu_en); ?></td> <td> <?php //get menu name from menu table $this->db->select('menu, menu_en')->from('menus')->where('id_menus', $menu2->parent_id); $menu_name = $this->db->get()->row(); echo ucfirst($menu_name->menu); ?> </td> <td><?= ucfirst($menu2->menu_type); ?></td> <td><?= $menu2->priority; ?></td> <td> <?php if ($menu2->status == 1) { echo 'Ya'; } else { echo 'Tidak'; } ?> </td> <td><?= bt_edit('admin/menus/edit/' . $menu2->id_menus); ?></td> <td><?= bt_delete('admin/menus/delete/' . $menu2->id_menus); ?></td> </tr> <?php //GET MENU LEVEL 3 $this->db->select('id_menus, menu, menu_en, parent_id, priority, status, menu_type')->from('menus')->where('parent_id', $menu2->id_menus)->order_by('priority', 'ASC'); $menus_level3 = $this->db->get()->result(); ?> <?php foreach($menus_level3 as $menu3): ?> <tr> <td>-- <?= ucfirst($menu3->menu); ?></td> <td>-- <?= ucfirst($menu3->menu_en); ?></td> <td> <?php //get menu name from menu table $this->db->select('menu, menu_en')->from('menus')->where('id_menus', $menu3->parent_id); $menu_name = $this->db->get()->row(); echo ucfirst($menu_name->menu); ?> </td> <td><?= ucfirst($menu3->menu_type); ?></td> <td><?= $menu3->priority; ?></td> <td> <?php if ($menu3->status == 1) { echo 'Ya'; } else { echo 'Tidak'; } ?> </td> <td><?= bt_edit('admin/menus/edit/' . $menu3->id_menus); ?></td> <td><?= bt_delete('admin/menus/delete/' . $menu3->id_menus); ?></td> </tr> <?php //GET MENU LEVEL 4 $this->db->select('id_menus, menu, menu_en, parent_id, priority, status, menu_type')->from('menus')->where('parent_id', $menu3->id_menus)->order_by('priority', 'ASC'); $menus_level4 = $this->db->get()->result(); ?> <?php foreach($menus_level4 as $menu4): ?> <tr> <td>--- <?= ucfirst($menu4->menu); ?></td> <td>--- <?= ucfirst($menu4->menu_en); ?></td> <td> <?php //get menu name from menu table $this->db->select('menu, menu_en')->from('menus')->where('id_menus', $menu4->parent_id); $menu_name = $this->db->get()->row(); echo ucfirst($menu_name->menu); ?> </td> <td><?= ucfirst($menu4->menu_type); ?></td> <td><?= $menu4->priority; ?></td> <td> <?php if ($menu4->status == 1) { echo 'Ya'; } else { echo 'Tidak'; } ?> </td> <td><?= bt_edit('admin/menus/edit/' . $menu4->id_menus); ?></td> <td><?= bt_delete('admin/menus/delete/' . $menu4->id_menus); ?></td> </tr> <?php endforeach; ?> <?php endforeach; ?> <?php endforeach; ?> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">Menu Navigasi Tidak Ditemukan.</td> </tr> <?php endif; ?> </tbody> </table> </div> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <?php //create pagination... echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>'; ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row -->