diff --git a/Website/cache/13/1347f3db213e1bf75451b4cc3885934e5c3eddee1052de5e2ecf10e156219e2b.php b/Website/cache/13/1347f3db213e1bf75451b4cc3885934e5c3eddee1052de5e2ecf10e156219e2b.php new file mode 100644 index 0000000..1f17a9b --- /dev/null +++ b/Website/cache/13/1347f3db213e1bf75451b4cc3885934e5c3eddee1052de5e2ecf10e156219e2b.php @@ -0,0 +1,136 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + Maths Educ + + + + + + + + + +
+
+
+
+
modifier un Chapter
+
+
+
+
+ +
+
+ + +
+
+
+ + +
+
+
+
+
+ + + + + + +"; + } + + public function getTemplateName() + { + return "adminChaptersModal.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 105 => 61, 101 => 60, 89 => 51, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminChaptersModal.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminChaptersModal.twig"); + } +} diff --git a/Website/cache/1f/1fc7d8dc401f74d1d06b95bd6b6fe5919e8685e374b516e7f56df9d25c13c67f.php b/Website/cache/1f/1fc7d8dc401f74d1d06b95bd6b6fe5919e8685e374b516e7f56df9d25c13c67f.php new file mode 100644 index 0000000..b0004f2 --- /dev/null +++ b/Website/cache/1f/1fc7d8dc401f74d1d06b95bd6b6fe5919e8685e374b516e7f56df9d25c13c67f.php @@ -0,0 +1,148 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + Maths Educ + + + + + + + + + +
+

Liste des chapitres

+ +
+
+ +
+ D + Retour + G +
+
+ + + +
+
+
+
+
Ajouter un chapitre
+
+
+
+
+ + +
+
+
+ + +
+
+
+
+
+ + +"; + } + + public function getTemplateName() + { + return "adminChapters.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 90 => 35, 80 => 31, 76 => 30, 71 => 28, 68 => 27, 64 => 26, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminChapters.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminChapters.twig"); + } +} diff --git a/Website/cache/28/2874fd11e8ba4e8aedc291f0ea97648a7e4b30290a5341fa0151ef490a532206.php b/Website/cache/28/2874fd11e8ba4e8aedc291f0ea97648a7e4b30290a5341fa0151ef490a532206.php index 191fc8e..135a3c9 100644 --- a/Website/cache/28/2874fd11e8ba4e8aedc291f0ea97648a7e4b30290a5341fa0151ef490a532206.php +++ b/Website/cache/28/2874fd11e8ba4e8aedc291f0ea97648a7e4b30290a5341fa0151ef490a532206.php @@ -58,7 +58,7 @@ class __TwigTemplate_e196f9ec32fc9706c65ba98b0f6c214ddc2e5d903a2e8bbcc6e385ff276

Connexion

-
+
@@ -68,6 +68,10 @@ class __TwigTemplate_e196f9ec32fc9706c65ba98b0f6c214ddc2e5d903a2e8bbcc6e385ff276
+

"; + // line 35 + echo twig_escape_filter($this->env, ($context["error"] ?? null), "html", null, true); + echo "

@@ -84,9 +88,14 @@ class __TwigTemplate_e196f9ec32fc9706c65ba98b0f6c214ddc2e5d903a2e8bbcc6e385ff276 return "loginAdmin.twig"; } + public function isTraitable() + { + return false; + } + public function getDebugInfo() { - return array ( 37 => 1,); + return array ( 73 => 35, 37 => 1,); } public function getSourceContext() diff --git a/Website/cache/4f/4f9c74e337511dff24e627b10b947dbce722c56faec3b1e728b787873ffa938a.php b/Website/cache/4f/4f9c74e337511dff24e627b10b947dbce722c56faec3b1e728b787873ffa938a.php index d85767d..2070def 100644 --- a/Website/cache/4f/4f9c74e337511dff24e627b10b947dbce722c56faec3b1e728b787873ffa938a.php +++ b/Website/cache/4f/4f9c74e337511dff24e627b10b947dbce722c56faec3b1e728b787873ffa938a.php @@ -41,7 +41,6 @@ class __TwigTemplate_c98eacdb83979a8d1d23cbb83febab2600b7cfae34ecace697c0e2fd5d8 - + + + +
+
+
+
+
Modifier un administrateur
+
+
+
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
+
+ + + + + + +"; + } + + public function getTemplateName() + { + return "adminAdministratorsModal.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 114 => 67, 110 => 66, 106 => 65, 93 => 55, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminAdministratorsModal.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminAdministratorsModal.twig"); + } +} diff --git a/Website/cache/5a/5a1baa02496b99a752bfec79c963147e79c8be196c8f83c1ad6a3a7b0014acfa.php b/Website/cache/5a/5a1baa02496b99a752bfec79c963147e79c8be196c8f83c1ad6a3a7b0014acfa.php new file mode 100644 index 0000000..2c15b5e --- /dev/null +++ b/Website/cache/5a/5a1baa02496b99a752bfec79c963147e79c8be196c8f83c1ad6a3a7b0014acfa.php @@ -0,0 +1,121 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + + + + Math'Educ + + + + + +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident fuga cum soluta iure libero! Ullam, expedita excepturi! Odio distinctio quos quasi commodi libero ratione corrupti, unde iste explicabo suscipit consequatur ipsum! Id beatae corrupti ipsa totam deserunt, vel tenetur, iusto quaerat asperiores veritatis quidem! Vel dolorem recusandae necessitatibus ullam laborum! + +

+
+
+
+ + +
+
+ + +
+
+
+"; + } + + public function getTemplateName() + { + return "multijoueur.twig"; + } + + public function getDebugInfo() + { + return array ( 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "multijoueur.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\multijoueur.twig"); + } +} diff --git a/Website/cache/a2/a23149f73c48985414ea7a4dd74518c2907ce9eecc5ae2c54be3aa1799e9bd4e.php b/Website/cache/a2/a23149f73c48985414ea7a4dd74518c2907ce9eecc5ae2c54be3aa1799e9bd4e.php new file mode 100644 index 0000000..aa8ef68 --- /dev/null +++ b/Website/cache/a2/a23149f73c48985414ea7a4dd74518c2907ce9eecc5ae2c54be3aa1799e9bd4e.php @@ -0,0 +1,250 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + Maths Educ + + + + + + + + + +
+
+
+
+
Ajouter un chapitre
+
+
+
+
+ +
+
+ + +
+
+ + +
+
+ + + + env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 50) == twig_get_attribute($this->env, $this->source, (($__internal_compile_0 = ($context["answers"] ?? null)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[0] ?? null) : null), "id", [], "any", false, false, false, 50))) { + echo "checked=\"checked\""; + } + echo " value=\"1\"> Correct +
+
+ + + + env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 56) == twig_get_attribute($this->env, $this->source, (($__internal_compile_1 = ($context["answers"] ?? null)) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1[1] ?? null) : null), "id", [], "any", false, false, false, 56))) { + echo "checked=\"checked\""; + } + echo " value=\"2\"> Correct +
+
+ + + + env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 62) == twig_get_attribute($this->env, $this->source, (($__internal_compile_2 = ($context["answers"] ?? null)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2[2] ?? null) : null), "id", [], "any", false, false, false, 62))) { + echo "checked=\"checked\""; + } + echo " value=\"3\"> Correct +
+
+ + + + env, $this->source, ($context["question"] ?? null), "idanswergood", [], "any", false, false, false, 68) == twig_get_attribute($this->env, $this->source, (($__internal_compile_3 = ($context["answers"] ?? null)) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3[3] ?? null) : null), "id", [], "any", false, false, false, 68))) { + echo "checked=\"checked\""; + } + echo " value=\"4\"> Correct +
+
+
+ + +
+
+
+
+
+ + + + + + +"; + } + + public function getTemplateName() + { + return "adminQuestionsModal.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 219 => 113, 215 => 112, 211 => 111, 207 => 110, 202 => 108, 198 => 107, 194 => 106, 190 => 105, 185 => 103, 181 => 102, 159 => 83, 139 => 68, 128 => 62, 117 => 56, 106 => 50, 98 => 44, 83 => 42, 79 => 41, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminQuestionsModal.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminQuestionsModal.twig"); + } +} diff --git a/Website/cache/b2/b2674317b6db9744dcd4652e8f0bf9078df9e09e730bbdced5a971926714b55a.php b/Website/cache/b2/b2674317b6db9744dcd4652e8f0bf9078df9e09e730bbdced5a971926714b55a.php new file mode 100644 index 0000000..dd1b060 --- /dev/null +++ b/Website/cache/b2/b2674317b6db9744dcd4652e8f0bf9078df9e09e730bbdced5a971926714b55a.php @@ -0,0 +1,111 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + + + + Math'Educ + + + + + +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident fuga cum soluta iure libero! Ullam, expedita excepturi! Odio distinctio quos quasi commodi libero ratione corrupti, unde iste explicabo suscipit consequatur ipsum! Id beatae corrupti ipsa totam deserunt, vel tenetur, iusto quaerat asperiores veritatis quidem! Vel dolorem recusandae necessitatibus ullam laborum! + +

+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+"; + } + + public function getTemplateName() + { + return "solo.twig"; + } + + public function getDebugInfo() + { + return array ( 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "solo.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\solo.twig"); + } +} diff --git a/Website/cache/bb/bba6790b934a511ee44ce677aeb600105fb3225296e06aa63c58bbcc6e276d08.php b/Website/cache/bb/bba6790b934a511ee44ce677aeb600105fb3225296e06aa63c58bbcc6e276d08.php new file mode 100644 index 0000000..41219b3 --- /dev/null +++ b/Website/cache/bb/bba6790b934a511ee44ce677aeb600105fb3225296e06aa63c58bbcc6e276d08.php @@ -0,0 +1,152 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + Maths Educ + + + + + + + + + +
+

Liste des Administrateurs

+ +
+
+ +
+ D + Retour + G +
+
+ +
+
+
+
+
Ajouter une question
+ +
+
+
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+ + +"; + } + + public function getTemplateName() + { + return "adminPlayers.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 91 => 36, 81 => 32, 77 => 31, 72 => 29, 69 => 28, 65 => 27, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminPlayers.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminPlayers.twig"); + } +} diff --git a/Website/cache/bb/bbf848822c23cc3555010da96607eefb8bf76bb5053c141d59fa798f5b57f2ba.php b/Website/cache/bb/bbf848822c23cc3555010da96607eefb8bf76bb5053c141d59fa798f5b57f2ba.php new file mode 100644 index 0000000..8167818 --- /dev/null +++ b/Website/cache/bb/bbf848822c23cc3555010da96607eefb8bf76bb5053c141d59fa798f5b57f2ba.php @@ -0,0 +1,190 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + Maths Educ + + + + + + + + + +
+

Liste des questions

+ +
+
+ +
+ D + Retour + G +
+
+ + + +
+
+
+
+
Ajouter un chapitre
+
+
+
+
+ + +
+
+ + +
+
+ + + Correct +
+
+ + + Correct +
+
+ + + Correct +
+
+ + + Correct +
+
+
+ + +
+
+
+
+
+ + +"; + } + + public function getTemplateName() + { + return "adminQuestions.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 135 => 66, 124 => 64, 120 => 63, 90 => 35, 80 => 31, 76 => 30, 71 => 28, 68 => 27, 64 => 26, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "adminQuestions.twig", "C:\\MAMP\\htdocs\\3.01-QCM_MuscuMaths\\Website\\templates\\adminQuestions.twig"); + } +} diff --git a/Website/controllers/ControllerAdminAdministrators.php b/Website/controllers/ControllerAdminAdministrators.php index 6def9c6..d994571 100644 --- a/Website/controllers/ControllerAdminAdministrators.php +++ b/Website/controllers/ControllerAdminAdministrators.php @@ -2,25 +2,77 @@ class ControllerAdminAdministrators { + private $gatewayAdministrator; + + private $twig; + private $vues; + function __construct() { global $dns, $user, $pass, $vues, $twig; session_start(); try { - $con = new Connection($dns, $user, $pass); - - $gatewayAdministrator = new GatewayAdministrator($con); - $administrators = $gatewayAdministrator->getAdministrators(); - - echo $twig->render($vues["adminAdministrators"], [ - 'administrators' => $administrators, - ]); - + if($_SESSION["idAdminConnected"] != null){ + $this->twig =$twig; + $this->vues = $vues; + + $con = new Connection($dns, $user, $pass); + + $this->gatewayAdministrator = new GatewayAdministrator($con); + + $administrators = $this->gatewayAdministrator->getAdministrators(); + + echo $twig->render($vues["adminAdministrators"], [ + 'administrators' => $administrators, + ]); + } + else { + header("Location:/login"); + } } catch (PDOException $e) { // Gérez les erreurs PDO ici } catch (Exception $e2) { // Gérez d'autres erreurs ici } } -} + + function delete($param) { + $this->gatewayAdministrator->deleteAdministratorByID($param["id"]); + header("Location:/admin/administrators"); + } + + function add($param) { + + $username = $_POST['username']; + $password = $_POST['password']; + + $Admin = new Administrator($username, $password); + + $this->gatewayAdministrator->addAdministrator($Admin); + + header("Location:/admin/administrators"); + } + + function updatemodal($param) { + + $administrator = $this->gatewayAdministrator->getAdministratorByID($param["id"]); + + echo $this->twig->render($this->vues["adminAdministratorsModal"], [ + 'administrator' => $administrator, + ]); + } + + function update($param) { + + $id = $_POST['id']; + $username = $_POST['username']; + $password = $_POST['password']; + + $Admin = new Administrator($username, $password); + + $this->gatewayAdministrator->updateAdministrator($id,$Admin); + + header("Location:/admin/administrators"); + } +} \ No newline at end of file diff --git a/Website/controllers/ControllerAdminChapters.php b/Website/controllers/ControllerAdminChapters.php index 2edc2ed..e4c99c9 100644 --- a/Website/controllers/ControllerAdminChapters.php +++ b/Website/controllers/ControllerAdminChapters.php @@ -1,43 +1,75 @@ render($vues["adminChapters"]); - - /* - switch ($action) { - case "goToSolo": - require($vues['Solo']); - break; - case "goToMulti": - require($vues['Multi']); - break; - case "goToAdmin": - break; - default: - require($vues["Accueil"]); - break; + global $dns, $user, $pass, $vues, $twig; + session_start(); + try { + if($_SESSION["idAdminConnected"] != null){ + $this->twig =$twig; + $this->vues = $vues; + + $con = new Connection($dns, $user, $pass); + + $this->gatewayChapter = new GatewayChapter($con); + + $chapters = $this->gatewayChapter->getChapters(); + + echo $twig->render($vues["adminChapters"], [ + 'chapters' => $chapters, + ]); + } + else { + header("Location:/login"); + } + } catch (PDOException $e) { + // Gérez les erreurs PDO ici + } catch (Exception $e2) { + // Gérez d'autres erreurs ici } - */ - } catch (PDOException $e) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require(__DIR__.'/../vues/erreur.php'); - } catch (Exception $e2) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require ($rep.$vues['erreur']); - } + } + + function delete($param) { + $this->gatewayChapter->deleteChapter($param["id"]); + header("Location:/admin/chapters"); + } + + function add($param) { + + $name = $_POST['name']; + + $Chapter = new Chapter($name); + + $this->gatewayChapter->addChapter($Chapter); + + header("Location:/admin/chapters"); + } + + function updatemodal($param) { + + $chapter = $this->gatewayChapter->getChapterByID($param["id"]); + + echo $this->twig->render($this->vues["adminChaptersModal"], [ + 'chapter' => $chapter, + ]); + } + + function update($param) { + + $id = $_POST['id']; + $name = $_POST['name']; + + $Chapter = new Chapter($name); + + $this->gatewayChapter->updateChapter($id,$Chapter); + + header("Location:/admin/chapters"); } } diff --git a/Website/controllers/ControllerAdminQuestions.php b/Website/controllers/ControllerAdminQuestions.php new file mode 100644 index 0000000..84fa36a --- /dev/null +++ b/Website/controllers/ControllerAdminQuestions.php @@ -0,0 +1,135 @@ +twig =$twig; + $this->vues = $vues; + + $con = new Connection($dns, $user, $pass); + + $this->gatewayQuestion = new GatewayQuestion($con); + $this->gatewayAnswer = new GatewayAnswer($con); + $this->gatewayChapter = new GatewayChapter($con); + + $questions = $this->gatewayQuestion->getQuestions(); + $chapters = $this->gatewayChapter->getChapters(); + + echo $twig->render($vues["adminQuestions"], [ + 'questions' => $questions, + 'chapters' => $chapters, + ]); + } + else { + header("Location:/login"); + } + } catch (PDOException $e) { + // Gérez les erreurs PDO ici + } catch (Exception $e2) { + // Gérez d'autres erreurs ici + } + } + + function delete($param) { + $this->gatewayQuestion->deleteQuestionByID($param["id"]); + header("Location:/admin/questions"); + } + + function add($param) { + $content = $_POST['content']; + $idChapter = intval($_POST['idChapter']); + $AnswersPost = array(); + $AnswersPost[1] = $_POST['answer1']; + $AnswersPost[2] = $_POST['answer2']; + $AnswersPost[3] = $_POST['answer3']; + $AnswersPost[4] = $_POST['answer4']; + $correctAnswer = intval($_POST['correctAnswer']); + + $Question = new Question($content,$idChapter); + + $questionId = intval($this->gatewayQuestion->addQuestion($Question)); + + $Answers = array(); + $Answer[1] = new Answer($AnswersPost[1],$questionId); + $Answer[2] = new Answer($AnswersPost[2],$questionId); + $Answer[3] = new Answer($AnswersPost[3],$questionId); + $Answer[4] = new Answer($AnswersPost[4],$questionId); + + $answersId = array(); + $answersId[1] = $this->gatewayAnswer->addAnswer($Answer[1]); + $answersId[2] = $this->gatewayAnswer->addAnswer($Answer[2]); + $answersId[3] = $this->gatewayAnswer->addAnswer($Answer[3]); + $answersId[4] = $this->gatewayAnswer->addAnswer($Answer[4]); + + $Question = new Question($content,$idChapter,$answersId[$correctAnswer]); + + $this->gatewayQuestion->updateQuestion($questionId,$Question); + + header("Location:/admin/questions"); + } + + function updatemodal($param) { + + $question = $this->gatewayQuestion->getQuestionByID($param["id"]); + + $answers = array(); + $answers = $this->gatewayAnswer->getAnswersByIDQuestions($param["id"]); + + $chapters = $this->gatewayChapter->getChapters(); + + echo $this->twig->render($this->vues["adminQuestionsModal"], [ + 'question' => $question, + 'chapters' => $chapters, + 'answers' => $answers, + ]); + } + + function update($param) { + + $id = $_POST['id']; + $content = $_POST['content']; + $idChapter = intval($_POST['idChapter']); + + $correctAnswer = intval($_POST['correctAnswer']); + + $answersId = array(); + $answersId[1] = intval($_POST['IdAnswer1']); + $answersId[2] = intval($_POST['IdAnswer2']); + $answersId[3] = intval($_POST['IdAnswer3']); + $answersId[4] = intval($_POST['IdAnswer4']); + + $answers = array(); + $answers[1] = $_POST['answer1']; + $answers[2] = $_POST['answer2']; + $answers[3] = $_POST['answer3']; + $answers[4] = $_POST['answer4']; + + $Question = new Question($content, $idChapter, $answersId[$correctAnswer]); + + $this->gatewayQuestion->updateQuestion($id, $Question); + + $Answer1 = new Answer($answers[1],$id); + $Answer2 = new Answer($answers[2],$id); + $Answer3 = new Answer($answers[3],$id); + $Answer4 = new Answer($answers[4],$id); + + $this->gatewayAnswer->updateAnswer($answersId[1],$Answer1); + $this->gatewayAnswer->updateAnswer($answersId[2],$Answer2); + $this->gatewayAnswer->updateAnswer($answersId[3],$Answer3); + $this->gatewayAnswer->updateAnswer($answersId[4],$Answer4); + + header("Location:/admin/questions"); + } +} diff --git a/Website/controllers/ControllerAdminUsers.php b/Website/controllers/ControllerAdminUsers.php deleted file mode 100644 index 044ad9f..0000000 --- a/Website/controllers/ControllerAdminUsers.php +++ /dev/null @@ -1,43 +0,0 @@ -render($vues["accueil"]); - - /* - switch ($action) { - case "goToSolo": - require($vues['Solo']); - break; - case "goToMulti": - require($vues['Multi']); - break; - case "goToAdmin": - break; - default: - require($vues["Accueil"]); - break; - } - */ - } catch (PDOException $e) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require(__DIR__.'/../vues/erreur.php'); - } catch (Exception $e2) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require ($rep.$vues['erreur']); - } - } -} diff --git a/Website/controllers/ControllerAdministrator.php b/Website/controllers/ControllerAdministrator.php deleted file mode 100755 index 6e42c6a..0000000 --- a/Website/controllers/ControllerAdministrator.php +++ /dev/null @@ -1,72 +0,0 @@ -validationConnexion(); - break; - case "quitterAdministrator": - $Administrator->deconnexion(); - header("location: index.php"); - break; - case "AjouterQuestion": - case "SupprimerQuestion": - case "ModifierQuestion": - case "AjouterReponse": - case "SupprimerReponse": - case "ModifierReponse": - case "AjouterAdmin": - case "SupprimerAdmin": - default: - break; - } - } catch (PDOException $e) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require(__DIR__.'/../vues/erreur.php'); - } catch (Exception $e2) { - // $dataVueEreur[] = "Erreur inattendue!!! "; - // require ($rep.$vues['erreur']); - } - } - - function validationConnexion() - { - global $vues; - $validation = new Validation(); - $error = []; - $validation->val_form($_POST['name'], $_POST['password'], $error); - foreach ($error as $key) { - print($key); - } - - if (empty($error)) { - $validation = $Administrator->connection($_POST['name'], $_POST['password']); - if (!empty($validation)) { - header("location: index.php?action=goToAdministratoristration"); - } else { - header("location: index.php?action=goToAdministratorConnexion"); - } - } else { - header("location: index.php?action=goToAdministratorConnexion"); - } - } -} diff --git a/Website/controllers/ControllerLoginAdmin.php b/Website/controllers/ControllerLoginAdmin.php index 5183615..ec0dcc2 100644 --- a/Website/controllers/ControllerLoginAdmin.php +++ b/Website/controllers/ControllerLoginAdmin.php @@ -2,36 +2,24 @@ class ControllerLoginAdmin { + private $gatewayAdministrator; function __construct() { - global $dsn, $user, $pass, $vues, $twig; + global $dns, $user, $pass, $vues, $twig; session_start(); try { - /* - $action = ""; - if (isset($_REQUEST['action'])) { - $action = $_REQUEST['action']; - } - */ - - echo $twig->render($vues["loginAdmin"]); - - /* - switch ($action) { - case "goToSolo": - require($vues['Solo']); - break; - case "goToMulti": - require($vues['Multi']); - break; - case "goToAdmin": - break; - default: - require($vues["Accueil"]); - break; - } - */ + + $con = new Connection($dns, $user, $pass); + + $this->gatewayAdministrator = new GatewayAdministrator($con); + + echo $twig->render($vues["loginAdmin"], [ + 'error' => $_SESSION["error"], + ]); + + $_SESSION["error"]=""; + } catch (PDOException $e) { // $dataVueEreur[] = "Erreur inattendue!!! "; // require(__DIR__.'/../vues/erreur.php'); @@ -40,4 +28,21 @@ class ControllerLoginAdmin // require ($rep.$vues['erreur']); } } + + function verify(){ + $username = $_POST['username']; + $password = $_POST['password']; + + $Administrator = new Administrator($username, $password); + + $AdministratorIsOk = $this->gatewayAdministrator->verifyAdministrator($Administrator); + if($AdministratorIsOk != null) { + $_SESSION["idAdminConnected"]=$AdministratorIsOk; + header("Location:/admin/administrators"); + } + else { + $_SESSION["error"]="utilisateur introuvable."; + header("Location:/login"); + } + } } diff --git a/Website/controllers/FrontController.php b/Website/controllers/FrontController.php index d3885a9..a5f94cd 100755 --- a/Website/controllers/FrontController.php +++ b/Website/controllers/FrontController.php @@ -47,11 +47,19 @@ class FrontController $router->map('GET', '/', 'ControllerAccueil'); // Route pour la page d'accueil $router->map('GET', '/solo', 'ControllerSolo'); $router->map('GET', '/multi', 'ControllerMulti'); - $router->map('GET', '/admin', 'ControllerAdmin'); + $router->map('GET', '/admin', 'ControllerAdminAdministrators'); $router->map('GET', '/login', 'ControllerLoginAdmin'); + $router->map('POST', '/login/[a:action]', 'ControllerLoginAdmin'); $router->map('GET', '/admin/chapters', 'ControllerAdminChapters'); + $router->map('POST', '/admin/chapters/[a:action]', 'ControllerAdminChapters'); + $router->map('GET', '/admin/chapters/[a:action]/[i:id]', 'ControllerAdminChapters'); $router->map('GET', '/admin/administrators', 'ControllerAdminAdministrators'); - $router->map('GET', '/admin/users', 'ControllerAdminUsers'); + $router->map('POST', '/admin/administrators/[a:action]', 'ControllerAdminAdministrators'); + $router->map('GET', '/admin/administrators/[a:action]/[i:id]', 'ControllerAdminAdministrators'); + $router->map('GET', '/admin/questions', 'ControllerAdminQuestions'); + $router->map('POST', '/admin/questions/[a:action]', 'ControllerAdminQuestions'); + $router->map('GET', '/admin/questions/[a:action]/[i:id]', 'ControllerAdminQuestions'); + // Match the current request $match = $router->match(); @@ -64,24 +72,13 @@ class FrontController if ($match) { $controller = $match['target']; $action=$match['params']['action']; - $id=$match['params']['id']; // paramètre 2 + $id=$match['params']['id']; $controller = new $controller; - if (is_callable($match['target'])) { - call_user_func_array($match['target'], $match['params']); - } - - /* if (is_callable(array($controller, $action))) { - call_user_func_array(array($controller, $action), array($match['params'])); } - } - else { - if (is_callable($match['target'])) { - call_user_func_array($match['target'], $match['params']); - } + call_user_func_array(array($controller, $action), array($match['params'])); } - */ } } catch (Exception $e) { diff --git a/Website/gateways/GatewayAdministrator.php b/Website/gateways/GatewayAdministrator.php index 433932a..cc78368 100755 --- a/Website/gateways/GatewayAdministrator.php +++ b/Website/gateways/GatewayAdministrator.php @@ -11,20 +11,19 @@ class GatewayAdministrator public function addAdministrator($administrator) { - $query = "insert into Administrators(id,username,hashedPassword) values (:id,:username,:hashedPassword);"; + $query = "insert into administrators(username,password) values (:username,:password);"; $this->con->executeQuery( $query, array( - ':id' => array($administrator->getId(), PDO::PARAM_INT), ':username' => array($administrator->getUsername(), PDO::PARAM_STR), - ':hashedPassword' => array($administrator->getHashedPassword(), PDO::PARAM_STR) + ':password' => array($administrator->getHashedPassword(), PDO::PARAM_STR) ) ); } public function getAdministratorByUsername(string $username) { - $query = "SELECT * FROM Administrators WHERE username = :username;"; + $query = "SELECT * FROM administrators WHERE username = :username;"; $this->con->executeQuery($query, array(':username' => array($username, PDO::PARAM_STR))); $results = $this->con->getResults(); if ($results == NULL) { @@ -35,13 +34,11 @@ class GatewayAdministrator public function getAdministratorByID(int $id) { - $query = "SELECT * FROM Administrators WHERE id = :id;"; + $query = "SELECT * FROM administrators WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } - return new Administrator($results[0]['id'], $results[0]['username'], $results[0]['hashedPassword']); + + return $results[0]; } public function getAdministrators() @@ -53,22 +50,37 @@ class GatewayAdministrator return $results; } - public function updateAdministrator($administrator) + public function updateAdministrator($id,$administrator) { - $query = "UPDATE Administrators SET username = :username, hashedPassword = :hashedPassword WHERE id = :id;"; + $query = "UPDATE administrators SET username = :username, password = :password WHERE id = :id;"; $this->con->executeQuery( $query, array( - ':id' => array($administrator->getId(), PDO::PARAM_INT), + ':id' => array($id, PDO::PARAM_INT), ':username' => array($administrator->getUsername(), PDO::PARAM_STR), - ':hashedPassword' => array($administrator->getHashedPassword(), PDO::PARAM_STR) + ':password' => array($administrator->getHashedPassword(), PDO::PARAM_STR) ) ); } public function deleteAdministratorByID($id) { - $query = "DELETE FROM Administrators WHERE id = :id;"; + $query = "DELETE FROM administrators WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } + + public function verifyAdministrator($administrator) + { + $query = "SELECT administrators.id FROM administrators WHERE username = :username AND password = :password"; + $this->con->executeQuery( + $query, + array( + ':username' => array($administrator->getUsername(), PDO::PARAM_STR), + ':password' => array($administrator->getHashedPassword(), PDO::PARAM_STR) + ) + ); + $results = $this->con->getResults(); + + return $results[0]; + } } diff --git a/Website/gateways/GatewayAnswer.php b/Website/gateways/GatewayAnswer.php index 38f9642..3ffeeab 100755 --- a/Website/gateways/GatewayAnswer.php +++ b/Website/gateways/GatewayAnswer.php @@ -11,34 +11,39 @@ class GatewayAnswer public function addAnswer($answer) { - $query = "insert into Answers(id,content) values (:id,:content);"; + $query = "insert into answers(content,idquestion) values (:content,:idquestion);"; $this->con->executeQuery( $query, array( - ':id' => array($answer->getId(), PDO::PARAM_INT), - ':content' => array($answer->getContent(), PDO::PARAM_STR) + ':content' => array($answer->getContent(), PDO::PARAM_STR), + ':idquestion' => array($answer->getIdQuestion(), PDO::PARAM_INT), ) ); + $answerId = $this->con->lastInsertId(); + return $answerId; } - public function getAnswerByIDQuestions($idQuestions) + public function getAnswersByIDQuestions($idQuestions) { - $query = "SELECT * FROM Answers, Questions WHERE questions.id = :idQuestions;"; - $this->con->executeQuery($query, array(':idQuestions' => array($idQuestions, PDO::PARAM_INT))); + $query = "SELECT answers.content,answers.id FROM answers, questions WHERE questions.id = :idquestions AND answers.idquestion = questions.id ;"; + $this->con->executeQuery( + $query, + array( + ':idquestions' => array($idQuestions, PDO::PARAM_INT) + ) + ); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } - return new Answer($results[0]['id'], $results[0]['content']); + + return $results; } - public function updateAnswer($answer) + public function updateAnswer($id,$answer) { - $query = "UPDATE Answers SET content = :content WHERE id = :id;"; + $query = "UPDATE answers SET content = :content WHERE id = :id;"; $this->con->executeQuery( $query, array( - ':id' => array($answer->getId(), PDO::PARAM_INT), + ':id' => array($id, PDO::PARAM_INT), ':content' => array($answer->getContent(), PDO::PARAM_STR) ) ); @@ -46,7 +51,7 @@ class GatewayAnswer public function deleteAnswer($id) { - $query = "DELETE FROM Answers WHERE id = :id;"; + $query = "DELETE FROM answers WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } } diff --git a/Website/gateways/GatewayChapter.php b/Website/gateways/GatewayChapter.php index aa6bc43..545fabc 100755 --- a/Website/gateways/GatewayChapter.php +++ b/Website/gateways/GatewayChapter.php @@ -11,11 +11,10 @@ class GatewayChapter public function addChapter($chapter) { - $query = "insert into Chapters(id,name) values (:id,:name);"; + $query = "insert into chapters(name) values (:name);"; $this->con->executeQuery( $query, array( - ':id' => array($chapter->getId(), PDO::PARAM_INT), ':name' => array($chapter->getName(), PDO::PARAM_STR) ) ); @@ -23,26 +22,29 @@ class GatewayChapter public function getChapters() { - $query = "SELECT * FROM Chapters;"; + $query = "SELECT * FROM chapters"; $this->con->executeQuery($query); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } - $chapters = array(); - foreach ($results as $row) { - $chapters[] = new Chapter($row['id'], $row['name']); - } - return $chapters; + + return $results; } - public function updateChapter($chapter) + public function getChapterByID(int $id) { - $query = "UPDATE Chapters SET name = :name WHERE id = :id;"; + $query = "SELECT * FROM chapters WHERE id = :id;"; + $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); + $results = $this->con->getResults(); + + return $results[0]; + } + + public function updateChapter($id,$chapter) + { + $query = "UPDATE chapters SET name = :name WHERE id = :id;"; $this->con->executeQuery( $query, array( - ':id' => array($chapter->getId(), PDO::PARAM_INT), + ':id' => array($id, PDO::PARAM_INT), ':name' => array($chapter->getName(), PDO::PARAM_STR) ) ); @@ -50,7 +52,7 @@ class GatewayChapter public function deleteChapter($id) { - $query = "DELETE FROM Chapters WHERE id = :id;"; + $query = "DELETE FROM chapters WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } } diff --git a/Website/gateways/GatewayPlayer.php b/Website/gateways/GatewayPlayer.php index 2fff780..a5f8d44 100755 --- a/Website/gateways/GatewayPlayer.php +++ b/Website/gateways/GatewayPlayer.php @@ -11,7 +11,7 @@ class GatewayPlayer public function addPlayer($player) { - $query = "insert into Players(id,nickname,hashedPassword) values (:id,:nickname,:hashedPassword);"; + $query = "insert into players(id,nickname,hashedPassword) values (:id,:nickname,:hashedPassword);"; $this->con->executeQuery( $query, array( @@ -24,7 +24,7 @@ class GatewayPlayer public function getPlayerByNickname(string $nickname) { - $query = "SELECT * FROM Players WHERE nickname = :nickname;"; + $query = "SELECT * FROM players WHERE nickname = :nickname;"; $this->con->executeQuery($query, array(':nickname' => array($nickname, PDO::PARAM_STR))); $results = $this->con->getResults(); if ($results == NULL) { @@ -32,9 +32,10 @@ class GatewayPlayer } return new Player($results[0]['id'], $results[0]['nickname'], $results[0]['hashedPassword']); } + public function getPlayerByID(int $id) { - $query = "SELECT * FROM Players WHERE id = :id;"; + $query = "SELECT * FROM players WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); $results = $this->con->getResults(); if ($results == NULL) { @@ -42,19 +43,19 @@ class GatewayPlayer } return new Player($results[0]['id'], $results[0]['nickname'], $results[0]['hashedPassword']); } + public function getPlayers() { - $query = "SELECT * FROM Players;"; + $query = "SELECT * FROM players"; $this->con->executeQuery($query); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } + + return $results; } public function updatePlayer($player) { - $query = "UPDATE Players SET nickname = :nickname, hashedPassword = :hashedPassword WHERE id = :id;"; + $query = "UPDATE players SET nickname = :nickname, hashedPassword = :hashedPassword WHERE id = :id;"; $this->con->executeQuery( $query, array( @@ -67,7 +68,7 @@ class GatewayPlayer public function deletePlayerByID(int $id) { - $query = "DELETE FROM Players WHERE id = :id;"; + $query = "DELETE FROM players WHERE id = :id;"; $this->con->executeQuery( $query, array( @@ -75,4 +76,19 @@ class GatewayPlayer ) ); } + + public function verifyPlayer($player) + { + $query = "SELECT players.id FROM players WHERE nickname = :nickname AND password = :password"; + $this->con->executeQuery( + $query, + array( + ':nickname' => array($player->getUsername(), PDO::PARAM_STR), + ':password' => array($player->getHashedPassword(), PDO::PARAM_STR) + ) + ); + $results = $this->con->getResults(); + + return $results[0]; + } } diff --git a/Website/gateways/GatewayQuestion.php b/Website/gateways/GatewayQuestion.php index 178f041..86a68f2 100755 --- a/Website/gateways/GatewayQuestion.php +++ b/Website/gateways/GatewayQuestion.php @@ -9,38 +9,59 @@ class GatewayQuestion $this->con = $con; } - public function addQuestion($question) + public function addQuestion($question) { - $query = "insert into Questions(id,content,difficulty,nbFails) values (:id,:content,:difficulty,:nbFails);"; + $query = "insert into questions(content,idchapter,difficulty,nbfails) values (:content,:idchapter,:difficulty,:nbfails);"; $this->con->executeQuery( $query, array( - ':id' => array($question->getId(), PDO::PARAM_INT), ':content' => array($question->getContent(), PDO::PARAM_STR), + ':idchapter' => array($question->getIdChapter(), PDO::PARAM_INT), ':difficulty' => array($question->getDifficulty(), PDO::PARAM_INT), - ':nbFails' => array($question->getNbFails(), PDO::PARAM_INT) + ':nbfails' => array($question->getNbFails(), PDO::PARAM_INT) ) ); + $questionId = $this->con->lastInsertId(); + return $questionId; } public function getQuestionByID($id) { - $query = "SELECT * FROM Questions WHERE id = :id;"; + $query = "SELECT * FROM questions WHERE id = :id;"; $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } - return new Question($results[0]['id'], $results[0]['content'], $results[0]['difficulty'], $results[0]['nbFails']); + + return $results[0]; } public function getQuestions() { - $query = "SELECT * FROM Questions;"; + $query = "SELECT * FROM questions"; $this->con->executeQuery($query); $results = $this->con->getResults(); - if ($results == NULL) { - return false; - } + + return $results; + } + + public function updateQuestion($id,$question) + { + $query = "UPDATE questions SET content = :content, idchapter = :idchapter, idanswergood = :idanswergood, difficulty = :difficulty, nbfails = :nbfails WHERE id = :id;"; + $this->con->executeQuery( + $query, + array( + ':content' => array($question->getContent(), PDO::PARAM_STR), + ':idchapter' => array($question->getIdChapter(), PDO::PARAM_INT), + ':idanswergood' => array($question->getIdAnswerGood(), PDO::PARAM_INT), + ':difficulty' => array($question->getDifficulty(), PDO::PARAM_INT), + ':nbfails' => array($question->getNbFails(), PDO::PARAM_INT), + ':id' => array($id, PDO::PARAM_INT), + ) + ); + } + + public function deleteQuestionByID($id) + { + $query = "DELETE FROM questions WHERE id = :id;"; + $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } } diff --git a/Website/js/script.js b/Website/js/script.js deleted file mode 100755 index 5739c6a..0000000 --- a/Website/js/script.js +++ /dev/null @@ -1,21 +0,0 @@ -// Example starter JavaScript for disabling form submissions if there are invalid fields -(() => { - 'use strict' - - // Fetch all the forms we want to apply custom Bootstrap validation styles to - const forms = document.querySelectorAll('.needs-validation') - - // Loop over them and prevent submission - Array.from(forms).forEach(form => { - form.addEventListener('submit', event => { - if (!form.checkValidity()) { - event.preventDefault() - event.stopPropagation() - } - form.classList.add('was-validated') - }, false) - }) - -})() - - diff --git a/Website/models/Administrator.php b/Website/models/Administrator.php index be01ef5..f5fc48f 100755 --- a/Website/models/Administrator.php +++ b/Website/models/Administrator.php @@ -6,25 +6,26 @@ class Administrator private string $username; private string $hashedPassword; - public function __construct(int $id, string $username, string $password) + public function __construct(string $username, string $password) { - $this->id = $id; $this->username = $username; try { - $this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]); + $this->hashedPassword = $hashedPassword = md5($password); } catch (Exception $e) { echo $e->getMessage(); } } - + public function getUsername() { return $this->username; } + public function getHashedPassword() { return $this->hashedPassword; } + public function setHashedPassword(string $hashedPassword) { $this->hashedPassword = $hashedPassword; diff --git a/Website/models/Answer.php b/Website/models/Answer.php index 8722f94..518beba 100755 --- a/Website/models/Answer.php +++ b/Website/models/Answer.php @@ -4,17 +4,24 @@ class Answer { private int $id; private string $content; + private int $idQuestion; - public function __construct(int $id, string $content) + public function __construct(string $content, int $idQuestion) { - $this->id = $id; $this->content = $content; + $this->idQuestion = $idQuestion; } public function getContent() { return $this->content; } + + public function getIdQuestion() + { + return $this->idQuestion; + } + public function setContent(string $content) { $this->content = $content; diff --git a/Website/models/Chapter.php b/Website/models/Chapter.php index 73ae831..ac2dec0 100755 --- a/Website/models/Chapter.php +++ b/Website/models/Chapter.php @@ -5,9 +5,8 @@ class Chapter private int $id; private string $name; - public function __construct(int $id, string $name) + public function __construct(string $name) { - $this->id = $id; $this->name = $name; } diff --git a/Website/models/Player.php b/Website/models/Player.php index 79c8712..06d5d71 100755 --- a/Website/models/Player.php +++ b/Website/models/Player.php @@ -11,7 +11,7 @@ class Player $this->id = $id; $this->nickname = $nickname; try { - $this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]); + $this->hashedPassword = $hashedPassword = md5($password); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/Website/models/Question.php b/Website/models/Question.php index 8fd0a61..7631fe6 100755 --- a/Website/models/Question.php +++ b/Website/models/Question.php @@ -4,30 +4,52 @@ class Question { private int $id; private string $content; + private int $idChapter; private int $difficulty; private int $nbFails; + private int $idAnswerGood; - public function __construct(int $id, string $content, int $difficulty = 1, int $nbFails = 0) + public function __construct(string $content, int $idChapter, int $idAnswerGood = -1, int $difficulty = 1, int $nbFails = 0) { - $this->id = $id; $this->content = $content; + $this->idChapter = $idChapter; + if ($idAnswerGood != -1) { + $this->idAnswerGood = $idAnswerGood; + } $this->difficulty = $difficulty; $this->nbFails = $nbFails; } - public function getContent() + public function getContent() { return $this->content; } + + public function getIdChapter() + { + return $this->idChapter; + } + + public function getIdAnswerGood() + { + return $this->idAnswerGood; + } + public function setContent(string $content) { $this->content = $content; } + public function setIdAnswerGood(int $idAnswerGood) + { + $this->idAnswerGood = $idAnswerGood; + } + public function getDifficulty() { return $this->difficulty; } + public function setDifficulty(int $difficulty) { $this->difficulty = $difficulty; @@ -37,6 +59,7 @@ class Question { return $this->nbFails; } + public function setNbFails(int $nbFails) { $this->nbFails = $nbFails; diff --git a/Website/templates/adminAdministrators.twig b/Website/templates/adminAdministrators.twig index cb15355..9254444 100644 --- a/Website/templates/adminAdministrators.twig +++ b/Website/templates/adminAdministrators.twig @@ -5,7 +5,6 @@ - + + + + + + + + + + diff --git a/Website/templates/adminChapters.twig b/Website/templates/adminChapters.twig index e69de29..d438083 100644 --- a/Website/templates/adminChapters.twig +++ b/Website/templates/adminChapters.twig @@ -0,0 +1,70 @@ + + + + Maths Educ + + + + + + + + + +
+

Liste des chapitres

+ +
+
+ +
+ D + Retour + G +
+
+ + + + + + diff --git a/Website/templates/adminChaptersModal.twig b/Website/templates/adminChaptersModal.twig new file mode 100644 index 0000000..a4ed24a --- /dev/null +++ b/Website/templates/adminChaptersModal.twig @@ -0,0 +1,68 @@ + + + + Maths Educ + + + + + + + + + + + + + + + + diff --git a/Website/templates/adminQuestions.twig b/Website/templates/adminQuestions.twig new file mode 100644 index 0000000..ab86e9a --- /dev/null +++ b/Website/templates/adminQuestions.twig @@ -0,0 +1,98 @@ + + + + Maths Educ + + + + + + + + + +
+

Liste des questions

+ +
+
+ +
+ D + Retour + G +
+
+ + + + + + diff --git a/Website/templates/adminQuestionsModal.twig b/Website/templates/adminQuestionsModal.twig new file mode 100644 index 0000000..0028757 --- /dev/null +++ b/Website/templates/adminQuestionsModal.twig @@ -0,0 +1,120 @@ + + + + Maths Educ + + + + + + + + + + + + + + + + diff --git a/Website/templates/adminUsers.twig b/Website/templates/adminUsers.twig deleted file mode 100644 index e69de29..0000000 diff --git a/Website/templates/loginAdmin.twig b/Website/templates/loginAdmin.twig index f22619d..c7ca8cf 100644 --- a/Website/templates/loginAdmin.twig +++ b/Website/templates/loginAdmin.twig @@ -22,7 +22,7 @@

Connexion

-
+
@@ -32,6 +32,7 @@
+

{{error}}

diff --git a/Website/templates/previsualisation.twig b/Website/templates/previsualisation.twig deleted file mode 100644 index b8bc69c..0000000 --- a/Website/templates/previsualisation.twig +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - Math'Educ - - - - - - - -
-
-

- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident fuga cum soluta iure libero! Ullam, expedita excepturi! Odio distinctio quos quasi commodi libero ratione corrupti, unde iste explicabo suscipit consequatur ipsum! Id beatae corrupti ipsa totam deserunt, vel tenetur, iusto quaerat asperiores veritatis quidem! Vel dolorem recusandae necessitatibus ullam laborum! - -

-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
- - - - - - - \ No newline at end of file diff --git a/Website/usages/Config.php b/Website/usages/Config.php index bc11698..a24ca66 100755 --- a/Website/usages/Config.php +++ b/Website/usages/Config.php @@ -15,5 +15,8 @@ $vues["connexion"]="connexion.twig"; $vues["choixSolo"]="choixThemeSolo.twig"; $vues["loginAdmin"]="loginAdmin.twig"; $vues["adminAdministrators"]="adminAdministrators.twig"; +$vues["adminAdministratorsModal"]="adminAdministratorsModal.twig"; $vues["adminChapters"]="adminChapters.twig"; -$vues["adminUsers"]="adminUsers.twig"; \ No newline at end of file +$vues["adminChaptersModal"]="adminChaptersModal.twig"; +$vues["adminQuestions"]="adminQuestions.twig"; +$vues["adminQuestionsModal"]="adminQuestionsModal.twig"; \ No newline at end of file