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 69ddc23..474b395 100755 --- a/Project/php/templates/manageVocabListView.html +++ b/Project/php/templates/manageVocabListView.html @@ -25,29 +25,26 @@ } -{% include 'navbar.twig' %} -
-
-
-

Vocab list

- {% include 'vocabularyContainer.twig' with {'actions' : 'affAllVocab', 'vocabularies' : vocabularies , 'userId' : userId } %} -
+
+
+

Vocab list

+ {% include 'vocabularyContainer.twig' with {'actions' : 'affAllVocab', 'vocabularies' : vocabularies , 'userId' : userId } %} +
-
-

Vocab of the user

- {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'getByName', 'selectedName' : 'selectedName', 'userId' : userId } %} -
+
+

Vocab of the user

+ {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'getByName', 'selectedName' : 'selectedName', 'userId' : userId } %} +
-
-

Add Vocabb

- {% include 'vocabularyContainer.twig' with { 'actions' : 'addVocabList' , 'userId' : userId } %} -
+
+

Add Vocabb

+ {% include 'vocabularyContainer.twig' with { 'vocabularies' : vocabularies ,'actions' : 'addVocabList' , 'userId' : userId } %} +
-
-

Unassigned vocab

- {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', 'userId' : userId } %} -
-
+
+

Unassigned vocab

+ {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', '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 %} +