	<?php
	//Menu 
	$actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
	//	echo "<br>thisPage : ".$actual_link;
	
	$mulai = 0;
	$curPage1 = "";
	$curPage = explode("/",$actual_link);
	$ctr_level = 0;
	$menuLV = array();
	foreach ($curPage as $url) {
		if ($url == "pages") {
			$mulai = 1;
		}
		if ($mulai == 1) {
			if ($url != "index.php") {
				if ($curPage1 != "") 
					$curPage1 .= "/";
				if ($url != "pages") {
					$menuLV[]=$url;
					$ctr_level++;
				}
				$curPage1 .= $url;
			}
		}
	}
	
	$curPage1 .= "/";
	//echo "<br>Cur Page : ".$curPage1;
	//echo "<br> Ctr Level : ".$ctr_level;
	//echo "<br> Menu 1: ".$menuLV[0];
	//echo "<br> Menu 2: ".$menuLV[1];
	//echo "<br> Menu 3: ".$menuLV[2];
	//echo "<br> Menu 4: ".$menuLV[3];
	
	$txt_legend = '';	
	
	$sql = "select * from user_menu where target_page='$curPage1'";
	//echo "".$sql;
	if ($hasil = mysqli_query($conn, $sql)) {
		while ($data = mysqli_fetch_array($hasil)) {
			$menu_id = $data["menu_id"];
			$nama_menu = $data["nama_menu"];
			$menusIDParent = $data["menusIDParent"];
			$target_page = $data["target_page"];
			$currPage = $thisPage.$target_page;
			$txt_legend .='
			<div class="M060 hide-for-small">
				<div class="row">
					<div class="rowInner">
						<div class="col l-col12 m-col12 s-col12">';
							if ($thisPage)
							$txt_legend .='
							<a href="'.$thisPage.'">Homepage</a>';
							$txt_legend .='	
							<span class="breadcrumbSpacer">&gt;</span>
							<a href="'.$currPage.'">'.$nama_menu.'</a>';
							$txt_legend .='	
						</div>	
					</div>		
				</div>			
			</div>		
			';
		}
		//echo "<br>txt_legend : ".$txt_legend;	
	}
	?>