<?php
session_start();
error_reporting(0);
include "timeout.php";

if($_SESSION[login]==1){
	if(!cek_login()){
		$_SESSION[login] = 0;
	}
}
if($_SESSION[login]==0){
	header('location:logout.php');
}else{
if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser']) AND $_SESSION['login']==0){
	header('location:404.php');
}else{
	if(isset($_POST['Lang'])) {
		$localLang = $_POST['Lang'];
		setcookie('Popoji_CMS_Lang',$_POST['Lang'],1719241200,'/');
		$_COOKIE['Popoji_CMS_Lang'] = $_POST['Lang'];
		echo "<script type=\"text/javascript\">parent.location='admin.php?mod=home';</script>";
	}elseif(isset($_COOKIE['Popoji_CMS_Lang'])){
		$localLang = $_COOKIE['Popoji_CMS_Lang'];
	}else{
		$localLang = 'indonesia';
	}
	include "lang/$localLang/lang.php";
	$activeeditor = $_COOKIE['Popoji_CMS_Editor'];
	$urlhost = rtrim("http://".$_SERVER['HTTP_HOST'], "/").$_SERVER['PHP_SELF'];
	$urlhost2 = preg_replace("/\/po-admin\/(admin\.php$)/","",$urlhost);
	$siteurl = $urlhost2;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta name="robots" content="index, follow">
    <meta name="description" content="Administrator PopojiCMS">
    <meta name="keywords" content="administrator popojicms, popojicms">
    <meta http-equiv="Copyright" content="popojicms">
    <meta name="author" content="Dwira Survivor">
    <meta http-equiv="imagetoolbar" content="no">
    <meta name="language" content="Indonesia">
    <meta name="revisit-after" content="7">
    <meta name="webcrawlers" content="all">
    <meta name="rating" content="general">
    <meta name="spiders" content="all">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <!--[if gt IE 8]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <![endif]-->
    <title>Administrator PopojiCMS</title>
    <link rel="icon" type="image/png" href="favicon.png"/>
    
	<link href="css/styles.css" rel="stylesheet" type="text/css" />
	<!--[if IE]> <link href="css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->

	<script type="text/javascript" src="js/files/jquery.min.js"></script>

	<script type="text/javascript" src="js/plugins/forms/ui.spinner.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.mousewheel.js"></script>
	 
	<script type="text/javascript" src="js/files/jquery-ui.min.js"></script>

	<script type="text/javascript" src="js/plugins/charts/excanvas.min.js"></script>
	<script type="text/javascript" src="js/plugins/charts/jquery.flot.js"></script>
	<script type="text/javascript" src="js/plugins/charts/jquery.flot.orderBars.js"></script>
	<script type="text/javascript" src="js/plugins/charts/jquery.flot.pie.js"></script>
	<script type="text/javascript" src="js/plugins/charts/jquery.flot.resize.js"></script>
	<script type="text/javascript" src="js/plugins/charts/jquery.sparkline.min.js"></script>

	<?php if ($activeeditor=="redactor"){ ?>
		<link href="js/plugins/redactor/redactor.css" rel="stylesheet">
		<script src="js/plugins/redactor/redactor.min.js"></script>
		<script type="text/javascript" src="js/plugins/ckeditor/ckeditor.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_mce.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_popojicms.js"></script>
	<?php }elseif ($activeeditor=="tinymce"){ ?>
		<script type="text/javascript" src="js/plugins/ckeditor/ckeditor.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_mce.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_popojicms.js"></script>
	<?php }elseif ($activeeditor=="newtinymce"){ ?>
		<script type="text/javascript" src="js/plugins/newtinymce/tinymce.min.js"></script>
	<?php }else{ ?>
		<link href="js/plugins/redactor/redactor.css" rel="stylesheet">
		<script src="js/plugins/redactor/redactor.min.js"></script>
		<script type="text/javascript" src="js/plugins/ckeditor/ckeditor.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_mce.js"></script>
		<script type='text/javascript' src="js/plugins/tinymce/tiny_popojicms.js"></script>
	<?php } ?>

	<script type="text/javascript" src="js/plugins/tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="js/plugins/tables/jquery.sortable.js"></script>
	<script type="text/javascript" src="js/plugins/tables/jquery.resizable.js"></script>

	<script type="text/javascript" src="js/plugins/forms/autogrowtextarea.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.uniform.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.inputlimiter.min.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.tagsinput.min.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.maskedinput.min.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.autotab.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.chosen.min.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.dualListBox.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.ibutton.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.validationEngine-en.js"></script>
	<script type="text/javascript" src="js/plugins/forms/jquery.validationEngine.js"></script>

	<script type="text/javascript" src="js/plugins/uploader/plupload.js"></script>
	<script type="text/javascript" src="js/plugins/uploader/plupload.html4.js"></script>
	<script type="text/javascript" src="js/plugins/uploader/plupload.html5.js"></script>
	<script type="text/javascript" src="js/plugins/uploader/jquery.plupload.queue.js"></script>

	<script type="text/javascript" src="js/plugins/wizards/jquery.form.wizard.js"></script>
	<script type="text/javascript" src="js/plugins/wizards/jquery.validate.js"></script>
	<script type="text/javascript" src="js/plugins/wizards/jquery.form.js"></script>

	<script type="text/javascript" src="js/plugins/ui/jquery.collapsible.min.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.breadcrumbs.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.tipsy.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.progress.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.timeentry.min.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.colorpicker.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.jgrowl.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.fancybox.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.fileTree.js"></script>
	<script type="text/javascript" src="js/plugins/ui/jquery.sourcerer.js"></script>

	<script type="text/javascript" src="js/plugins/others/jquery.fullcalendar.js"></script>
	<script type="text/javascript" src="js/plugins/others/jquery.elfinder.js"></script>
	<script type="text/javascript" src="js/plugins/others/jquery.pajinate.js"></script>

	<script type="text/javascript" src="js/plugins/ui/jquery.easytabs.min.js"></script>
	<script type="text/javascript" src="js/files/bootstrap.js"></script>
	<script type="text/javascript" src="js/files/functions.js"></script>
</head>
<body>
	<!-- Top line begins -->
	<div id="top">
		<?php include "topmenu.php"; ?>
	</div>
	<!-- Top line ends -->
	<!-- Sidebar begins -->
	<div id="sidebar">
		<!-- Main nav -->
		<div class="mainNav">
			<?php include "menu.php"; ?>
		</div>
		<!-- Secondary nav -->
		<div class="secNav">
			<?php include "secondmenu.php"; ?>
		</div>
	</div>
	<!-- Sidebar ends -->
	<!-- Content begins -->
	<div id="content">
		<?php include "content.php"; ?>
	</div>
	<!-- Content ends -->  
</body>
</html>
<?php
}
}
?>