<?php

CLASS Application extends RasioProject
{
	public function __construct($config)
	{
		$this->getConfig($config);
		$this->validation();
		$this->layout = '2019/index';
	}
	
	public function set()
	{
		
	}
	
	public function Index()
	{
		$this->view = 'dashboard';
	}
	
	public function Loadmenu()
	{
		if(!empty($_GET['menu'])){
			$menu 	= new Menu;

			$dataMenu = $menu->listDetMenu($_GET['app']);
			$draftMenu= $menu->detailMenuApp($dataMenu);
			$acl 	= $menu->cekAcl($this->em, $_GET['menu']);
	
			echo "<ul class='_cariMenuLeft'>";
			foreach($draftMenu as $row){
				$id = strtolower($row['url']);
				if(!empty($acl[$id]->ket)){
					echo "<li><a class='_linkMenuList' href='".$this->baseUrl.$row['url'].'/index/'.$_GET['app']."'>".ucfirst(str_ireplace('-', ' ', $row['menu'])).'</a></li>';
				}
			}
			if(count($acl) <= 0){
				echo "<li>Not Found</li>";
			}
			echo "</ul>";
			echo '<script>$("#apankMenu2016Display").addClass("_menuDisplay")</script>';
		}else{
			echo '<script>$("#apankMenu2016Display").removeAttr("class").html("")</script>';
		}
		$this->layout = 'null';
	}
}