<?php

session_start();

// Check if the user is logged in, if not then redirect him to login page
require_once "../Config/session_check.php";

$_SESSION["last_Active"] = time();


?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include "../Templates/Header.php"; ?>
    <title>Dashboard</title>
</head>
<body>

<div id="page-container">

    <div id="content-wrap">
        <?php include "../Templates/navBar.php"; ?>
        <div class="container-fluid">
            <div class="row">
                <?php include "../Templates/SideBar.php"; ?>

                <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
                    <h1>Dashboard</h1>
                    <div class="row">
                        <div class="col-6">
                            <div class="container rounded border"
                                 style="height: 150px; background-color: #e8e8e8; cursor: pointer;"
                                 onclick="window.location='../customer'">
                                <h1>Customer's Information</h1>
                                <p>Click to view all customer information</p>

                            </div>

                        </div>
                        <div class="col-6">
                            <div class="container rounded border"
                                 style="height: 150px; background-color: #e8e8e8;  cursor: pointer;"
                                 onclick="window.location='../orders'">
                                <h1>Orders information</h1>
                                <p>Click to view all on going and closed orders</p>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="container rounded " style="height: 10px"></div>
                    </div>
                    <div class="row">
                        <div class="col-6">
                            <div class="container rounded border"
                                 style="height: 150px; background-color: #e8e8e8;  cursor: pointer;"
                                 onclick="window.location='../suppliers'">
                                <h1>suppliers information</h1>
                                <p>click to view all current and previous suppliers</p>
                            </div>

                        </div>

                        <div class="col-6">
                            <div class="container rounded border"
                                 style="height: 150px; background-color: #e8e8e8;  cursor: pointer;"
                                 onclick="window.location='../invoices'">
                                <h1>Invoice Information</h1>
                                <p>Click to view all Invoices on record</p>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="container rounded" style="height: 10px"></div>
                    </div>
                    <?php
                    $linktostaff = "window.location='../staff'";
                    if ($_SESSION["security_Level"] < 2) {
                        echo '<div class="row">
                        <div class="offset-3 col-6 rounded">
                            <div  class="container rounded border" style="height: 150px; background-color: #e8e8e8;  cursor: pointer;" onclick="' . $linktostaff . '" >
                                <h1>Staff Information</h1>
                                <p>Click to view all current staff that are employed or were employed</p>
                                <p>Note: This is also where user accounts are handled.</p>
                            </div>
                        </div>
                    </div>';
                    }
                    ?>


                </main>
            </div>
        </div>


    </div>
    <?php include "../Templates/Footer.php"; ?>

</div>

</body>
</html>
