diff --git a/Project/php/config/config.php b/Project/php/config/config.php index ae9c833..0fbb5bc 100755 --- a/Project/php/config/config.php +++ b/Project/php/config/config.php @@ -18,4 +18,4 @@ global $password; $password = 'achanger'; global $altorouterPath; -$altorouterPath = "/~lugoigoux1/SAE_2A_Anglais/Project/php"; +$altorouterPath = "/SAE_2A_Anglais/Project/php"; diff --git a/Project/php/controller/FrontController.php b/Project/php/controller/FrontController.php index 1d3873d..2d69b2e 100755 --- a/Project/php/controller/FrontController.php +++ b/Project/php/controller/FrontController.php @@ -88,6 +88,12 @@ class FrontController public static function home(): void { global $twig; - echo $twig->render('home.html'); + global $user; + if(isset($user)){ + echo $twig->render('home.html', ['userID' => $user->getId(), 'userRole' => $user->getRoles()]); + } + else{ + echo $twig->render('home.html', ); + } } } \ No newline at end of file diff --git a/Project/php/controller/UserController.php b/Project/php/controller/UserController.php index 4cc6da4..ac839de 100755 --- a/Project/php/controller/UserController.php +++ b/Project/php/controller/UserController.php @@ -43,7 +43,7 @@ class UserController extends VisitorController try { global $user; $newNickname = Validation::filter_str_nospecialchar($_POST['newNickname'] ?? null); - $mdl = new MdlStudent(); + $mdl = new MdlUser(); $mdl->modifyNickname($user->getId(), $newNickname); $this->showAccountInfos(); } diff --git a/Project/php/controller/VisitorController.php b/Project/php/controller/VisitorController.php index 3db78b2..5d6d07b 100755 --- a/Project/php/controller/VisitorController.php +++ b/Project/php/controller/VisitorController.php @@ -87,6 +87,7 @@ class VisitorController } public function confirmLogin(): void { + global $user; $model = new MdlUser(); if($_POST['logemail']!=null && $_POST['logpass']!=null) { $login = strip_tags($_POST['logemail']); diff --git a/Project/php/css/memory.css b/Project/php/css/memory.css index 00968b9..a68874f 100755 --- a/Project/php/css/memory.css +++ b/Project/php/css/memory.css @@ -2,10 +2,9 @@ body { display: flex; justify-content: center; align-items: center; - height: 100vh; + height: 90vh; background-color: #f0f0f0; - margin-left: 15vh; - margin-right: 15vh; + margin: 2vh 15vh; overflow: hidden; } @@ -31,8 +30,8 @@ body { cursor: pointer; transition: transform 0.6s ease; transform-style: preserve-3d; - min-height: 10vh; - min-width: 20vh; + min-height: 5vh; + max-width: 100%; aspect-ratio: 1/1; } diff --git a/Project/php/css/styles.css b/Project/php/css/styles.css index af587db..dc9fd35 100755 --- a/Project/php/css/styles.css +++ b/Project/php/css/styles.css @@ -616,7 +616,7 @@ progress { .logo { margin-top: 10%; - height: 10vh; + max-height: 8vh; } .figure-caption { @@ -11070,7 +11070,7 @@ body { padding: 0.9rem 0; } #secondNav .navbar-nav .nav-item:hover { - color: fade(#fff, 80%); + color: #7464a1; outline: none; background-color: transparent; } @@ -11101,13 +11101,13 @@ body { color: #fff; } #secondNav.navbar-shrink { - background-color: #fff; + background-color: #7464a1; } #secondNav.navbar-shrink .navbar-brand { color: #000; } #secondNav.navbar-shrink .nav-link { - color: #000; + color: #fff; padding: 1.5rem 1.5rem 1.25rem; border-bottom: 0.25rem solid transparent; } @@ -11338,4 +11338,8 @@ body { .app-badge { height: 3rem; +} + +.content{ + padding : 12vh; } \ No newline at end of file diff --git a/Project/php/js/scripts.js b/Project/php/js/scripts.js index 80e45f3..d9af6e5 100755 --- a/Project/php/js/scripts.js +++ b/Project/php/js/scripts.js @@ -11,7 +11,7 @@ window.addEventListener('DOMContentLoaded', event => { // Navbar shrink function var navbarShrink = function () { - const navbarCollapsible = document.body.querySelector('#mainNav'); + const navbarCollapsible = document.body.querySelector('#secondNav'); if (!navbarCollapsible) { return; } @@ -30,10 +30,10 @@ window.addEventListener('DOMContentLoaded', event => { document.addEventListener('scroll', navbarShrink); // Activate Bootstrap scrollspy on the main nav element - const mainNav = document.body.querySelector('#mainNav'); + const mainNav = document.body.querySelector('#secondNav'); if (mainNav) { new bootstrap.ScrollSpy(document.body, { - target: '#mainNav', + target: '#secondNav', rootMargin: '0px 0px -40%', }); }; diff --git a/Project/php/navBar.html b/Project/php/navBar.html deleted file mode 100755 index de32be1..0000000 --- a/Project/php/navBar.html +++ /dev/null @@ -1,43 +0,0 @@ - - -
- - - - -