<?php
include "../config/koneksi.php";

if ($_SESSION['leveluser']=='admin'){
  $query = "SELECT * FROM modul WHERE aktif='Y' ORDER BY urutan";
  $hasil = mysqli_query($konek, $query);
  while ($m=mysqli_fetch_array($hasil)){  
    echo "<a href=\"$m[link]\" class=\"nav-item nav-link\"><i class=\"fa fa-chart-bar me-2\"></i> $m[nama_modul]</a>";
  }
}
elseif ($_SESSION['leveluser']=='user'){
  $query = "SELECT * FROM modul WHERE status='user' and aktif='Y' ORDER BY urutan";
  $hasil = mysqli_query($konek, $query);
  while ($m=mysqli_fetch_array($hasil)){  
    echo "<a href=\"$m[link]\" class=\"nav-item nav-link\"><i class=\"fa fa-chart-bar me-2\"></i> $m[nama_modul]</a>";
  }
} 
?>
