<?php echo $this->doctype; ?>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title><?php echo $this->title; ?></title>
        <?php
            $this->metas();
            $this->styles();
            $this->scripts();
        ?>
    </head>
    <body>
    <div class="header">
        <div class="row">
            <div class="small-7 column">
                <h1><i class="fa fa-clock-o"></i> TimeTracker</h1>
            </div>
            <div class="small-4 column text-right">
                <h4>
                    <?php
                    $auth = Staple_Auth::get();
                    $user = new userModel($auth->getAuthId());
                    echo ucfirst($user->getFirstName())." ".ucfirst($user->getLastName());
                    ?>
                </h4>
            </div>
        </div>
        <div class="contain-to-grid hide-for-print">
        <nav class="top-bar" data-topbar role="navigation">
            <ul class="title-area">
                <li class="name">

                </li>
                <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
                <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
            </ul>

            <section class="top-bar-section">
                <!-- Right Nav Section -->
                <ul class="left">
                    <li><a href="<?php echo $this->link(array('index')) ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
                    <li><a href="<?php echo $this->link(array('timesheet')) ?>"><i class="fa fa-clock-o"></i> Timesheet</a></li>
                    <?php

                    //Supervisor Accounts
                    if($user->getAuthLevel() >= 500)
                    {
                        echo "
                            <li><a href=\"".$this->link(array('reports')) ."\"><i class=\"fa fa-file\"></i> Timesheet Reports</a></li>
                        ";
                    }

                    //Administrative Accounts
                    if($user->getAuthLevel() >= 900)
                    {
                        echo "
                            <li><a href=\"".$this->link(array('accounts')) ."\"><i class=\"fa fa-users\"></i> Accounts</a></li>
                            <li><a href=\"".$this->link(array('audit')) ."\" ><i class=\"fa fa-list-alt\" ></i > Audit Log</a ></li >
                        ";
                    }

                    ?>
                </ul>

                <!-- Right Nav Section -->
                <ul class="right">
                    <li><a href="<?php echo $this->link(array('account','logout')) ?>"><i class="fa fa-close"></i> Logout</a></li>
                </ul>
            </section>
        </nav>
    </div>
    </div>
        <?php $this->content(); ?>
        <script>
            $(document).foundation();
            $(document).ready(function() {
                var delay = 300000;
                setTimeout(function(){window.location = "<?php echo $this->link(array('account','logout')) ?>"; }, delay);
            });
        </script>
    </body>
</html>
