 <?php
	//determine user type for nav items and access
	if(isset($_GET['ut'])){
		//by defining the $userType variable conditionally, we can use isset later in the code to 
		//ensure that a user has been registered
		if($_GET['ut']==3) $userType="Admin";
		if($_GET['ut']==2) $userType="Organizer";
		if($_GET['ut']==1) $userType="Participant";
	}
 ?>
 
 <nav class="navbar navbar-expand-md navbar-dark bg-primary fixed-top">
  <a class="navbar-brand" href="index.php"><img src='images/signmeup_logo_white.png' /><span>SignMeUp</span></a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarsExampleDefault">
    <ul class="navbar-nav ml-auto">
      <li class="nav-item">
        <a class="nav-link" href="index.php#about">About</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="index.php#services">Services</a>
      </li>
	  <li class="nav-item">
        <a class="nav-link" href="index.php#support">Support</a>
      </li>
	  
	  <?php
			//ADMIN CONDITIONAL NAV
			//by checking for $userType to be set first, we can utilize short circuiting
			//to avoid checking the second item and possibly creating an error or warning
			if(isset($userType) && $userType=="Admin"){
	  ?>
	  <li class="nav-item">
        <a class="nav-link" href="eventManagement.php?ut=3">Admin</a>
      </li>	  
	  <?php
			}//end admin if
	  ?>
	  
	  <?php
			//ORGANIZER CONDITIONAL NAV
			if(isset($userType) && $userType=="Organizer"){
	  ?>
	  <li class="nav-item">
        <a class="nav-link" href="organizer.php?ut=2">My Events</a>
      </li>
	  <?php
			}//end organizer if
	  ?>
	  
	  <?php
			//PARTICIPANT CONDITIONAL NAV
			if(isset($userType) && $userType=="Participant"){
	  ?>
	  <li class="nav-item">
        <a class="nav-link" href="participant.php?ut=1">My Events</a>
      </li>
	  <?php
			}//end participant if
	  ?>
	  
	  
	  
	  
	  
	  <!-- LOGIN ITEM -->
	  <li class="nav-item login">
		<?php
			if(isset($userType))
				echo "<li class='nav-link'>Welcome, $userType</li>";
			else{
		?>
				<a class="nav-link" href="#"><i class='fa fa-user'></i>Sign In</a>
		<?php
			} //end else
		?>
      </li>

    </ul>

  </div>
</nav>