<?php 
$menu = $this->uri->segment(1) ? strtolower($this->uri->segment(1)) : '';
$sub_menu = $this->uri->segment(2) ? strtolower($this->uri->segment(2)) : '';
$sub_menu3 = $this->uri->segment(3) ? strtolower($this->uri->segment(3)) : '';
 ?>
<!DOCTYPE html>
<html lang="en">
  <head>

    <!-- Required meta tags -->
    <base href="<?php echo base_url(); ?>"/>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Meta -->
    <meta name="description" content="<?php echo $title; ?> - <?php echo $atr['nama']; ?>">
    <meta name="author" content="ThemePixels">
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/x-icon" href="assets/admin/img/<?php echo $atr['favicon']; ?>">
    <title><?php echo $title; ?> - <?php echo $atr['nama']; ?></title>
    <!-- vendor css -->
    <link href="assets/admin/lib/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet">
    <link href="assets/admin/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
    <link href="assets/admin/lib/prismjs/themes/prism-tomorrow.css" rel="stylesheet">
    <link href="assets/admin/lib/datatables.net-dt/css/jquery.dataTables.min.css" rel="stylesheet">
    <link href="assets/admin/lib/datatables.net-responsive-dt/css/responsive.dataTables.min.css" rel="stylesheet">
    <link href="assets/admin/lib/select2/css/select2.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.css" rel="stylesheet" type="text/css">
    <!-- template css -->
    <link rel="stylesheet" href="assets/admin/css/cassie.css">
  </head>
  <body>

    <div class="sidebar">
      <div class="sidebar-header">
        <div>
          <a href="admin/dashboard" class="sidebar-logo"><span><?php echo $atr['logo_teks']; ?></span></a>
          <small class="sidebar-logo-headline"><?php echo $atr['slogan']; ?></small>
        </div>
      </div><!-- sidebar-header -->
      <div id="dpSidebarBody" class="sidebar-body">
        <ul class="nav nav-sidebar">
          <li class="nav-label"><label class="content-label">Manajemen Donasi</label></li>
          <li class="nav-item">
            <a href="admin/dashboard" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'dashboard'){echo 'active';} ?>"><i data-feather="home"></i> Dashboard</a>
          </li>
          <li class="nav-item">
            <a href="admin/donasi" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'donasi'){echo 'active';} ?>"><i data-feather="credit-card"></i> Data Donasi</a>
          </li>
          <li class="nav-item">
            <a href="admin/kategori-campaign" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'kategori-campaign'){echo 'active';} ?>"><i data-feather="framer"></i> Kategori Campaign</a>
          </li>
          <li class="nav-item">
            <a href="admin/galang-dana" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'galang-dana'){echo 'active';} ?>"><i data-feather="package"></i> Campaign Donasi</a>
          </li>
          <li class="nav-item">
            <a href="admin/pengguna" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'pengguna'){echo 'active';} ?>"><i data-feather="users"></i> Data Pengguna</a>
          </li>
          <li class="nav-item <?php if($menu == 'admin' AND $sub_menu == 'laporan'){echo 'show';} ?>">
            <a href="" class="nav-link with-sub <?php if($menu == 'admin' AND $sub_menu == 'laporan'){echo 'active';} ?>"><i data-feather="file-text"></i> Laporan</a>
            <nav class="nav nav-sub">
              <a href="admin/laporan/top-donatur" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'laporan' AND $sub_menu3 == 'top-donatur'){echo 'active';} ?>">Top Donatur</a>
              <a href="admin/laporan/donasi-masuk" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'laporan' AND $sub_menu3 == 'donasi-masuk'){echo 'active';} ?>">Donasi Masuk</a>
              <a href="admin/laporan/galang-dana" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'laporan' AND $sub_menu3 == 'galang-dana'){echo 'active';} ?>">Galang Dana</a>
              <a href="admin/laporan/pengguna" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'laporan' AND $sub_menu3 == 'pengguna'){echo 'active';} ?>">Pengguna</a>
            </nav>
          </li>
          <li class="nav-item">
            <a href="admin/akses" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'akses'){echo 'active';} ?>"><i data-feather="user-check"></i> Akses</a>
          </li>
          
          <li class="nav-label"><label class="content-label">Pengaturan Sistem</label></li>          
          <li class="nav-item <?php if($menu == 'admin' AND $sub_menu == 'pengaturan'){echo 'show';} ?>">
            <a href="" class="nav-link with-sub <?php if($menu == 'admin' AND $sub_menu == 'pengaturan'){echo 'active';} ?>"><i data-feather="settings"></i> Pengaturan Sistem</a>
            <nav class="nav nav-sub">
            	<a href="admin/pengaturan/profil" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'pengaturan' AND $sub_menu3 == 'profil'){echo 'active';} ?>">Profil</a>
              <a href="admin/pengaturan/atribut" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'pengaturan' AND $sub_menu3 == 'atribut'){echo 'active';} ?>">Atribut</a>
            	<a href="admin/pengaturan/midtrans" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'pengaturan' AND $sub_menu3 == 'midtrans'){echo 'active';} ?>">Midtrans</a>
            	<a href="admin/pengaturan/email" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'pengaturan' AND $sub_menu3 == 'email'){echo 'active';} ?>">Email</a>
            </nav>
          </li>
          
          <li class="nav-label"><label class="content-label">Manajemen Konten</label></li>                    
          <li class="nav-item">
            <a href="admin/events" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'events'){echo 'active';} ?>"><i data-feather="calendar"></i> Events</a>
          </li>
          <li class="nav-item">
            <a href="admin/pesan-masuk" class="nav-link <?php if($menu == 'admin' AND $sub_menu == 'pesan-masuk'){echo 'active';} ?>"><i data-feather="mail"></i> Pesan Masuk</a>
          </li>
          <li class="nav-item <?php if($menu == 'admin' AND $sub_menu == 'postingan'){echo 'show';} ?>">
            <a href="" class="nav-link with-sub <?php if($menu == 'admin' AND $sub_menu == 'postingan'){echo 'active';} ?>"><i data-feather="file"></i> Artikel - News</a>
            <nav class="nav nav-sub">
            	<a href="admin/postingan/artikel" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'postingan' AND $sub_menu3 == 'artikel'){echo 'active';} ?>">Artikel</a>
            	<a href="admin/postingan/kategori" class="nav-sub-link <?php if($menu == 'admin' AND $sub_menu == 'postingan' AND $sub_menu3 == 'kategori'){echo 'active';} ?>">Kategori</a>
            </nav>
          </li>
          <li class="nav-item"><a href="" target="_blank" class="nav-link"><i data-feather="globe"></i> Halaman Depan</a></li>
        </ul>

      </div><!-- sidebar-body -->
    </div><!-- sidebar -->

    <div class="content content-page">
      <div class="header">
        <div class="header-left">
          <a href="" class="burger-menu"><i data-feather="menu"></i></a>
        </div><!-- header-left -->

        <div class="header-right">
          <div class="dropdown dropdown-loggeduser">
            <a href="" class="dropdown-link" data-toggle="dropdown">
              <div class="avatar avatar-sm">
                <img src="assets/admin/img/<?php echo $me['admin_foto']; ?>" class="rounded-circle" alt="">
              </div><!-- avatar -->
            </a>
            <div class="dropdown-menu dropdown-menu-right">
              <div class="dropdown-menu-header">
                <div class="media align-items-center">
                  <div class="avatar">
                    <img src="assets/admin/img/<?php echo $me['admin_foto']; ?>" class="rounded-circle" alt="">
                  </div><!-- avatar -->
                  <div class="media-body mg-l-10">
                    <h6><?php echo $me['admin_nama']; ?></h6>
                    <span>Administrator</span>
                  </div>
                </div><!-- media -->
              </div>
              <div class="dropdown-menu-body">
                <a href="admin/atur/profil" class="dropdown-item"><i data-feather="user"></i> Profil</a>
                <a href="admin/atur/password" class="dropdown-item"><i data-feather="key"></i> Password</a>
                <a href="admin/logout" class="dropdown-item"><i data-feather="log-out"></i> Sign Out</a>
              </div>
            </div><!-- dropdown-menu -->
          </div>
        </div><!-- header-right -->
      </div><!-- header -->