<?php
    include "../../utils/Database.php";
    include "../../utils/functions.php";
    include "../../models/User.php";
    include "../../services/UserService.php";
?>

<?php

    $database = new Database();
    $db = $database->connect();

    $user_service = new UserService($db);

    switch($action) {
        case 'dashboard':

            $object = $user_service->getByUsernameAndPassword($_SESSION['username'], $_SESSION['password']);
            
            $user = new User(
                $object['id'],
                $object['name'],
                $object['username'],
                $object['password'],
                $object['email'],
                $object['access_level']
            );
            break;
        default:
            continue;
    }
?>