<?php
session_start();
if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser'])){
	header('location:404.php');
}else{
	$action = $_GET['mod'];
	$activehome = ($action == 'home') ? 'active' : '';
	$activepost = ($action == 'post' OR $action == 'category' OR $action == 'tag') ? 'active' : '';
	$activelibrary = ($action == 'library') ? 'active' : '';
	$activepages = ($action == 'pages') ? 'active' : '';
	$activesetting = ($action == 'setting' OR $action == 'theme' OR $action == 'menu') ? 'active' : '';
	$activecomponent = ($action == 'component') ? 'active' : '';
	$activeuser = ($action == 'user') ? 'active' : '';

	$selectlangid = ($localLang == 'indonesia') ? 'selected' : '';
	$selectlangen = ($localLang == 'english') ? 'selected' : '';

	echo "<div class='user'>
            <a title='' class='leftUserDrop'>";
			$filename = "../po-content/po-upload/user-$_SESSION[iduser].jpg";
			if (file_exists("$filename")){
				echo "<img src='../po-content/po-upload/user-$_SESSION[iduser].jpg' alt='' width='72' height='72' />";
			}else{
				echo "<img src='../po-content/po-upload/user-editor.jpg' alt='' width='72' height='72' />";
			}
			echo "</a>
			<span>$_SESSION[namauser]</span>
            <ul class='leftUser'>
                <li><a href='admin.php?mod=user' title='' class='sProfile'>$langmenu27</a></li>
                <li><a href='admin.php?mod=contact' title='$langmenu26' class='sMessages'>$langmenu26</a></li>
                <li><a href='admin.php?mod=setting' title='$langmenu14' class='sSettings'>$langmenu14</a></li>
                <li><a href='logout.php' title='$langmenu22' class='sLogout'>$langmenu22</a></li>
            </ul>
        </div>
        <!-- Responsive nav -->
        <div class='altNav'>
            <div class='userSearch'>
				<form action='admin.php?mod=home' method='POST'>
					<div class='grid12 noSearch'>
						<select class='select' name='Lang' onChange='submit()'>
							<option value='indonesia' $selectlangid>Indonesia</option>
							<option value='english' $selectlangen>English</option>
						</select>
					</div>
				</form>
            </div>
            <!-- User nav -->
            <ul class='userNav'>
                <li><a href='admin.php?mod=user' title='$langmenu27' class='profile'></a></li>
                <li><a href='admin.php?mod=contact' title='$langmenu26' class='messages'></a></li>
                <li><a href='admin.php?mod=setting' title='$langmenu14' class='settings'></a></li>
                <li><a href='logout.php' title='$langmenu22' class='logout'></a></li>
            </ul>
        </div>
        <!-- Main nav -->
        <ul class='nav'>
            <li><a href='admin.php?mod=home' title='$langmenu1' class='$activehome'><div class='fs1 iconb' data-icon='&#xe001;' style='font-size:25px;'></div><span>$langmenu1</span></a></li>
            <li><a href='admin.php?mod=post' title='$langmenu2' class='$activepost'><div class='fs1 iconb' data-icon='&#xe002;' style='font-size:25px;'></div><span>$langmenu2</span></a>
                <ul>
					<li><a href='admin.php?mod=post'><span class='icol-pencil'></span>$langmenu3</a></li>
					<li><a href='admin.php?mod=post&act=addnew'><span class='icol-add'></span>$langmenu4</a></li>
					<li><a href='admin.php?mod=category'><span class='icol-list'></span>$langmenu5</a></li>
					<li><a href='admin.php?mod=tag'><span class='icol-tags'></span>$langmenu6</a></li>
                </ul>
            </li>
            <li><a href='admin.php?mod=library' title='$langmenu7' class='$activelibrary'><div class='fs1 iconb' data-icon='&#xe227;' style='font-size:25px;'></div><span>$langmenu7</span></a>
                <ul>
					<li><a href='admin.php?mod=library'><span class='icol-images'></span>$langmenu8</a></li>
					<li><a href='admin.php?mod=library&act=addnew'><span class='icol-add'></span>$langmenu9</a></li>
					<li><a href='admin.php?mod=library&act=addnewmultiple'><span class='icol-add'></span>$langmenu9 Multiple</a></li>
                </ul>
            </li>
            <li><a href='admin.php?mod=pages' title='$langmenu10' class='$activepages'><div class='fs1 iconb' data-icon='&#xe015;' style='font-size:25px;'></div><span>$langmenu10</span></a>
                <ul>
					<li><a href='admin.php?mod=pages'><span class='icol-documents'></span>$langmenu11</a></li>
					<li><a href='admin.php?mod=pages&act=addnew'><span class='icol-add'></span>$langmenu12</a></li>
                </ul>
			</li>
            <li><a href='admin.php?mod=setting' title='$langmenu13' class='$activesetting'><div class='fs1 iconb' data-icon='&#xe263;' style='font-size:25px;'></div><span>$langmenu13</span></a>
                <ul>
					<li><a href='admin.php?mod=setting'><span class='icol-cog3'></span>$langmenu14</a></li>
					<li><a href='admin.php?mod=theme'><span class='icol-photos'></span>$langmenu15</a></li>
					<li><a href='admin.php?mod=menumanager'><span class='icol-view'></span>$langmenu28</a></li>
                </ul>
			</li>
            <li><a href='admin.php?mod=component' title='$langmenu16' class='$activecomponent'><div class='fs1 iconb' data-icon='&#xe065;' style='font-size:25px;'></div><span>$langmenu16</span></a>
                <ul>
					<li><a href='admin.php?mod=component'><span class='icol-dropbox'></span>$langmenu17</a></li>
					<li><a href='admin.php?mod=component&act=addnew'><span class='icol-add'></span>$langmenu18</a></li>
                </ul>
            </li>
            <li><a href='admin.php?mod=user' title='$langmenu19' class='$activeuser'><div class='fs1 iconb' data-icon='&#xe1e1;' style='font-size:25px;'></div><span>$langmenu19</span></a>
                <ul>
					<li><a href='admin.php?mod=user'><span class='icol-users'></span>$langmenu20</a></li>
					<li><a href='admin.php?mod=user&act=addnew'><span class='icol-add'></span>$langmenu21</a></li>
                </ul>
            </li>
        </ul>";
}
?>