 <?php 
$menu = $_GET["menu"];
$submenu  = $_GET["submenu"];
$login  = $_GET["login"];
$project_selected  = $_GET["project"];

include "menu_setActive.php";

//check if menu/submenu contain "_"
if( strpos($menu, "_" ) !== false) {
    $string_with_underscores = $menu;

	$string_with_spaces = str_replace("_"," ", $string_with_underscores);

	$menu = $string_with_spaces;
}
if( strpos($submenu, "_" ) !== false) {
    $string_with_underscores = $submenu;

	$string_with_spaces = str_replace("_"," ", $string_with_underscores);

	$submenu = $string_with_spaces;
}
//check if menu/submenu contain "_"
if( strpos($menu, " " ) !== false) {
    $string_with_underscores = $menu;

	$string_with_spaces = str_replace(" "," ", $string_with_underscores);

	$menu = $string_with_spaces;
}
if( strpos($submenu, " " ) !== false) {
    $string_with_underscores = $submenu;

	$string_with_spaces = str_replace(" "," ", $string_with_underscores);

	$submenu = $string_with_spaces;
}
$_SESSION["menu"] = $menu;
$_SESSION["submenu"] = $submenu;
		
 ?>
 <aside class="menu-sidebar d-none d-lg-block">
	<div class="logo">
		<a href="#" style="padding-top:25px;">
			<!--<img src="images/icon/LOGO PAYPRO GREY1.png" alt="PAYPRO-V3" />-->
			<img src="images/icon/PHSSBRENTPROP 6.png" alt="PHSSB RENTAL PROPERTY MANAGEMENT SYSTEM" />
		</a>
	</div>
	
	
	<div class="menu-sidebar__content js-scrollbar1">
		<nav class="navbar-sidebar">
			
			<ul class="list-unstyled navbar__list" >
				<li class="<?php echo $active_dashboard?> has-sub">
					<!--<a class="js-arrow" href="staff_dashboard.php?login=<?php echo $login?><?php echo $projectLocationAction?>&project=<?php echo $project_selected?>&menu=Dashboard">-->
					<a class="js-arrow" href="staff_dashboard.php?menu=Dashboard">
						<i class="fas fa-chart-bar"></i>Dashboard</a>
				</li>
				<?php if($_SESSION["projectLocation"] != ""){?>
				<li class="<?php echo $active_projectLocationListing?>" >
					<!--<a href="projectLocationListing.php?login=<?php echo $login?><?php echo $projectLocationAction?>&project=<?php echo $project_selected?>&menu=Project_And_Locations">-->
					<a href="projectLocationListing.php?menu=Project_And_Locations">
						<i class="fas fa-location-arrow"></i>Projects & Locations</a>
				</li>
				<li class="<?php echo $active_properties?> has-sub" >
					<a class="js-arrow" href="#">
						<i class="fas fa-home"></i>Properties
						
					</a>
					<ul class="list-unstyled navbar__sub-list js-sub-list">
						<li class="<?php echo $active_properties_registerNew ?>">
							<a href="properties_registerNew.php?menu=Properties&submenu=New_Properties">
								<i class="fas fa-plus-circle"></i>Register New Properties</a>
						</li>
						<li class="<?php echo $active_properties_listing ?> ">
							<a href="properties_listing.php?menu=Properties&submenu=Listing">
								<i class="fas fa-th-list"></i>Property Listing</a>
						</li>
						<li class="<?php echo $active_properties_occupancy ?> ">
							<a href="properties_occupancy.php?menu=Properties&submenu=Occupancy">
								<i class="fas  fa-home"></i>Occupancy</a>
						</li>
					</ul>
				</li>
				<li class="<?php echo $active_tenant?> has-sub" >
					<a class="js-arrow" href="#">
						<i class="fas fa-users"></i>Tenant</a>
					<ul class="list-unstyled navbar__sub-list js-sub-list">
						<li class="<?php echo $active_tenant_registerNew ?> ">
							<a href="tenant_registerNew.php?menu=Tenant&submenu=Registration">
								<i class="fas fa-plus-circle"></i>Register New Tenant</a>
						</li>
						<li class="<?php echo $active_tenant_listing ?> ">
							<a href="tenant_listing.php?menu=Tenant&submenu=Listing">
								<i class="fas  fa-th-list"></i>Tenant Listing</a>
						</li>
						<li class="<?php echo $active_tenant_invoiceListing ?> ">
							<a href="tenant_invoiceListing.php?menu=Tenant&submenu=Invoice">
								<i class="fas fa-book"></i>Invoice Listing</a>
						</li>
						<li class="<?php echo $active_tenant_waterBills ?> ">
							<a href="waterBills.php?menu=Tenant&submenu=Water_Bills">
								<i class="fas fa-book"></i>Water Bills</a>
						</li>
					</ul>
				</li>
				<li class="<?php echo $active_report?> has-sub" >
					<a class="js-arrow" href="#">
						 <i class="fas fa-copy"></i>Report</a>
					<ul class="list-unstyled navbar__sub-list js-sub-list">
						<li class="<?php echo $active_payment_report ?> ">
							<a href="report_all_payments.php?menu=Report&submenu=Payments_Report">
								<i class="fas fa-calendar"></i>Payments Report</a>
						</li>
						<li class="<?php echo $active_not_paid_list ?> ">
							<a href="report_not_paid_list.php?menu=Report&submenu=Not_Paid_list">
								<i class="fas fa-book"></i>Not Paid List</a>
						</li>
						<!--<li class="<?php echo $active_report_deposit ?> ">
							<a href="report_all_payments.php?login=<?php echo $login?><?php echo $projectLocationAction?>&project=<?php echo $project_selected?>&menu=Report&submenu=Deposit">
								<i class="fas fa-hand-o-right"></i>Deposit</a>
						</li>
						<li class="<?php echo $active_report_rental ?> ">
							<a href="report_all_payments.php?login=<?php echo $login?><?php echo $projectLocationAction?>&project=<?php echo $project_selected?>&menu=Report&submenu=Rental">
								<i class="fas fa-hand-o-right"></i>Rental</a>
						</li>
						<?php if($_SESSION["projectName"] == "PPR") {?>
						<li class="<?php echo $active_report_water ?> ">
							<a href="report_all_payments.php?login=<?php echo $login?><?php echo $projectLocationAction?>&project=<?php echo $project_selected?>&menu=Report&submenu=Water">
								<i class="fas fa-hand-o-right"></i>Water</a>
						</li>
						<?php } ?>-->
						<li class="<?php echo $active_report_Ageing ?> ">
							<a href="report_Ageing.php?menu=Report&submenu=Ageing">
								<i class="fas fa-table"></i>Ageing</a>
						</li>
						<li class="<?php echo $active_report_6_years_outstanding ?> ">
							<a href="report_6YearsOutstanding.php?menu=Report&submenu=More_Than_Six_Years_Outstanding">
								<i class="fas fa-table"></i>More Than 6 Years Oustanding</a>
						</li>
						<li class="<?php echo $active_report_propertiesTenant ?> ">
							<a href="report_propertiesTenant.php?menu=Report&submenu=Properties_And_Tenant">
								<i class="fas fa-users"></i>Properties & Tenant</a>
						</li>
						<li class="<?php echo $active_report_tenantInOut ?> ">
							<a href="report_tenantInOut.php?menu=Report&submenu=Tenant_In_Out">
								<i class="fas fa-tasks"></i>Tenants In/Out Info</a>
						</li>
					</ul>
				</li>
				<li class="<?php echo $active_notice?> has-sub" >
					<a class="js-arrow" href="#">
						  <i class="fas fa-bell"></i>Notices</a>
					<ul class="list-unstyled navbar__sub-list js-sub-list">
						<li class="<?php echo $active_notice1 ?> ">
							<a href="notice1.php?menu=Notice&submenu=1">
								<i class="far fa-bell"></i>Notice 1</a>
						</li>
						<li class="<?php echo $active_notice2 ?> ">
							<a href="notice2.php?menu=Notice&submenu=2">
								<i class="far fa-bell"></i>Notice 2</a>
						</li>
						<li class="<?php echo $active_notice3 ?> ">
							<a href="notice3.php?menu=Notice&submenu=3">
								<i class="far fa-bell"></i>Notice 3</a>
						</li>
						<li class="<?php echo $active_notice4 ?> ">
							<a href="notice4.php?menu=Notice&submenu=4">
								<i class="far fa-bell"></i>Notice 4</a>
						</li>
						<li class="<?php echo $active_notice5 ?> ">
							<a href="notice5.php?menu=Notice&submenu=5">
								<i class="far fa-bell"></i>Notice 5</a>
						</li>
					</ul>
				</li>
			</ul>
			<?php 
				}
				if($_SESSION["type"] == "admin"){
			?>
			<ul class="list-unstyled navbar__list">
				<li class="<?php echo $active_admin?> has-sub">
					<a class="js-arrow" href="#">
						<i class="fas fa-lock"></i><b>ADMINISTRATION</b>
						
					</a>
					<ul class="list-unstyled navbar__sub-list js-sub-list">
						<li class="<?php echo $active_projects_listing ?> ">
							<a href="projects_listing.php?menu=ADMINISTRATION&submenu=Projects">
								<i class="fas fa-folder-open"></i>Projects</a>
						</li>
						<li class="<?php echo $active_report_admin ?> ">
							<a href="report_admin.php?menu=ADMINISTRATION&submenu=Report">
								<i class="fas fa-copy"></i>Report</a>
						</li>
						<li class="<?php echo $active_createBills ?> ">
							<a href="createBills.php?menu=ADMINISTRATION&submenu=Create_Bills">
								<i class="fas fa-clipboard"></i>Create Bills</a>
						</li>
						<li class="<?php echo $active_manageUsers ?> ">
							<a href="manageUsers.php?menu=ADMINISTRATION&submenu=Manage_Users">
								<i class="fas fa-puzzle-piece"></i>Manage Users</a>
						</li>
					</ul>
				</li>
			
			</ul>
				<?php } ?>
			
		</nav>
	</div>
</aside>