<?php


//If User is disabled - redirect to blocked page
if($row["disable"] == "disabled"){
	
	echo "<script> location.href= 'blocked.php'; </script>";
	}
	

	
	
			//Check if site is locked - Effect site lock if pin is not set from "underMaintainance.php"
			//This is code is also pasted on "register-login.php", "index.php", user "dashboard/sidebar.php" and admin "admin/sidebar.php" 
			//to redirect user once site is blocked since sidebars appears in all pages
			
			$stmt=$pdo->prepare("SELECT * FROM maintenance");
			$stmt->execute();
			$value = $stmt->fetch();
			
			if($stmt->rowCount() > 0 && $value["locked"] == "locked"){
				
			if(!isset($_SESSION["site_lock"])){
			echo '<script>location.href="../underMaintainance.php"</script>';
			}
			
			//if pass code from Session does not match code from "maintenance" table, bounce back and unset session
			//if eventually admin changed the passcode, and users previous pass Code session is set, it'll bounce them out
			elseif($_SESSION["site_lock"] !== $value["passCode"]){
			
			unset($_SESSION["site_lock"]);
			echo '<script>location.href="../underMaintainance.php"</script>';			
			
			}
			}

?>




<link href="../css/flaticon7eda.css" rel="stylesheet">


<style>
.metismenu .dropdown-divider{
	border-color:#525e70;
}
</style>

		<div id="sidebar-menu">

          <ul class="metismenu" id="side-menu">
			<center>
			<a href="profile.php">
			<img src="<?php echo $userimage;?>" class="avatars"><br>
			<div style="margin:10px auto 20px; font-size:17px; color:#f1f1f1; font-weight:500;"><?php echo htmlspecialchars($row["fullName"]);?></div>
			</a></center>
			<div class="dropdown-divider"></div>

			
			<li>
              <a href="account.php">
                <i class="fas fa-tachometer-alt"></i>
                <span> Dashboard </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
			<li>
              <a href="profile.php">
                <i class=" fas fa-user-cog"></i>
                <span> Profile </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
            <li>
              <a href="inbox.php">
                <i class=" fas fa-user-check"></i>
                <span>Support</span>
              </a>
            </li>
            <div class="dropdown-divider"></div>
			
            <li>
              <a href="invest.php">
                <i class=" fas fa-dollar-sign"></i>
                <span> Invest </span>
              </a>
            </li>
            <div class="dropdown-divider"></div>
			
            <li>
              <a href="withdrawal.php">
                <i class="fas fa-wallet"></i>
                <span> Withdraw </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
           
            <li>
              <a href="inbox.php?service=charges">
                <i class="fas fa-dollar-sign"></i>
                <span>Other payments </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
           
            <li>
              <a href="referral.php">
                <i class="flaticon-wallet"></i>
                <span>Referral bonus </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
           
            <li>
              <a href="notifications.php">
                <i class="fas fa-bell"></i>
                <span>Notifications </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
           
            <li>
              <a href="transactions.php">
                <i class="fas fa-history"></i>
                <span> Transaction History </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
           
            <li>
              <a href="changePassword.php">
                <i class=" fas fa-key"></i>
                <span> Change Password </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
			<li>
              <a href="contactUs.php">
                <i class="fa fa-phone"></i>
                <span>Contact Us</span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
			<div class="dropdown-divider"></div>
			
            <li>
              <a href="tandc.php">
                <i class=" fas fa-exclamation"></i>
                <span>Terms & Conditions</span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
			
			 <li>
              <a href="../">
                <i class=" far fas fa-home"></i>
                <span> Home </span>
              </a>
            </li>
			<div class="dropdown-divider"></div>
			
            <li>
              <a href="logout.php">
                <i class=" far fas fa-power-off "></i>
                <span> Log Out </span>
              </a>

            </li>

          </ul>

        </div>