<header class="header">

	<nav class="navbar navbar-expand-lg header-nav">

		<div class="navbar-header">

			<a id="mobile_btn" href="javascript:void(0);">

				<span class="bar-icon">

					<span></span>

					<span></span>

					<span></span>

				</span>

			</a>

			<a href="index.php" class="navbar-brand logo">

				<img src="assets/img/logo/<?php if($logo['logo_status'] == 1){ echo $logo['logo_image']; }?>" class="img-fluid" alt="<?= $logo['logo_name'] ?> Logo image">

			</a>

		</div>

		<div class="main-menu-wrapper">
			<div class="menu-header">
				<a href="#" class="menu-logo">
					<img src="assets/img/logo/<?php if($logo['logo_status'] == 1){ echo $logo['logo_image']; }?>" class="img-fluid" alt="<?= $logo['logo_name'] ?> Logo image">
				</a>
				<a id="menu_close" class="menu-close" href="javascript:void(0);">
					<i class="fas fa-times"></i>
				</a>
			</div>
			<ul class="main-nav">
                   <li><a href="index.php">HOME</a></li>
                         <li><a href="about.php">ABOUT US</a></li>
				<?php 
				    $sql ="SELECT * FROM main_category WHERE Main_Category_Status = 1";
				    $res = $config->query($sql);
				    while($row = $res->fetch_assoc()){
				        $main_id = $row['Main_Category_id'];
				?>
                <li class="has-submenu">
					<a href="#"><?= $row['Main_Category_Name'] ?> <i class="fas fa-chevron-down"></i></a>
					<ul class="submenu">
					<?php 
					    $sub_sql ="SELECT * FROM sub_category WHERE Sub_Category_Status = 1 AND  Main_Category_sub = '$main_id' ";
					    $sub_res = $config->query($sub_sql);
					    while($sub_row = $sub_res->fetch_assoc()){
					?>
						<li><a href="detail.php?event=<?= $sub_row['Sub_Category_id'] ?>"><?= $sub_row['Sub_Category_Name'] ?></a></li>
						<?php } ?>
					</ul>
				</li>
				<?php } ?>
                         
								<li><a href="contact.php">CONTACT US</a></li>

			</ul>		 
		</div>		 

		<ul class="nav header-navbar-rht">
		    <?php 
		    if(isset($_SESSION['user_id']) && $_SESSION['user_cate'] == "user" ){
		        if($page == "index"){ ?>
    		        <li class="nav-item">
        			    <a class="nav-link header-login" href="dashboard.php"><i class="fas fa-user"></i> My account</a>
        			</li>
		        <?php }else{ ?>
    		        <li class="nav-item">
        			    <a class="nav-link header-login" href="logout.php"><i class="fas fa-lock"></i> logout</a>
        			</li>
		        <?php } 
		    }else if(isset($_SESSION['user_id']) && $_SESSION['user_cate'] == "vendor" ){
		        if($page == "index"){ ?>
    		        <li class="nav-item">
        			    <a class="nav-link header-login" href="vendor_dashboard.php"><i class="fas fa-user"></i> My account</a>
        			</li>
		        <?php }else{ ?>
    		        <li class="nav-item">
        			    <a class="nav-link header-login" href="vendor_logout.php"><i class="fas fa-lock"></i> logout</a>
        			</li>
		        <?php } 
		    }else{
    		    if($page == "login"){ ?>
    		    <li class="nav-item">
    			    <a class="nav-link header-login" href="register.php"><i class="fas fa-user-plus"></i> Sign up</a>
    			</li>
    		    <?php }else{ ?>
    		    <li class="nav-item">
    			    <a class="nav-link header-login" href="login.php"><i class="fas fa-lock"></i> login</a>
    			</li>
		    <?php } } ?>
		</ul>
		

	</nav>

</header>