diff --git a/Project/php/controller/TeacherController.php b/Project/php/controller/TeacherController.php index 5900a5c..26c4cfb 100755 --- a/Project/php/controller/TeacherController.php +++ b/Project/php/controller/TeacherController.php @@ -3,6 +3,7 @@ namespace controller; use config\Validation; use model\MdlTeacher; +use gateway\VocabularyListGateway; use Exception; class TeacherController @@ -20,8 +21,8 @@ class TeacherController { global $twig; $mdl = new MdlTeacher(); - $student = $mdl->getAll(); - echo $twig->render('usersView.html', ['users' => $student]); + $vocabularies = $mdl->getAll(); + echo $twig->render('manageVocabListView.html', ['vocabularies' => $vocabularies]); } public function getByName($name): void @@ -29,7 +30,7 @@ class TeacherController global $twig; $mdl = new MdlTeacher(); $vocab = $mdl->getVocabByName($name); - echo $twig->render('usersView.html', ['users' => $vocab]); + echo $twig->render('usersView.html', ['users' => $vocab, 'selectedName' => $name]); } diff --git a/Project/php/model/MdlTeacher.php b/Project/php/model/MdlTeacher.php index d28f15e..452b54a 100755 --- a/Project/php/model/MdlTeacher.php +++ b/Project/php/model/MdlTeacher.php @@ -16,7 +16,7 @@ class MdlTeacher extends AbsModel } public function getAll():array{ - $gtw = new VocabularyGateway(); + $gtw = new VocabularyListGateway(); return $gtw->findAll(); } @@ -26,13 +26,13 @@ class MdlTeacher extends AbsModel } public function getVocabByName(string $name):array{ - $gtw = new VocabularyGateway(); + $gtw = new VocabularyListGateway(); $res = $gtw->findByName($name); return $res; } public function RemoveVocById(int $id):void{ - $gtw = new VocabularyGateway(); + $gtw = new VocabularyListGateway(); $res = $gtw->remove($id); } diff --git a/Project/php/templates/manageVocabListView.html b/Project/php/templates/manageVocabListView.html index ff505ff..501176b 100755 --- a/Project/php/templates/manageVocabListView.html +++ b/Project/php/templates/manageVocabListView.html @@ -6,25 +6,25 @@