<?php 
	if (isset($_SESSION['admin_id'])) { 
		$admin_id = $_SESSION['admin_id'];
		$profile_result = mysqli_query($con, "SELECT * FROM admin WHERE admin_id = $admin_id");
		$profile_row = mysqli_fetch_array($profile_result);
		$name = $profile_row['admin_name'];
 		$role = $profile_row['role'];
		//$admin_image = $profile_row['admin_image'];
	}
?> 
 <aside class="left-sidebar">
            <!-- Sidebar scroll-->
            <div class="scroll-sidebar">
                <!-- User profile -->
                <div class="user-profile">
                    <!-- User profile image -->
                    <div class="profile-img"> <img src="uploads/admin/<?php echo $profile_row['admin_image']?>" onerror="this.onerror=null;this.src='../assets/images/default.png';" style="width: 60px;height: 60px;line-height: 80px;font-size: 30px;object-fit: inherit;" alt="user" />
                        <!-- this is blinking heartbit-->
						<div class="notify setpos"> <span class="heartbit"></span> <span class="point"style="background:#8dc63f !important"></span> </div>
                    </div> 
                    <!-- User profile text-->
                    <div class="profile-text">
						<h5><?=$name;?></h5>
                         <a href="profile.php" data-toggle="tooltip" title="Profile" class="dropdown-toggle u-dropdown" role="button"><i class="ti-user"></i></a>
                         <a href="system_settings.php" data-toggle="tooltip" title="Profile" class="dropdown-toggle u-dropdown" role="button"><i class="ti-settings"></i></a>
                        <a href="logout.php" class="" data-toggle="tooltip" title="Logout"><i class="mdi mdi-power"></i></a>
                        
                    </div>
                </div>
                <!-- End User profile text-->
                <!-- Sidebar navigation-->
                <nav class="sidebar-nav">
                    <ul id="sidebarnav">
                        <li class="nav-devider"></li>
						<li> <a class="" href="index.php"><i class="mdi mdi-gauge"></i><span class="hide-menu">Dashboard </a>
						</li>
						<?php if($role=='Super Admin'){?>
							<li> <a class="" href="add_product.php"><i class="mdi mdi-near-me"></i><span class="hide-menu">Add Product</a>
							</li>
							<li> <a class="" href="manage_products.php"><i class="mdi mdi-widgets"></i><span class="hide-menu">Manage Products</a>
							</li>
							<li> <a class="" href="active_orders.php"><i class="mdi mdi-cart-plus"></i><span class="hide-menu">Active Orders</a>
							</li>
							<li> <a class="" href="completed_orders.php"><i class="mdi mdi-check-all"></i><span class="hide-menu">Completed Orders</a>
							</li>
							<li style="display:"> <a class="" href="banner.php"><i class="mdi mdi-image"></i><span class="hide-menu">Change Banner</a>
							<li> <a class="" href="testimonials.php"><i class="mdi mdi-creation"></i><span class="hide-menu">Testimonials </a>
							</li>
							<li> <a class="" href="system_settings.php"><i class="mdi mdi-creation"></i><span class="hide-menu">System Settings </a>
							</li>
							</li>
						<?php } ?> 
						
						<?php if($role=='User'){?>
							<li> <a class="" href="profile.php"><i class="mdi mdi-account-multiple"></i><span class="hide-menu">Profile Settings</a>
							</li>
						<?php } ?>
                    </ul>
                </nav>
                <!-- End Sidebar navigation -->
            </div>
            <!-- End Sidebar scroll-->
        </aside>