<?php 
session_start();
include "config/conn.php";
$user_id=$_SESSION['id_user'];
$user_name=$_SESSION['username'];
if(isset($_SESSION['kode_bbws'])){
	$kode_bbws=$_SESSION['kode_bbws'];
	$kode_name=$_SESSION['kode_bbws'];
}else{
	$kode_bbws=null;
	$kode_name=null;
}
$level=$_SESSION['id_level'];	
if ($user_name!="" && $user_id!=""){
	$level=$_SESSION['id_level'];
	$pg = $_GET['page'];

	


	include "includes/head.php";
	include "includes/header.php";
	if($pg==""){ 
       	include ("modules/dashboard.php");
    }else{ 
    	include ("modules/".$pg.".php"); 
	}
	include "includes/footer.php";
	if($pg==""){ 
       	include ("modules/js/dashboard_js.php");
    }else{ 
    	include ("modules/js/".$pg."_js.php"); 
	}
	include "includes/foot.php";
?>

<?php
}else{
?> 
<script>

window.location= "<?php echo BASEURL; ?>index.php?from=auto-logout";

</script>

<?php

}

?>