
 <style type="text/css">
   /* Position submenus to the right */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  border-radius: 0.25rem;
  display: none;
  position: absolute;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

 </style>




 <nav class="navbar navbar-expand-lg navbar-dark fixed-top">

  <!-- Navbar brand -->
  <a class="navbar-brand" href="/"><img  src="uploads/<?php echo $info['logo']; ?>" style="max-width: 200px;" ></a>

  <!-- Collapse button -->
    
  <img src="img/nav-btn.svg" alt="nav-btn" class="navbar-toggler nav-menu-btn" type="button" data-toggle="collapse" data-target="#basicExampleNav"
    aria-controls="basicExampleNav" aria-expanded="false" aria-label="Toggle navigation">

  <!-- Collapsible content -->
<div class="collapse navbar-collapse" id="basicExampleNav">
  <!-- Links -->
  <ul class="navbar-nav ml-auto">
    <li class="nav-item">
      <a class="nav-link" href="/">Home</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="about.php">About Us</a>
    </li>
    






      <?php

      $visaTypes = $conn->query("SELECT id, visa_type FROM visa_types");
      while ($visa = $visaTypes->fetch_assoc()) {
        ?>
        <!-- Each Visa Type in Navbar -->
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="visaDropdown<?php echo $visa['id']; ?>" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <?php echo $visa['visa_type']; ?>
          </a>
          <ul class="dropdown-menu" aria-labelledby="visaDropdown<?php echo $visa['id']; ?>">
            <?php
            $subVisaTypes = $conn->query("SELECT id, sub_visa_type FROM sub_visa_types WHERE visa_type_id = {$visa['id']}");
            while ($sub = $subVisaTypes->fetch_assoc()) {
              ?>
              <li class="dropdown-submenu">
                <a class="dropdown-item dropdown-toggle" href="#"><?php echo $sub['sub_visa_type']; ?></a>
                <ul class="dropdown-menu">
                  <?php
                  $visaTypeId = $conn->real_escape_string($visa['id']);
                  $subVisaId = $conn->real_escape_string($sub['id']);
                  $countriesQuery = "
                    SELECT v.country_id, c.country_name
                    FROM visas v
                    JOIN countries c ON v.country_id = c.id
                    WHERE v.visa_type = '$visaTypeId' AND v.sub_visa_type = '$subVisaId'
                  ";
                  $countries = $conn->query($countriesQuery);
                  while ($country = $countries->fetch_assoc()) {
                    $link = "visas.php?keyword=&country_id={$country['country_id']}&sub_visa_type={$sub['id']}&visa_type=" . urlencode($visa['id']);
                    echo "<li><a class='dropdown-item' href='$link'>{$country['country_name']}</a></li>";
                  }
                  ?>
                </ul>
              </li>
              <?php
            }
            ?>
          </ul>
        </li>
        <?php
      }
      ?>






    <li class="nav-item">
  <a class="nav-link" href="blog.php">Blogs</a>
</li>






<li class="nav-item">
  <a class="nav-link" href="contact.php">Contact Us</a>
</li>

    
    <li class="nav-item ml-lg-5">
      <?php if (isset($_SESSION['user_name'])): ?>
        <div class="dropdown">
          <a class="nav-link dropdown-toggle btn nav-button btn-lg text-white" href="#" role="button" data-bs-toggle="dropdown">
            <?php echo $_SESSION['user_name']; ?> <i class="fa fa-user-o"></i>
          </a>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="logout.php">Logout</a></li>
          </ul>
        </div>
      <?php else: ?>
        <a class="nav-link btn nav-button btn-lg text-white" href="login.php">Account <i class="fa fa-user-o"></i></a>
      <?php endif; ?>
    </li>
  </ul>
</div>

  <!-- Collapsible content -->

</nav>
<br><br>
