	<?php
	function listMenu(&$ctr, $thisPage, &$menuName, &$subLevel, &$li_style, $parent=0) {
		$sql7 = "select * from menus WHERE menusIDParent = '$parent' AND menusActive = '1' ORDER BY menusOrder ";
		if ($hasil7 = mysql_query($sql7)) {
			while ($data7 = mysql_fetch_array($hasil7)) {
				$current_url = explode('/',$data7["menusLink"]);
				if ($data7["menusIDParent"] == 0) {
					if ($li_style == '')
						$li_style = ' class="is-first-for-desktop" ';
					else 
						$li_style = ' class="padding-left-30" ';

					$href_style = 'class="mainNavItem nav-item '.$data7["menusSub"].'"';
					
					if ($data7["menusSub"] == "noSub") {
						$linkLv1 = $thisPage.$current_url[0].$current_url[1];	
					} else if ($data7["menusSub"] == "hasSub") {
						$linkLv1 = "#";
					}
					
					$menuName .= '<li '.$li_style.' >
									<a '.$href_style.' data-flyout-id="nav-sub-'.$ctr.'" href="'.$linkLv1.'">
										'.strtoupper($data7["menusName"]).'
									</a>';
									$subLevel = '';
				} else {
					if (mysql_num_rows($hasil7) > 0) {
						if ($subLevel == '') {
							$menusSection = $data7["menusSection"];
							$subLevel = "first";
							$first = $subLevel;
							$menuName .= '
							<nav id="nav-sub-'.$ctr.'" class="mainSubNavigation"> 
								<section class="'.$first.'">
									<ul class="level-2">';
						} else if ($menusSection != $data7["menusSection"]) {
							$menusSection = $data7["menusSection"];
							$menuName .= '
									</ul>
								</section>
								<section>
									<ul class="level-2">';
						}
							$search_array = array(
							53 => 'https://www.timeanddate.com/weather/indonesia/jakarta', 
							54 => 'https://www.worldtimeserver.com/current_time_in_ID.aspx',
							55 => 'http://www.xe.com/currencyconverter/convert/?Amount=1&From=USD&To=IDR',
							56 => 'http://www.indonesia.travel/en');
							if (array_key_exists($data7["menusID"], $search_array)) {
								$linkMenu = $search_array[$data7["menusID"]];
								$target = "_blank";
							} else {
								$linkMenu = $thisPage.$current_url[0].'/'.$current_url[1];
								$target = "_self";
							}
							$menuName .= '
                           				<li>
                         					<a class="nav-item" href="'.$linkMenu.'" target="'.$target.'">
												'.$data7["menusName"].'
											</a>
										</li>';
					}					
				}
				listMenu($ctr, $thisPage, $menuName, $subLevel, $li_style, $data7["menusID"]);
				$ctr++;
				if ($data7["menusIDParent"] == 0) {
					$menuName .= '</li>';	
				}
			}
			if (mysql_num_rows($hasil7) > 0) {
				if ($subLevel != '') {
				$menuName .= '
						</ul>
					</section>
				</nav>';	
				}
			}
		}
	}
	?>

	<?php
	$expoDate 			= "21 October - 04 November 2021";
	$expoVenue 			= "";
	$titleWebsite		= "TEI | Trade Expo Indonesia";
	$logoDesktop 		= "logo_desktop.png";
	$logoMobile 		= "logo_desktop.png";
	$logoPrint 			= "logo_desktop.png";
	$logoDesktopTitle 	= "date_tei.png";
	$menuName 			= "";
	$li_style 			= '';
	
	$sql6 = 
	" select * from menus ".
	" WHERE menusActive = '1' ".
	" ORDER BY menusID ";
	if ($hasil6 = mysql_query($sql6)) {
		if (mysql_num_rows($hasil6) > 0) {
			$menuName = '
			<div class="mainNavigationWrap M002">
				<nav class="mainNavigation">
					<ul class="clearfix level-1">';	
						$ctr = 0;
						$subLevel = '';
						listMenu($ctr, $thisPage, $menuName, $subLevel, $li_style, 0);
						$menuName .= '
					</ul>
				</nav>
			</div>
			';//<img class="spacerRowImage" src="'.$thisPage.'images/spacer-bg.png" alt="" title="">	
		}
	}
	
	$headerMenu = '
	<div class="pageHeaderWrap trim-top-bottom">
		<header class="pageHeader clearfix trim-top-bottom">
			<section class="layout-centered trim-top-bottom">					
				<div class="col l-col12 m-col12 s-col12 trim-top-bottom">
					<div class="teasers trim-top-bottom">
						<div class="col l-col12 m-col12 s-col12 hide-for-small trim-top-bottom" style="padding:5px 0px;">
							<div class="col l-col9 m-col9 s-col9  trim-top-bottom">
								<a href="'.$thisPage.'" itemprop="url">
									<span class="header_logo_fair">
										<meta itemprop="name" content="'.$titleWebsite.'" />
										<img itemprop="logo" class="logoHost" src="'.$thisPage.'images/logo/'.$logoDesktop.'" alt="'.$titleWebsite.'" />
									</span>
								</a>
							</div>
							<div class="col l-col3 m-col3 s-col3  trim-top-bottom">
								<img class="logoRight" src="'.$thisPage.'images/logo/'.$logoDesktopTitle.'" alt="" />
							</div>
						</div>
					</div>
				</div>	
			</section>';
			
			$headerMenu .= '
			<div style="width:100%">
				<section class="right hide-for-small group-logo" itemscope="itemscope" itemtype="http://schema.org/Organization">';
					$headerMenu .= '
				</section>				
			</div>
			<div class="hide-for-medium-up">
				<section class="mobileHeader">
					<a href="'.$thisPage.'">
						<img style="padding-bottom:6px;" class="logo" src="'.$thisPage.'images/logo/'.$logoMobile.'" width="118px" alt="'.$titleWebsite.'" />
					</a>
					<a class="nav-trigger" rel="mainnavigation" href="#">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>
				</section>
			</div>';
			
			$headerMenu .= '
			<div class="hide-for-medium-up">
				<div style="width:100%; display:block; padding:7px 0px; 
				margin:7px 0px 0px 0px; clear:both; background-color:#00873a">
					<h5 class="h5-teaser" style="text-align:center; color:#ffffff; font-weight:normal">
						'.$expoDate.'<br>
						'.$expoVenue.'
					</h5>
				</div>
			</div>';
			$headerMenu .= 
			$menuName.'
		</header>
		<div style="background-color:#FFFFFF; height:2px; display:block;"></div>
	</div>';
	
	$headerMenu .= '
	<div class="page-header-print is-printable-only">
		<div class="rowInner">
			<div class="timestamp">
				<strong>'.$titleWebsite.'</strong>
			</div>';
			$headerMenu .= '
			<div class="logo">
				<img itemprop="logo" class="logoHost" src="'.$thisPage.'images/logo/'.$logoPrint.'" alt="'.$titleWebsite.'" />
				<span class="claim" itemprop="brand">'.$titleWebsite.'</span>
			</div>			
		</div>
	</div>';
	
	if ($headerMenu) echo $headerMenu;
	?>