diff --git a/Project/php/controller/TeacherController.php b/Project/php/controller/TeacherController.php index e333e35..fb51a9c 100755 --- a/Project/php/controller/TeacherController.php +++ b/Project/php/controller/TeacherController.php @@ -59,16 +59,14 @@ class TeacherController extends UserController global $user; $id = $user->getId(); $mdl = new MdlTeacher(); - $userID = Validation::filter_int($_GET['userID'] ?? null); $name = Validation::filter_str_simple($_GET['listName'] ?? null); $words = array(); - for ($i = 0; $i <= 1; $i++) { - $frenchWord = Validation::filter_str_simple($_GET['frenchWord'.$i] ?? null); - $englishWord = Validation::filter_str_simple($_GET['englishWord'.$i] ?? null); + $frenchWord = Validation::filter_str_simple($_GET['frenchWord'] ?? null); + $englishWord = Validation::filter_str_simple($_GET['englishWord'] ?? null); $words[] = array($frenchWord, $englishWord); - } - var_dump($words); - $mdl->addVocabList($userID, $name, "", $words); - echo $twig->render('addVocabList.html', [ 'userId' => $id ]); + var_dump($words); + $addvoc= $mdl->addVocabList($id, $name, "", $words); + echo $twig->render('manageVocabListView.html', [ 'vocabularies' => $addvoc ,'userId' => $id]); } + } \ No newline at end of file diff --git a/Project/php/templates/manageVocabListView.html b/Project/php/templates/manageVocabListView.html index 3fe2ddf..474b395 100755 --- a/Project/php/templates/manageVocabListView.html +++ b/Project/php/templates/manageVocabListView.html @@ -38,7 +38,7 @@

Add Vocabb

- {% include 'vocabularyContainer.twig' with { 'actions' : 'addVocabList' , 'userId' : userId } %} + {% include 'vocabularyContainer.twig' with { 'vocabularies' : vocabularies ,'actions' : 'addVocabList' , 'userId' : userId } %}
diff --git a/Project/php/templates/vocabularyContainer.twig b/Project/php/templates/vocabularyContainer.twig index cff1799..571e118 100755 --- a/Project/php/templates/vocabularyContainer.twig +++ b/Project/php/templates/vocabularyContainer.twig @@ -28,20 +28,27 @@ {% endif %} - {% endif %} + {% endif %} {% endfor %} +
+ {% if actions == 'addVocabList' %} - - - - - - - - - - - {% endif %} +
+ +

+ + +

+ + +

+ + +
+ + + {% endif %} +