 <?php
	include 'connect.php';
	
	$sql1 = "select * from `user` where kad_pengenalan = '".$_SESSION['kadPengenalan']."' ";
	$result1 = mysqli_query($conn,$sql1);
	$row1 = mysqli_fetch_array($result1);
	
	$peranan= $row1['peranan_user'];
 ?>
 <!-- ======= Header ======= -->
  <header id="header" class="header fixed-top d-flex align-items-center">

    <div class="d-flex align-items-center justify-content-between">
      <a href="" class="logo d-flex align-items-center">
        <img src="assets/img/logo_mainpp.png" alt="">
        <span class="d-none d-lg-block" style="font-size:18px;">Sistem Pendaftaran Surat</span>
      </a>
      <i class="bi bi-list toggle-sidebar-btn"></i>
    </div><!-- End Logo -->

    <nav class="header-nav ms-auto">
      <ul class="d-flex align-items-center">
        <li class="nav-item dropdown pe-3">

			<a class="dropdown-item d-flex align-items-center" onclick="logout()">
				<i class="bi bi-box-arrow-right" ></i>
				<span>Log Keluar</span>
			</a>        
        </li><!-- End Profile Nav -->

      </ul>
    </nav><!-- End Icons Navigation -->      
    

  </header><!-- End Header -->

  <!-- ======= Sidebar ======= -->
  <aside id="sidebar" class="sidebar">

    <ul class="sidebar-nav" id="sidebar-nav">
	  
	    <li class="nav-item">
        <a class="nav-link collapsed" href="pageUser.php">
          <i class="bi bi-grid"></i>
          <span>Dashboard</span>
        </a>
      </li><!-- End Dashboard Nav -->
	  
	  <li class="nav-item">
        <a class="nav-link collapsed" href="carianSuratMasuk.php">
          <i class="bi bi-search"></i>
          <span>Carian Surat Masuk</span>
        </a>
      </li><!-- End carian Page Nav --> 
	  
	  <li class="nav-item">
        <a class="nav-link collapsed" href="edaranUser.php">
          <i class="bi bi-journal-text"></i>
          <span>Edaran Surat Antara Bahagian/Unit</span>
        </a>
      </li><!-- End edaran Page Nav --> 

      <?php 
	  if($peranan=='USER')
	  {
	  ?>
		<li class="nav-item">
        <a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-layout-text-window-reverse"></i><span>Laporan</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="tables-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
          
		  <li>
            <a href="printLaporanSesiUser.php">
              <i class="bi bi-circle"></i><span>Laporan Surat Masuk Mengikut Tarikh & Sesi</span>
            </a>
          </li>
          <li>
            <a href="printLaporanBulananUser.php">
              <i class="bi bi-circle"></i><span>Laporan Surat Diterima (Bulanan & Tahunan)</span>
            </a>
          </li>
          <li>
            <a href="printLaporanCekHarianUser.php">
              <i class="bi bi-circle"></i><span>Cek Masuk Harian</span>
            </a>
          </li>
		  <li>
            <a href="printLaporanCekBulananUser.php">
              <i class="bi bi-circle"></i><span>Cek Masuk Bulanan </span>
            </a>
          </li>
		</li><!-- End Tables Nav -->  
	<?php
	  }
	  else
	  {
	?>
		<li class="nav-item">
        <a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="collapse" href="#">
          <i class="bi bi-layout-text-window-reverse"></i><span>Laporan</span><i class="bi bi-chevron-down ms-auto"></i>
        </a>
        <ul id="tables-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
          <!--<li>
            <a href="printLaporanHarian.php">
              <i class="bi bi-circle"></i><span>Surat Masuk Harian & Sesi</span>
            </a>
          </li>-->
		  <li>
            <a href="printLaporanSesi.php">
              <i class="bi bi-circle"></i><span>Laporan Surat Masuk Mengikut Tarikh & Sesi</span>
            </a>
          </li>
          <li>
            <a href="printLaporanBulanan.php">
              <i class="bi bi-circle"></i><span>Laporan Surat Diterima (Bulanan)</span>
            </a>
          </li>
          <li>
            <a href="printLaporanBahagian.php">
              <i class="bi bi-circle"></i><span>Surat Diterima Bahagian (Bulan dan Tahun)</span>
            </a>
          </li>
          <li>
            <a href="printLaporanCekHarian.php">
              <i class="bi bi-circle"></i><span>Cek Masuk Harian</span>
            </a>
          </li>
		  <li>
            <a href="printLaporanCekBulanan.php">
              <i class="bi bi-circle"></i><span>Cek Masuk Bulanan </span>
            </a>
          </li>
		  <li>
            <a href="printEksekutifBulanan.php">
              <i class="bi bi-circle"></i><span>Ringkasan Eksekutif Surat Masuk (Bulanan) </span>
            </a>
          </li>
		  <li>
            <a href="printEksekutifTahunan.php">
              <i class="bi bi-circle"></i><span>Ringkasan Eksekutif Surat Masuk (Tahunan) </span>
            </a>
          </li>
        </ul>
      </li><!-- End Tables Nav -->
	  <?php
	  }
	  ?>
		 
        </ul>
      </li><!-- End Tables Nav --> 
			  
    </ul>

  </aside><!-- End Sidebar-->

  