<nav class="navbar navbar-default navbar-fixed-top">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class=" navbar-header">
    <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>

  </div>
  <!-- Collection of nav links, forms, and other content for toggling -->
  <div id="navbarCollapse" class="collapse navbar-collapse">
    <ul class="nav navbar-nav">
      <li><a href=""><img src="logo.png" width="50px" alt=""></a></li>
      <li><a href="?module=realisasi-anggaran">Laporan Realisasi Perencanaan</a></li>
      <li><a href="?module=perencanaan">Laporan Perencanaan</a></li>
      <li><a href="?module=hutang-tagihan">Laporan Tagihan/Hutang</a></li>
         
      
       <?php if ($_SESSION['leveluser'] == 'admin') { ?>
      <li><a href="?module=laporankas">LAPORAN KAS</a></li>
      <?php } ?>

        <?php

      $anon = mysqli_query($conn, "SELECT * FROM transaksi WHERE id_transaksi='' OR 
      debit=0 AND kredit=0 OR id_jenis='' OR id_pegawai='' OR jenis_kas=''");
      $anonim = mysqli_num_rows($anon);


      ?>

      <?php if ($_SESSION['leveluser'] == 'admin') { ?>
        <li class="dropdown">
          <a data-toggle="dropdown" class="dropdown-toggle" href="#">Pengaturan <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="?module=jenis-donasi">Jenis Donasi</a></li>
            <li><a href="?module=sub-kategori">Sub Kategori kas</a></li>
            <li><a href="?module=jenis-rt">Jenis Rumah Tahfidz</a></li>
            <li><a href="?module=pengaturan">Data sekolah </a></li>
            <li><a href="?module=pengaturan&aksi=print">Printer </a></li>
            <li><a href="?module=pegawai">Data Akun</a></li>
            <li><a href="?module=akses_edit">akses edit transaksi</a></li>
            <li><a href="?module=mac">akses mac perangkat</a></li>
            <li><a href="?module=history_login">History Login</a></li>
            <li><a href="?module=log_detail">History Aktivitas</a></li>
            <li><a href="?module=data_anonim">Data transaksi anonim [<?php echo $anonim; ?>]</a></li>
            <li><a href="component/com_pengaturan/backup.php">Backup Database</a></li>
          </ul>
        </li>
      <?php } ?>



    </ul>

    <ul class="nav navbar-nav navbar-right">

      <li class="dropdown">
        <a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="glyphicon glyphicon-user"></span> <?php echo $_SESSION['namalengkap']; ?> <b class="caret"></b></b></a>
        <ul class="dropdown-menu">
          <li><a href="?module=akun">Akun</a></li>
        </ul>
      </li>
      <li><a class="btn" onclick="logout();"><span class="glyphicon glyphicon-log-in"></span> Logout</a></li>
    </ul>



  </div>
</nav>
<script>
  function logout() {
    Swal.fire({
      title: 'Yakin akan keluar?',
      showCancelButton: true,
      showConfirmButton: false,
      showDenyButton: true,
      denyButtonText: `Keluar`,
    }).then((result) => {
      /* Read more about isConfirmed, isDenied below */
      if (result.isConfirmed) {
        document.location = 'logout.php'
      } else if (result.isDenied) {
        document.location = 'logout.php'
      }
    })
  }
</script>