<?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{
	$availableLang = array("indonesia", "english");
	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.php";
include "lang/$localLang/lang.php";
?>
<!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/stylesheets.css" rel="stylesheet" type="text/css" />
    <!--[if lte IE 7]>
        <link href="css/ie.css" rel="stylesheet" type="text/css" />
        <script type='text/javascript' src='js/plugins/other/lte-ie7.js'></script>
    <![endif]-->
    <script type='text/javascript' src='js/plugins/jquery/jquery-1.9.1.min.js'></script>
    <script type='text/javascript' src='js/plugins/jquery/jquery-ui-1.10.1.custom.min.js'></script>
    <script type='text/javascript' src='js/plugins/jquery/jquery-migrate-1.1.1.min.js'></script>
    <script type='text/javascript' src='js/plugins/jquery/globalize.js'></script>
    <script type='text/javascript' src='js/plugins/other/excanvas.js'></script>

    <script type='text/javascript' src='js/plugins/other/jquery.mousewheel.min.js'></script>

    <script type='text/javascript' src='js/plugins/bootstrap/bootstrap.min.js'></script>
	<script type='text/javascript' src='js/plugins/bootstrap/bootstrap-fileupload.min.js'></script>

    <script type='text/javascript' src='js/plugins/cookies/jquery.cookies.2.2.0.min.js'></script>

    <script type='text/javascript' src='js/plugins/jflot/jquery.flot.js'></script>
    <script type='text/javascript' src='js/plugins/jflot/jquery.flot.stack.js'></script>    
    <script type='text/javascript' src='js/plugins/jflot/jquery.flot.pie.js'></script>
    <script type='text/javascript' src='js/plugins/jflot/jquery.flot.resize.js'></script>

	<script type='text/javascript' src='js/plugins/epiechart/jquery.easy-pie-chart.js'></script>
    <script type='text/javascript' src='js/plugins/sparklines/jquery.sparkline.min.js'></script>

    <script type='text/javascript' src='js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js'></script>

    <script type='text/javascript' src="js/plugins/uniform/jquery.uniform.min.js"></script>
    <script type='text/javascript' src="js/plugins/select/select2.min.js"></script>
    <script type='text/javascript' src='js/plugins/tagsinput/jquery.tagsinput.min.js'></script>
    <script type='text/javascript' src='js/plugins/maskedinput/jquery.maskedinput-1.3.min.js'></script>
    <script type='text/javascript' src='js/plugins/multiselect/jquery.multi-select.min.js'></script>

	<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/datatables/jquery.dataTables.min.js'></script>
	<script type='text/javascript' src='js/plugins/datatables/dt_bootstrap.js'></script>

	<script type="text/javascript" src="js/plugins/pajinate/jquery.pajinate.js"></script>
	<script type="text/javascript" src="js/plugins/easyconfirm/jquery.easy-confirm-dialog.js"></script>

    <script type='text/javascript' src='js/plugins/shbrush/XRegExp.js'></script>
    <script type='text/javascript' src='js/plugins/shbrush/shCore.js'></script>
    <script type='text/javascript' src='js/plugins/shbrush/shBrushXml.js'></script>
    <script type='text/javascript' src='js/plugins/shbrush/shBrushJScript.js'></script>
    <script type='text/javascript' src='js/plugins/shbrush/shBrushCss.js'></script>
	
	<script type='text/javascript' src='js/plugins/fancybox/jquery.fancybox.pack.js'></script>

    <script type='text/javascript' src='js/plugins.js'></script>
    <script type='text/javascript' src='js/charts.js'></script>
    <script type='text/javascript' src='js/actions.js'></script>

</head>
<body>
    <div id="loader"><img src="img/loader.gif"/></div>
    <div class="wrapper">
        <div class="sidebar">
            <div class="top">
                <div class="search">
					<form action="admin.php?mod=home" method="POST">
						<label style='color:white;'><i class="icon-flag icon-white"></i> <?php echo $langhome16; ?></label>
						<select class="select" name="Lang" onChange="submit()" style='width:100%;'><?php echo getAvailableLang(); ?></select>
					</form>
                </div>
            </div>
            <div class="nContainer">
				<?php include "menu.php"; ?>
            </div>
            <div class="widget">
                <div class="datepicker"></div>
				<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
            </div>
        </div>
        <div class="body">
			<?php include "topmenu.php"; ?>
			<div class="content">
				<?php include "content.php"; ?>
			</div>
        </div>
    </div>
</body>
</html>
<?php
}
}
?>