<?php
// Database connection aur session check already dashboard.php me ho raha hai
// Hum bas variables fetch karenge agar set nahi hain
if (!isset($wingomanager)) {
  $chkserial = mysqli_query($conn, "select * from `nirvahaka_shonu` where `unohs`='" . $_SESSION['unohs'] . "'");
  $salu = mysqli_fetch_array($chkserial);
  $wingomanager = $salu['wingomanager'];
  $k3manager = $salu['k3manager'];
  $d5manager = $salu['5dmanager'];
  $finance = $salu['finance'];
  $managegame = $salu['managegame'];
  $support = $salu['support'];
}
?>

<ul class="nav" id="sidebar-nav">
  <li class="nav-item <?php echo basename($_SERVER['PHP_SELF']) == 'dashboard.php' ? 'active' : ''; ?>">
    <a class="nav-link" href="dashboard.php">
      <div class="icon-box">
        <i class="fa-solid fa-gauge-high"></i>
      </div>
      <span class="menu-title">Dashboard</span>
    </a>
  </li>

  <?php if ($wingomanager == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-wingo" aria-expanded="false" aria-controls="ui-wingo">
        <div class="icon-box">
          <i class="fa-solid fa-gamepad"></i>
        </div>
        <span class="menu-title">WinGo Manager</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-wingo">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="wingo10min.php">WinGo 30 Sec</a></li>
          <li class="nav-item"> <a class="nav-link" href="wingo1min.php">WinGo 1 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="wingo3min.php">WinGo 3 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="wingo5min.php">WinGo 5 Min</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <?php if ($k3manager == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-k3" aria-expanded="false" aria-controls="ui-k3">
        <div class="icon-box">
          <i class="fa-solid fa-dice"></i>
        </div>
        <span class="menu-title">K3 Manager</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-k3">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="k31min.php">K3 1 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="k33min.php">K3 3 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="k35min.php">K3 5 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="k310min.php">K3 10 Min</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <?php if ($d5manager == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-5d" aria-expanded="false" aria-controls="ui-5d">
        <div class="icon-box">
          <i class="fa-solid fa-layer-group"></i>
        </div>
        <span class="menu-title">5D Manager</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-5d">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="5d1min.php">5D 1 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="5d3min.php">5D 3 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="5d5min.php">5D 5 Min</a></li>
          <li class="nav-item"> <a class="nav-link" href="5d10min.php">5D 10 Min</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <li class="nav-item">
    <a class="nav-link" data-toggle="collapse" href="#ui-games" aria-expanded="false" aria-controls="ui-games">
      <div class="icon-box">
        <i class="fa-solid fa-rocket"></i>
      </div>
      <span class="menu-title">Game Controls</span>
      <i class="menu-arrow fa-solid fa-chevron-right"></i>
    </a>
    <div class="collapse" id="ui-games">
      <ul class="nav flex-column sub-menu">
        <li class="nav-item"> <a class="nav-link" href="chicken.php">Chicken Control</a></li>
        <li class="nav-item"> <a class="nav-link" href="aviator_admin.php">Aviator Control</a></li>
        <li class="nav-item"> <a class="nav-link" href="mineadmin.php">Mine Control</a></li>
      </ul>
    </div>
  </li>

  <?php if ($finance == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-finance" aria-expanded="false" aria-controls="ui-finance">
        <div class="icon-box">
          <i class="fa-solid fa-sack-dollar"></i>
        </div>
        <span class="menu-title">Finance</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-finance">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="addupi.php">Add UPI</a></li>
          <li class="nav-item"> <a class="nav-link" href="usdtkids.php">USDT Rate</a></li>
          <li class="nav-item"> <a class="nav-link" href="addusdt.php">Add USDT</a></li>
          <li class="nav-item"> <a class="nav-link" href="addupiimg.php">Add UPI Image</a></li>
          <li class="nav-item"> <a class="nav-link" href="addimgusdt_2.php">Add USDT Image</a></li>
          <li class="nav-item"> <a class="nav-link" href="deposit_update.php">Deposit Update</a></li>
          <li class="nav-item"> <a class="nav-link" href="manage_withdraw.php">Withdraw Apply</a></li>
          <li class="nav-item"> <a class="nav-link" href="manage_upiw.php">UPI Withdraw</a></li>
          <li class="nav-item"> <a class="nav-link" href="withdraw_accept_list.php">Withdraw Sent</a></li>
          <li class="nav-item"> <a class="nav-link" href="withdraw_reject_list.php">Withdraw Reject</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <?php if ($support == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-support" aria-expanded="false" aria-controls="ui-support">
        <div class="icon-box">
          <i class="fa-solid fa-headset"></i>
        </div>
        <span class="menu-title">Support</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-support">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="deposite.php">Deposit Problem</a></li>
          <li class="nav-item"> <a class="nav-link" href="withprob.php">Withdrawal Problem</a></li>
          <li class="nav-item"> <a class="nav-link" href="ifscm.php">IFSC Modification</a></li>
          <li class="nav-item"> <a class="nav-link" href="bankm.php">Bank Modification</a></li>
          <li class="nav-item"> <a class="nav-link" href="gamep.php">Game Problem</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <?php if ($managegame == 1) { ?>
    <li class="nav-item">
      <a class="nav-link" data-toggle="collapse" href="#ui-admin" aria-expanded="false" aria-controls="ui-admin">
        <div class="icon-box">
          <i class="fa-solid fa-user-shield"></i>
        </div>
        <span class="menu-title">Admin Manage</span>
        <i class="menu-arrow fa-solid fa-chevron-right"></i>
      </a>
      <div class="collapse" id="ui-admin">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item"> <a class="nav-link" href="userbonus.php">Bonus Manage</a></li>
          <li class="nav-item"> <a class="nav-link" href="adminpass.php">Admin Password</a></li>
          <li class="nav-item"> <a class="nav-link" href="autobanuser.php">Check Same IP</a></li>
          <li class="nav-item"> <a class="nav-link" href="abmain.php">Site Maintenance</a></li>
          <li class="nav-item"> <a class="nav-link" href="bannedusers.php">Banned Users</a></li>
          <li class="nav-item"> <a class="nav-link" href="manage_user.php">Manage Users</a></li>
          <li class="nav-item"> <a class="nav-link" href="manage_salary.php">Daily Salary</a></li>
          <li class="nav-item"> <a class="nav-link" href="addgiftcode.php">Gift Code</a></li>
          <li class="nav-item"> <a class="nav-link" href="aadmin.php">Add Admin</a></li>
          <li class="nav-item"> <a class="nav-link" href="demouser.php">Demo User</a></li>
          <li class="nav-item"> <a class="nav-link" href="agentuser.php">Agent User</a></li>
        </ul>
      </div>
    </li>
  <?php } ?>

  <li class="nav-item go-website">
    <a href="https://t.tashanwin7.online" class="nav-link" target="_blank">
      <div class="icon-box">
        <i class="fa-solid fa-arrow-up-right-from-square"></i>
      </div>
      <span class="menu-title">Go To Website</span>
    </a>
  </li>
</ul>