<?php
session_start();
if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser'])){
	header('location:404.php');
}else{
	$modact = $_GET['mod'];
	if ($modact == 'home'){
		echo "<li><a href='admin.php?mod=post'><span class='icos-pencil'></span>$langmenu2</a></li>
		<li><a href='admin.php?mod=pages'><span class='icos-documents'></span>$langmenu10</a></li>
		<li><a href='admin.php?mod=setting'><span class='icos-cog3'></span>$langmenu14</a></li>
		<li><a href='admin.php?mod=theme'><span class='icos-photos'></span>$langmenu15</a></li>
		<li><a href='admin.php?mod=user'><span class='icos-users'></span>$langmenu19</a></li>
		<div class='divider'><span></span></div>
		<div class='sidePad'>
			<a href='po-component/po-home/proses.php?mod=home&act=backup' title='' class='sideB bLightBlue'>One Click Backup DB</a>
		</div>
		<div class='divider'><span></span></div>
		<div class='sidePad'>
			<form method='post' action='po-component/po-home/proses.php' enctype='multipart/form-data' autocomplete='off'>
				<input type='hidden' name='mod' value='home'>
				<input type='hidden' name='act' value='restore'>
				<input type='file' name='fupload' class='fileInput' id='fileInputS' /><br /><br />
				<input type='submit' class='sideB bLightBlue' value='One Click Restore DB' />
			</form>
		</div>";
	}elseif ($modact == 'post'){
		$actionact = $_GET['act'];
		$thispost = ($actionact == '' OR $actionact == 'edit') ? 'this' : '';
		$thispostaddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=post' class='$thispost'><span class='icos-pencil'></span>$langmenu3</a></li>
		<li><a href='admin.php?mod=post&act=addnew' class='$thispostaddnew'><span class='icos-add'></span>$langmenu4</a></li>
		<li><a href='admin.php?mod=category'><span class='icos-list'></span>$langmenu5</a></li>
		<li><a href='admin.php?mod=tag'><span class='icos-tags'></span>$langmenu6</a></li>";
	}elseif ($modact == 'category'){
		$actionact = $_GET['act'];
		$thiscategory = ($actionact == '' OR $actionact == 'edit') ? 'this' : '';
		$thiscategoryaddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=post'><span class='icos-pencil'></span>$langmenu3</a></li>
		<li><a href='admin.php?mod=category' class='$thiscategory'><span class='icos-list'></span>$langmenu5</a></li>
		<li><a href='admin.php?mod=category&act=addnew' class='$thiscategoryaddnew'><span class='icos-add'></span>$langmenu4</a></li>
		<li><a href='admin.php?mod=tag'><span class='icos-tags'></span>$langmenu6</a></li>";
	}elseif ($modact == 'tag'){
		$actionact = $_GET['act'];
		$thistag = ($actionact == '' OR $actionact == 'edit') ? 'this' : '';
		$thistagaddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=post'><span class='icos-pencil'></span>$langmenu3</a></li>
		<li><a href='admin.php?mod=category'><span class='icos-list'></span>$langmenu5</a></li>
		<li><a href='admin.php?mod=tag' class='$thistag'><span class='icos-tags'></span>$langmenu6</a></li>
		<li><a href='admin.php?mod=tag&act=addnew' class='$thistagaddnew'><span class='icos-add'></span>$langmenu4</a></li>";
	}elseif ($modact == 'library'){
		$actionact = $_GET['act'];
		$thislibrary = ($actionact == '') ? 'this' : '';
		$thislibraryaddnew = ($actionact == 'addnew') ? 'this' : '';
		$thislibraryaddnewmulti = ($actionact == 'addnewmultiple') ? 'this' : '';
		echo "<li><a href='admin.php?mod=library' class='$thislibrary'><span class='icos-images'></span>$langmenu8</a></li>
		<li><a href='admin.php?mod=library&act=addnew' class='$thislibraryaddnew'><span class='icos-add'></span>$langmenu9</a></li>
		<li><a href='admin.php?mod=library&act=addnewmultiple' class='$thislibraryaddnewmulti'><span class='icos-add'></span>$langmenu9 Multiple</a></li>";
	}elseif ($modact == 'pages'){
		$actionact = $_GET['act'];
		$thispages = ($actionact == '' OR $actionact == 'edit') ? 'this' : '';
		$thispagesaddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=pages' class='$thispages'><span class='icos-documents'></span>$langmenu11</a></li>
		<li><a href='admin.php?mod=pages&act=addnew' class='$thispagesaddnew'><span class='icos-add'></span>$langmenu12</a></li>";
	}elseif ($modact == 'setting'){
		$actionact = $_GET['act'];
		$thissetting = ($actionact == '') ? 'this' : '';
		echo "<li><a href='admin.php?mod=setting' class='$thissetting'><span class='icos-cog3'></span>$langmenu14</a></li>
		<li><a href='admin.php?mod=theme'><span class='icos-photos'></span>$langmenu15</a></li>
		<li><a href='admin.php?mod=menumanager'><span class='icos-view'></span>$langmenu28</a></li>";
	}elseif ($modact == 'theme'){
		$actionact = $_GET['act'];
		$thistheme = ($actionact == '') ? 'this' : '';
		$thisthemeaddnew = ($actionact == 'addnew') ? 'this' : '';
		$thisthemeedit = ($actionact == 'edit') ? 'this' : '';
		echo "<li><a href='admin.php?mod=setting'><span class='icos-cog3'></span>$langmenu14</a></li>
		<li><a href='admin.php?mod=theme' class='$thistheme'><span class='icos-photos'></span>$langmenu15</a></li>
		<li><a href='admin.php?mod=theme&act=addnew' class='$thisthemeaddnew'><span class='icos-add'></span>$langmenu12</a></li>
		<li><a href='admin.php?mod=theme&act=edit&id=header.php' class='$thisthemeedit'><span class='icos-pencil'></span>$langtheme8</a></li>
		<li><a href='admin.php?mod=menumanager'><span class='icos-view'></span>$langmenu28</a></li>";
	}elseif ($modact == 'menumanager'){
		$actionact = $_GET['act'];
		$thismenu = ($actionact == '' OR $actionact == 'menu') ? 'this' : '';
		echo "<li><a href='admin.php?mod=setting'><span class='icos-cog3'></span>$langmenu14</a></li>
		<li><a href='admin.php?mod=theme'><span class='icos-photos'></span>$langmenu15</a></li>
		<li><a href='admin.php?mod=menumanager' class='$thismenu'><span class='icos-view'></span>$langmenu28</a></li>";
	}elseif ($modact == 'component'){
		$actionact = $_GET['act'];
		$thiscomponent = ($actionact == '' OR $actionact == 'importtable') ? 'this' : '';
		$thiscomponentaddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=component' class='$thiscomponent'><span class='icos-dropbox'></span>$langmenu17</a></li>
		<li><a href='admin.php?mod=component&act=addnew' class='$thiscomponentaddnew'><span class='icos-add'></span>$langmenu18</a></li>
		<p>&nbsp;</p>";
		include_once '../po-library/po-database.php';
		$tablecomponentm = new PoTable('component');
		$componentmenus = $tablecomponentm->findAll(id_component, DESC);
		foreach($componentmenus as $componentmenu){
			$pecahurl = explode("-", $componentmenu->component);
			$url = $pecahurl[1];
			echo "<li><a href='admin.php?mod=$url'><span class='icos-dropbox'></span>$componentmenu->component</a></li>";
		}
	}elseif ($modact == 'user'){
		$actionact = $_GET['act'];
		$thisuser = ($actionact == '' OR $actionact == 'edit') ? 'this' : '';
		$thisuseraddnew = ($actionact == 'addnew') ? 'this' : '';
		echo "<li><a href='admin.php?mod=user' class='$thisuser'><span class='icos-users'></span>$langmenu20</a></li>
		<li><a href='admin.php?mod=user&act=addnew' class='$thisuseraddnew'><span class='icos-add'></span>$langmenu21</a></li>";
	}else{
		echo "<li><a href='admin.php?mod=post'><span class='icos-pencil'></span>$langmenu2</a></li>
		<li><a href='admin.php?mod=pages'><span class='icos-documents'></span>$langmenu10</a></li>
		<li><a href='admin.php?mod=setting'><span class='icos-cog3'></span>$langmenu14</a></li>
		<li><a href='admin.php?mod=theme'><span class='icos-photos'></span>$langmenu15</a></li>
		<li><a href='admin.php?mod=user'><span class='icos-users'></span>$langmenu19</a></li>
		<p>&nbsp;</p>";
		include_once '../po-library/po-database.php';
		$tablecomponentm = new PoTable('component');
		$componentmenus = $tablecomponentm->findAll(id_component, DESC);
		foreach($componentmenus as $componentmenu){
			$pecahurl = explode("-", $componentmenu->component);
			$url = $pecahurl[1];
			echo "<li><a href='admin.php?mod=$url'><span class='icos-dropbox'></span>$componentmenu->component</a></li>";
		}
	}
}
?>