<?php
/*
 PRIMARY NAV
*/

$items = array(array("link"=>"index.php", "label"=>"Home"));

	array_push($items, array("link"=>"forum.php", "label"=>"Forum"));
	array_push($items,  array("link"=>"user_manager.php", "label"=>"Control Panel"));

if($_SESSION['access'] == 'admin') 
  array_push($items, array("link"=>"map_manager.php", "label"=>"Maps"));
 
if($_SESSION['loggedIn'])
	array_push($items,  array("link"=>"logout.php", "label"=>"Logout ".$_SESSION['username']));
else 
	array_push($items, array("link"=>"login.php", "label"=>"Log In"));

$menu = '<ul>';
foreach ($items as $val)
	$menu .= '<li><a href="'.$val['link'].'">'.$val['label'].'</a></li>';
$menu .= '</ul>';


/*
 SECONDARY NAV
*/
$menu .= '<ul class="nav secondary-nav">';

$items = array();

foreach ($items as $val) {
	$menu .= '<li><a href="'.$val['link'].'">'.$val['label'].'</a></li>';
}

$menu .= <<<SEARCH
<form action="index.php"><input name="search" id="search" type="text" placeholder="Report Number"/></form>
SEARCH;

$menu .= '</ul>';

echo $menu;
?>
