diff --git a/Project/php/controller/StudentController.php b/Project/php/controller/StudentController.php index 1e716d7..30f09bb 100755 --- a/Project/php/controller/StudentController.php +++ b/Project/php/controller/StudentController.php @@ -8,31 +8,5 @@ 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]); - } } \ No newline at end of file diff --git a/Project/php/controller/TeacherController.php b/Project/php/controller/TeacherController.php index 95244c1..729f6e3 100755 --- a/Project/php/controller/TeacherController.php +++ b/Project/php/controller/TeacherController.php @@ -9,36 +9,14 @@ use model\MdlUser; class TeacherController extends UserController { - public function affAllStudent(): void - { - global $twig; - global $user; - $mdl = new MdlTeacher(); - $student = $mdl->getAllStudent(); - echo $twig->render('usersView.html', ['users' => $student, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); - - } - public function affAllVocab(): void { global $twig; global $user; - $id = $user->getId(); $mdl = new MdlTeacher(); $vocabularies = $mdl->getAll(); - echo $twig->render('manageVocabListView.html', ['vocabularies' => $vocabularies, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); - } - - public function getByName(): void - { - global $twig; - global $user; - $mdl = new MdlTeacher(); - $id = $user->getId(); - $name = Validation::filter_str_simple($_GET['listName'] ?? null); - $vocab = $mdl->getVocabByName($name); - echo $twig->render('manageVocabListView.html', ['vocabularies' => $vocab, 'selectedName' => $name, 'userID' => $user->getId(), 'userRole' => $user->getRoles() ]); - + $groups = $mdl->getAllGroups(); + echo $twig->render('manageVocabListView.html', ['vocabularies' => $vocabularies, 'groups' => $groups, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); } public function DelById():void{ diff --git a/Project/php/model/MdlTeacher.php b/Project/php/model/MdlTeacher.php index dd0d273..786f8d6 100755 --- a/Project/php/model/MdlTeacher.php +++ b/Project/php/model/MdlTeacher.php @@ -2,6 +2,7 @@ namespace model; +use gateway\GroupGateway; use gateway\TranslationGateway; use gateway\UserGateway; use gateway\VocabularyGateway; @@ -14,6 +15,11 @@ class MdlTeacher extends MdlUser return $gtw->findAll(); } + public function getAllGroups(): array { + $gtw = new GroupGateway(); + return $gtw->findAll(); + } + public function getAllStudent():array { $gtw = new UserGateway(); return $gtw->findAll(); diff --git a/Project/php/templates/groupContainer.twig b/Project/php/templates/groupContainer.twig index 411f51a..45cb379 100755 --- a/Project/php/templates/groupContainer.twig +++ b/Project/php/templates/groupContainer.twig @@ -35,6 +35,22 @@ {% endif %} + {% if 'removeVocabFromGroup' in actions %} +
French word | +English word | +
trad.word1 | +trad.word2 | +