Anthony RICHARD 1 year ago
commit 07819a17ca

@ -8,5 +8,39 @@ use Exception;
class StudentController extends UserController
{
public function affAllVocab(): void
{
global $twig;
$mdl = new MdlStudent();
$voc = $mdl->getAll();
echo $twig->render('manageVocabListView.html', ['vocabularies' => $voc]);
}
public function affAllStudent(): void
{
global $twig;
$mdl = new MdlStudent();
$student = $mdl->getAll();
echo $twig->render('usersView.html', ['users' => $student]);
}
public function getByName(): void
{
global $twig;
$mdl = new MdlStudent();
$name = Validation::filter_str_simple($_GET['listName'] ?? null);
$vocab = $mdl->getVocabByName($name);
echo $twig->render('manageVocabView.html', ['vocabularies' => $vocab]);
}
public function memoryChoice(): void {
global $twig;
global $user;
$model = new MdlStudent();
$voc = $model->getAll();
echo $twig->render('vocabList.html', ['vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]);
}
}

@ -2,9 +2,9 @@ body {
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
height: 90%;
background-color: #acc2c2;
margin: 2vh 15vh;
margin: 2% 15%;
overflow: hidden;
}
@ -36,7 +36,7 @@ h1{
cursor: pointer;
transition: transform 0.6s ease;
transform-style: preserve-3d;
min-height: 5vh;
min-height: 5%;
max-width: 100%;
aspect-ratio: 1/1;
}

@ -16,7 +16,7 @@
{% endif %}
{% if 'student' in userRole%}
<li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/memory">Learn a lesson</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/game">Play</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/memoryChoice">Memory</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/createFC}}">Create flashcards</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %}

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Users</title>
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<link href="{{base}}/css/styles.css" rel="stylesheet" />
</head>
<body>
{% include 'navBar.twig' %}
{% if vocabulary is defined %}
<div class="content">
<section>
<table>
<tr>
{% for row in vocabularies %}
<td><a href="{{base}}/student/{{idStudent}}/memory/{{idVoc}}">
<input class="btn-black" type="button" value="Show all users"/>
</a></td>
{% endfor %}
</tr>
</table>
</section>
</div>
{% endif %}
</body>
</html>
Loading…
Cancel
Save