diff --git a/Project/php/controller/VisitorController.php b/Project/php/controller/VisitorController.php index 9c78ebe..4df381a 100755 --- a/Project/php/controller/VisitorController.php +++ b/Project/php/controller/VisitorController.php @@ -14,7 +14,7 @@ class VisitorController global $twig; try{ - $idVoc = Validation::filter_int($_POST['idVoc'] ?? 2); + $idVoc = Validation::filter_int($_POST['idVoc'] ?? 4); $wordList = (new \gateway\TranslationGateway())->findByIdVoc($idVoc); $name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName(); $wordShuffle = array(); @@ -115,7 +115,9 @@ class VisitorController public function resultatsJeux($match): void{ global $twig; + global $user; $score = $_POST['score']; - echo $twig->render('resultatsJeux.html', ['points' => $score]); + if(isset($user)) echo $twig->render('resultatsJeux.html', ['userID' => $user->getId(), 'userRole' => $user->getRoles(), 'points' => $score]); + else echo $twig->render('resultatsJeux.html', ['points'=>$score]); } } \ No newline at end of file diff --git a/Project/php/css/styles.css b/Project/php/css/styles.css index 635c9f2..ee4683a 100755 --- a/Project/php/css/styles.css +++ b/Project/php/css/styles.css @@ -2995,6 +2995,25 @@ textarea.form-control-lg { --bs-btn-disabled-border-color: #000; } +.btn-list{ + background-color: #884288; + color: white; + border: none; + width: 60vw; + height: 20vh; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + border-radius: 10px; + cursor: pointer; + transition: background-color 0.3s; +} + +.btn-list:hover { + background-color: #5a0073; +} + .btn-white { --bs-btn-color: #000; --bs-btn-bg: #fff; diff --git a/Project/php/templates/vocabList.html b/Project/php/templates/vocabList.html index 1aeea61..41cbeeb 100755 --- a/Project/php/templates/vocabList.html +++ b/Project/php/templates/vocabList.html @@ -3,23 +3,38 @@ Users - + {% include 'navBar.twig' %} -{% if vocabulary is defined %} +{% if vocabularies is defined %}
- - {% for row in vocabularies %} - - {% endfor %} - + {% for row in vocabularies %} + + + + {% endfor %}
- -
+
+ + +
+