<?php
if(!defined('APPLICATION_VERSION')){
    die("Permission denied!");
}
?>
<!doctype html>
<html ng-app='dashApp'>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title><?php echo APPLICATION_NAME;?></title>
        <link rel="shortcut icon" type="image/png" href="client/img/wiaas_icon.png"/>
        <?php
            if($module !== 'login'){
                require_once('templates/cssIncludes.php');
                require_once('templates/jsIncludes.php');
            }else{
                require_once('templates/loginCssIncludes.php');
                require_once('templates/loginJsIncludes.php');
            }
        ?>
    </head>

    <body>
        <div id="wrapper" class="wrapper">
            <?php
                if(!$user->isLoggedIn() && $module !== 'login'){
                    header('Location:login');
                    die();
                }

                if($module !== 'login'){
                    require_once('menuTemplate.php');
                }

                $route::call($module, $controller, $action);

                if($module !== 'login'){
                    echo '<activity-checker ng-init="checkLastActivity()" ng-controller="activityCheckerCtrl"></activity-checker>';
                    require_once('templates/FooterTemplate.php');
                }
            ?>

        </div>
    </body>
</html>
