<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>Dashboard CSIRT</title>
    <link rel="icon" href="<?php echo base_url('assets/img/favicon.ico'); ?>" type="image/x-icon">      
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/bootstrap/dist/css/bootstrap.min.css'); ?>">
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/datatables.net-bs/css/dataTables.bootstrap.css'); ?>">    
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/bootstrap/dist/css/responsive.bootstrap.css'); ?>">     
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/font-awesome/css/font-awesome.min.css'); ?>">  
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/Ionicons/css/ionicons.min.css'); ?>">         
    <link rel="stylesheet" href="<?php echo base_url('assets/dist/css/AdminLTE.min.css'); ?>">  
    <link rel="stylesheet" href="<?php echo base_url('assets/dist/css/skins/_all-skins.min.css'); ?>"> 
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/morris.js/morris.css'); ?>"> 
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/jvectormap/jquery-jvectormap.css'); ?>"> 
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css'); ?>"> 
    <link rel="stylesheet" href="<?php echo base_url('assets/bower_components/bootstrap-daterangepicker/daterangepicker.css'); ?>">  
    <link rel="stylesheet" href="<?php echo base_url('assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css'); ?>"> 
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">    
   
    <!-- Tambahkan CSS dan JS lainnya di sini -->      

    <script>  
        // Fungsi untuk mencegah kembali ke halaman sebelumnya  
        function preventBack() {  
            window.history.pushState(null, '', window.location.href);  
            window.onpopstate = function() {  
                window.history.pushState(null, '', window.location.href);  
            };  
        }  

        // Panggil fungsi preventBack saat halaman dimuat  
        window.onload = preventBack;  
    </script>    
</head>
<body class="hold-transition skin-blue sidebar-mini">
    <!-- content-wrapper -->
    <div class="wrapper">

        <!--Menu Header Paling Atas-->
        <header class="main-header">    
            <a href="<?php echo base_url(); ?>" class="logo">      
                <span class="logo-mini"><b>CS</b>T</span>      
                <span class="logo-lg"><b>CSI</b>RT</span>
            </a>    
            <nav class="navbar navbar-static-top">      
                <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                    <span class="sr-only">Toggle navigation</span>
                </a>

                <div class="navbar-custom-menu">
                    <ul class="nav navbar-nav">               
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <img src="<?php echo base_url('gambar/pengguna/' . $this->session->userdata('sampul')); ?>" class="user-image" alt="User Image">
                                <span class="hidden-xs">HAK AKSES : <b><?php echo $this->session->userdata('level') ?></b></span>
                            </a>

                            <ul class="dropdown-menu">                            
                                <li class="user-header">
                                    <img src="<?php echo base_url('gambar/pengguna/' . $this->session->userdata('sampul')); ?>" class="img-circle" alt="User Image">
                                    <p>
                                        <?php echo $this->session->userdata('username') ?>
                                        <small>Hak akses : <?php echo $this->session->userdata('level') ?></small>
                                    </p>
                                </li>                          
                                
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a href="<?php echo base_url('dashboard/ganti_password'); ?>" class="btn btn-default btn-flat">Ganti Password</a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="<?php echo base_url('dashboard/keluar'); ?>" class="btn btn-default btn-flat">Keluar</a>
                                    </div>
                                </li>
                            </ul>
                        </li>                  
                    </ul>
                </div>
            </nav>
        </header>

        <!--Menu Sebelah Kiri-->
        <aside class="main-sidebar">        
            <section class="sidebar">
                <!--Gambar Profil Sebelah Kiri -->
                <div class="user-panel">
                    <div class="pull-left image">
                        <img src="<?php echo base_url('gambar/pengguna/' . $this->session->userdata('sampul')); ?>" class="img-circle" alt="User Image">
                    </div>
                    <div class="pull-left info">
                        <?php 
                        $id_user = $this->session->userdata('id');					
                        $user = $this->db->get_where('pengguna', array('pengguna_id' => $id_user))->row();
                        ?>
                        <p><?php echo $user ? $user->pengguna_nama : 'Pengguna tidak ditemukan'; ?></p>
                        <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                    </div>
                </div>

                <!--Form Pencarian-->
                <form action="#" method="get" class="sidebar-form">
                    <div class="input-group">
                    <input type="text" name="q" class="form-control" placeholder="Cari...">
                        <span class="input-group-btn">
                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                            </button>
                        </span>
                    </div>
                </form>                

                <!-- sidebar menu: : style can be found in sidebar.less -->
                <ul class="sidebar-menu" data-widget="tree">
                    <li class="header">MENU UTAMA</li>
                        <li>
                            <a href="<?php echo base_url('dashboard'); ?>" aria-label="Dashboard">
                                <i class="fa fa-tachometer"></i> <span>Dashboard</span>
                            </a>
                        </li>
                        <?php 
                        if($this->session->userdata('level') == "admin"){
                        ?>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/kategori'); ?>" aria-label="Kategori">
                                <i class="fa fa-pencil-square"></i> <span>Kategori</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/kategori'); ?>" aria-label="Daftar Kategori"><i class="fa fa-circle-o"></i> Kategori Artikel</a></li>
                                <li><a href="<?php echo base_url('dashboard/kategori_profil'); ?>" aria-label="Tambah Kategori"><i class="fa fa-circle-o"></i> Kategori Profil</a></li>
                                <li><a href="<?php echo base_url('dashboard/kategori_RFC2350'); ?>" aria-label="Tambah Kategori"><i class="fa fa-circle-o"></i> Kategori RFC2350</a></li>
                                <li><a href="<?php echo base_url('dashboard/kategori_panduan'); ?>" aria-label="Tambah Kategori"><i class="fa fa-circle-o"></i> Kategori Panduan</a></li>
                                <li><a href="<?php echo base_url('dashboard/kategori_layanan'); ?>" aria-label="Tambah Kategori"><i class="fa fa-circle-o"></i> Kategori Layanan</a></li>
                            </ul>
                        </li>
                        <?php
                        } 
                        ?>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/artikel'); ?>" aria-label="Post Artikel">
                                <i class="fa fa-newspaper-o"></i> <span>Post Artikel</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/artikel'); ?>" aria-label="Daftar Artikel"><i class="fa fa-circle-o"></i> Daftar Artikel</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_artikel'); ?>" aria-label="Tambah Artikel"><i class="fa fa-circle-o"></i> Tambah Artikel</a></li>
                            </ul>
                        </li>
                        <?php 
                        if($this->session->userdata('level') == "admin"){
                        ?>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/profil'); ?>" aria-label="Profil">
                                <i class="fa fa-microchip"></i> <span>Profil</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/profil'); ?>" aria-label="Daftar Profil"><i class="fa fa-circle-o"></i> Daftar Profil</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_profil'); ?>" aria-label="Tambah Profil"><i class="fa fa-circle-o"></i> Tambah Profil</a></li>
                            </ul>
                        </li>
                        <?php
                        } 
                        ?>  

                        <?php 
                        if($this->session->userdata('level') == "admin"){
                        ?>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/rfc2350'); ?>" aria-label="RFC2350">
                                <i class="fa fa-lock"></i> <span>RFC2350</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/rfc2350'); ?>" aria-label="Daftar RFC2350"><i class="fa fa-circle-o"></i> Daftar RFC2350</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_rfc2350'); ?>" aria-label="Tambah RFC2350"><i class="fa fa-circle-o"></i> Tambah RFC2350</a></li>
                            </ul>
                        </li>
                        <?php
                        } 
                        ?> 
                        
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/panduan'); ?>" aria-label="Panduan">
                                <i class="fa fa-glide"></i> <span>Panduan</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/panduan'); ?>" aria-label="Daftar Panduan"><i class="fa fa-circle-o"></i> Daftar Panduan</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_panduan'); ?>" aria-label="Tambah Panduan"><i class="fa fa-circle-o"></i> Tambah Panduan</a></li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/layanan'); ?>" aria-label="Layanan">
                                <i class="fa fa-handshake-o"></i> <span>Layanan</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/layanan'); ?>" aria-label="Daftar Layanan"><i class="fa fa-circle-o"></i> Daftar Layanan</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_layanan'); ?>" aria-label="Tambah Layanan"><i class="fa fa-circle-o"></i> Tambah Layanan</a></li>
                            </ul>
                        </li>                                                                                                                        
                    </li>

                    <?php if ($this->session->userdata('level') == 'satker'): ?>
                        <li>
                            <a href="<?php echo base_url('dashboard/profile'); ?>" aria-label="Profile">
                                <i class="fa fa-user"></i> <span>Profile</span>
                            </a>
                        </li>

                    <?php endif; ?>


                    <?php 
                    if($this->session->userdata('level') == "admin"){
                    ?>
                    <li class="header">PENGATURAN</li>
                        <li>
                            <a href="<?php echo base_url('dashboard/pengaturan'); ?>" aria-label="Pengaturan Web">
                                <i class="fa fa-tasks"></i> <span>Pengaturan Web</span>                            
                            </a>                        
                        </li>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/halaman'); ?>" aria-label="Halaman">
                                <i class="fa fa-sliders"></i> <span>Halaman</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/halaman'); ?>" aria-label="Daftar Halaman"><i class="fa fa-circle-o"></i> Daftar Halaman</a></li>
                                <li><a href="<?php echo base_url('dashboard/tambah_halaman'); ?>" aria-label="Tambah Halaman"><i class="fa fa-circle-o"></i> Tambah Halaman</a></li>
                            </ul>
                        </li>
                        <li>
                            <a href="<?php echo base_url('dashboard/kontak'); ?>" aria-label="Footer">
                                <i class="fa fa-tasks"></i> <span>Footer</span>                            
                            </a>                        
                        </li>
                        <li class="treeview">
                            <a href="<?php echo base_url('dashboard/pengguna'); ?>" aria-label="Pengguna">
                                <i class="fa fa-user"></i> <span>Pengguna</span>
                                <span class="pull-right-container">
                                    <i class="fa fa-angle-left pull-right"></i>
                                </span>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo base_url('dashboard/pengguna'); ?>" aria-label="Daftar Pengguna"><i class="fa fa-circle-o"></i> Daftar Pengguna</a></li>
                                <li><a href="<?php echo base_url('dashboard/pengguna_tambah'); ?>" aria-label="Tambah Pengguna"><i class="fa fa-circle-o"></i> Tambah Pengguna</a></li>
                            </ul>
                        </li>                                                                                                  
                    </li>
                    <?php
                    } 
                    ?>                
                </ul>
            </section>        
        </aside>