<?php 
/* APLIKASI PENJUALAN DPOS PRO
 *
 * Framework DPOS BISNIS berbasis PHP
 *
 * Developed by djavasoft.com
 * Copyright (c) 2018, Djavasoft Smart Technology
 *
 * @author	Mohamad Anton Arizal
 * @copyright	Copyright (c) 2018 Djavasoft. (https://djavasoft.com/)
 *
 *
*/



ob_start();
session_start();
$username=$_SESSION['user'];
$userlevel=userLevel($username);
notif();
if(isset($_GET['mode'])){

$mode=$_GET['mode'].'.php';
if(file_exists(__DIR__.'/main/'.$mode))
{
	if(file_exists(__DIR__.'/modul/'.$_GET['mode'].'.js.php'))
	{
		include (__DIR__.'/modul/'.$_GET['mode'].'.js.php');
	}
	if(file_exists(__DIR__.'/modul/'.$_GET['mode'].'.modal.php'))
	{
		include (__DIR__.'/modul/'.$_GET['mode'].'.modal.php');
	}
	
	include(__DIR__.'/main/'.$mode);

}
else
{

	echo '<div class="col-md-12"><div class="alert alert-danger"><i class="fa fa-warning"></i> File not found ('.__DIR__.'app/main/'.$mode.')</div></div>';
	//echo '<br>'.__DIR__;
	//echo '<br>'.$_SERVER['DOCUMENT_ROOT'];
}
//echo $mode;
}
else
{
	include 'main/dashboard.php';

}
?>
