<?php 
$yetkiid = $_SESSION['id'];
$yetkiliogren = $db->query("select * from yonetici where id='$yetkiid'")->fetch(PDO::FETCH_ASSOC);
$yetki = $yetkiliogren['admin'];
?>
<?php 
if($yetki == 'yetkili') { 
    $izin = $db->query("SELECT * FROM izinler Where id='1'")->fetch(PDO::FETCH_ASSOC);
}else if($yetki == 'kullanici'){
    $izin = $db->query("SELECT * FROM kullaniciizinler Where id='1'")->fetch(PDO::FETCH_ASSOC);
}else if($yetki == 'admin'){
    $izin = $db->query("SELECT * FROM adminizni Where id='1'")->fetch(PDO::FETCH_ASSOC);
}
?>

<nav class="navbar navbar-expand-lg d-flex justify-content-between">
              <div class="" id="navbarNav">
                <ul class="navbar-nav" id="leftNav">
                  <li class="nav-item">
                    <a class="nav-link" id="sidebar-toggle" href="#"><i data-feather="arrow-left"></i></a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="index.php">Anasayfa</a>
                  </li>
                     <?php
                    if($yetki == 'admin'){ ?>
                    <li class="nav-item">
                       <a class="nav-link" href="adminizinler.php">İzin</a>
                    </li>
                    <?php } else  if($yetki == 'yetkili'){ ?>
                    <li class="nav-item">
                       <a class="nav-link" href="kullaniciizinler.php">İzinler</a>
                    </li><?php } ?>
                  
                   <?php if($izin['bakimmoduizni'] == 'on'){ ?>
                   <li class="nav-item">
                    <a class="nav-link" href="bakim_modu.php">Bakım Modu</a>
                  </li>
                  <?php } ?>
                
                   <li class="nav-item">
                    <a class="nav-link" href="../" target="_blank">Siteye Geç</a>
                  </li>
                 
                </ul>
                </div>
                <div class="">
                  <a class="" href="../"><img src="../resimler/<?=$ayarlar['logo']?>" width="70"></a>
                </div>
                    <div class="" id="headerNav">
                      <ul class="navbar-nav">
                       
                       
                        <li class="nav-item dropdown">
                          <a class="nav-link profile-dropdown" href="#" id="profileDropDown" role="button" data-bs-toggle="dropdown" aria-expanded="false"><img src="../resimler/<?=$ayar['favicon']?>" alt=""></a>
                          <div class="dropdown-menu dropdown-menu-end profile-drop-menu" aria-labelledby="profileDropDown">
                               <a class="dropdown-item"><?=$yetkiliogren['ad_soyad']?></a>
                                <div class="dropdown-divider"></div>
                            <a class="dropdown-item"  href="ayarlar.php"><i data-feather="settings"></i>Ayarlar</a>
                             <?php if($yetki == 'admin'){ ?> <a class="dropdown-item"  href="yonetim.php"><i data-feather="settings"></i>Admin Ayar</a><?php } ?>
                         <a class="dropdown-item" href="yonetici-ekle.php?islem=duzenle&id=<?=$yetkiliogren['id']?>"><i data-feather="user"></i>Hesabım</a>
                           
                             <a class="dropdown-item" target="_blank" href="../"><i data-feather="log-out"></i>Siteye Geç</a>
                            <div class="dropdown-divider"></div>
                             
                            <a class="dropdown-item" href="giris.php"><i data-feather="check-circle"></i>Çıkış</a>
                          </div>
                        </li>
                      </ul>
                  </div>
              
            </nav>