From 51d2ee5728696798e0eb2f640ffe95eccf8a1aac Mon Sep 17 00:00:00 2001 From: tomivt Date: Sat, 9 Nov 2024 13:33:52 +0100 Subject: [PATCH 1/5] Add Session --- .idea/material_theme_project_new.xml | 4 ++- .idea/workspace.xml | 45 ++++++++++------------- index.php | 5 ++- src/Controleur/QuizController.php | 53 +++++++++++++--------------- src/Model/QuizModel.php | 4 +-- vue/templates/quiz.html.twig | 21 +++-------- 6 files changed, 54 insertions(+), 78 deletions(-) diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml index 0d9afcc..b631df8 100644 --- a/.idea/material_theme_project_new.xml +++ b/.idea/material_theme_project_new.xml @@ -3,7 +3,9 @@ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 882bd96..d977ec5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,19 +5,12 @@ - + + - - - - - - - - - - + + - { + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "master", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" }, - "keyToStringList": { - "DatabaseDriversLRU": [ - "postgresql" + "keyToStringList": { + "DatabaseDriversLRU": [ + "postgresql" ] } -}]]> +} @@ -121,7 +114,7 @@ diff --git a/index.php b/index.php index bebf483..400e2ef 100644 --- a/index.php +++ b/index.php @@ -19,11 +19,10 @@ $twig = new \Twig\Environment($loader, [ 'cache' => 'cache', ]); +$num = 0; + $cont = new Controleur\FrontControler($co); -session_unset(); -session_destroy(); -$_SESSION = array(); ?> \ No newline at end of file diff --git a/src/Controleur/QuizController.php b/src/Controleur/QuizController.php index 3b81996..65fe758 100644 --- a/src/Controleur/QuizController.php +++ b/src/Controleur/QuizController.php @@ -1,5 +1,6 @@ co = $co; $this -> gw = new QuestionGateway($this->co); $this -> mdl = new QuestionModel($this->gw); - - $loader = new FilesystemLoader('vue/templates'); + global $num; + global $loader; $action = $_REQUEST['action'] ?? null; @@ -46,13 +48,12 @@ class QuizController switch ($action) { case 'canswer': - if ($this->CorrectAnswer()) echo "Bonne réponse"; else echo "Mauvaise réponse"; - $this->no_question ++; - echo $this->no_question; - $this->showQuestion($id, $this->no_question); + $_SESSION['no_question'] = isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1; + + header("Location: http://localhost:8000/quiz/$id"); break; default: switch($id) @@ -61,7 +62,7 @@ class QuizController // page erreur break; default: - $this->showQuestion($id, $this->no_question); + $this->showQuestion($id, $_SESSION['no_question'] ?? 0); break; } } @@ -103,42 +104,36 @@ class QuizController return $mdl->getAllQuestionByQuiz($id, $this->co); } + public function RunQuiz(int $idQuiz) + { + + } + /** * @throws RuntimeError * @throws SyntaxError * @throws LoaderError */ - public function showQuestion(int $id, int $no) : void + public function showQuestion(int $id, int $num) : void { global $twig; + echo $num; $q = $this->GetQuestion($id); - $question = $q[$no]; - + $question = $q[$num]; $idquestion = $question->getIdQuestion(); echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]); - } - - public function getNumberOfQuestion() : int - { - $gw = new QuizGateway($this->co); - $mdl = new QuizModel($gw); - return 0; + //else + //page resultat } -} - -/* -getUrl() ?>> getTitle() ?> + $gw = new QuizGateway($this->co); + $mdl = new QuizModel($gw); + return $mdl->getQuiz($id)->getNbQuestions(); } -?> - - -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/src/Model/QuizModel.php b/src/Model/QuizModel.php index 728d516..155a512 100644 --- a/src/Model/QuizModel.php +++ b/src/Model/QuizModel.php @@ -24,8 +24,8 @@ class QuizModel { $q = $this -> gateway -> findQuizById($id_quiz); if ($q) { return new quizEntity( - $q['id_quiz'], - $q['nb_questions'], + $q[0]['id_quiz'], + $q[0]['nb_quest'] ); } return null; diff --git a/vue/templates/quiz.html.twig b/vue/templates/quiz.html.twig index f78dd54..b53270d 100644 --- a/vue/templates/quiz.html.twig +++ b/vue/templates/quiz.html.twig @@ -9,7 +9,7 @@ -
- - -
- user -
-
- + {{ include "bandeau.html.twig" }}

▶ Quiz ◀

{{ question.question }}

- 300 seconds left .. + 10 seconds left ..
@@ -59,7 +46,7 @@ {{ question.answerd }}
- +
From 10ac911cc70816b81c210242766726a54ff7fef3 Mon Sep 17 00:00:00 2001 From: tomivt Date: Sat, 9 Nov 2024 14:55:04 +0100 Subject: [PATCH 2/5] Add Score + Start endQuiz View --- .idea/workspace.xml | 35 ++++--- cache/1c/1cd62e96738e2a4531dcc1f47d504b1a.php | 95 +++++++++++++++++++ src/Controleur/QuizController.php | 63 ++++++++---- vue/templates/endQuiz.html.twig | 19 ++++ 4 files changed, 173 insertions(+), 39 deletions(-) create mode 100644 cache/1c/1cd62e96738e2a4531dcc1f47d504b1a.php create mode 100644 vue/templates/endQuiz.html.twig diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d977ec5..449c40f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,12 +5,8 @@ - - - - + + + - { - "keyToString": { - "RunOnceActivity.ShowReadmeOnStart": "true", - "git-widget-placeholder": "master", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "vue.rearranger.settings.migration": "true" + +}]]> diff --git a/cache/1c/1cd62e96738e2a4531dcc1f47d504b1a.php b/cache/1c/1cd62e96738e2a4531dcc1f47d504b1a.php new file mode 100644 index 0000000..d4d5fd6 --- /dev/null +++ b/cache/1c/1cd62e96738e2a4531dcc1f47d504b1a.php @@ -0,0 +1,95 @@ + + */ + private array $macros = []; + + public function __construct(Environment $env) + { + parent::__construct($env); + + $this->source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []): iterable + { + $macros = $this->macros; + // line 1 + yield " + + + + + Wiki Fantasy : Quiz + + + + + + + +

"; + // line 14 + yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["score"] ?? null), "html", null, true); + yield "

+ + + + +"; + yield from []; + } + + /** + * @codeCoverageIgnore + */ + public function getTemplateName(): string + { + return "endQuiz.html.twig"; + } + + /** + * @codeCoverageIgnore + */ + public function isTraitable(): bool + { + return false; + } + + /** + * @codeCoverageIgnore + */ + public function getDebugInfo(): array + { + return array ( 57 => 14, 42 => 1,); + } + + public function getSourceContext(): Source + { + return new Source("", "endQuiz.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/endQuiz.html.twig"); + } +} diff --git a/src/Controleur/QuizController.php b/src/Controleur/QuizController.php index 65fe758..e0dcee7 100644 --- a/src/Controleur/QuizController.php +++ b/src/Controleur/QuizController.php @@ -1,6 +1,4 @@ co = $co; - $this -> gw = new QuestionGateway($this->co); - $this -> mdl = new QuestionModel($this->gw); + $this -> gw = new QuestionGateway($this -> co); + $this -> mdl = new QuestionModel($this -> gw); global $num; global $loader; $action = $_REQUEST['action'] ?? null; $id = (int) explode('/', $_SERVER['REQUEST_URI'])[2] ?? null; + $nb_questions = $this->getNumberOfQuestion($id); switch ($action) { case 'canswer': if ($this->CorrectAnswer()) - echo "Bonne réponse"; - else echo "Mauvaise réponse"; - $_SESSION['no_question'] = isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1; - - header("Location: http://localhost:8000/quiz/$id"); + $_SESSION['score'] = isset($_SESSION['score']) ? ($_SESSION['score'] + 1) : 1; + $this->continueQuiz($id, $nb_questions); break; default: switch($id) @@ -62,6 +56,7 @@ class QuizController // page erreur break; default: + $_SESSION['score'] = $_SESSION['score'] ?? 0; $this->showQuestion($id, $_SESSION['no_question'] ?? 0); break; } @@ -69,6 +64,40 @@ class QuizController } + /** + * @throws SyntaxError + * @throws RuntimeError + * @throws LoaderError + */ + public function continueQuiz(int $id_quiz, int $total_questions) : void + { + $score = $_SESSION['score']; + $_SESSION['no_question'] = isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1; + if ($_SESSION['no_question'] >= $total_questions) { + session_destroy(); + $this->endQuiz($id_quiz, $score); + } + else header("Location: http://localhost:8000/quiz/$id_quiz"); + + } + + /** + * @throws SyntaxError + * @throws RuntimeError + * @throws LoaderError + */ + public function endQuiz(int $id_quiz, int $score) : void + { + global $twig; + + $gw = new QuizGateway($this->co); + $mdl = new QuizModel($gw); + + if ($mdl->getQuiz($id_quiz + 1)) + echo $twig->render('endQuiz.html.twig', ['score' => $score, 'nextquiz' => $id_quiz + 1]); + echo $twig->render('endQuiz.html.twig', ['score' => $score]); + } + public function CorrectAnswer() : bool { $answera = $_POST['answera'] ?? null; @@ -104,11 +133,6 @@ class QuizController return $mdl->getAllQuestionByQuiz($id, $this->co); } - public function RunQuiz(int $idQuiz) - { - - } - /** * @throws RuntimeError * @throws SyntaxError @@ -118,14 +142,11 @@ class QuizController { global $twig; echo $num; + echo " : ", $_SESSION['score']; $q = $this->GetQuestion($id); - $question = $q[$num]; + $question = $q[$num] ?? $q[0]; $idquestion = $question->getIdQuestion(); echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]); - - //else - //page resultat - } diff --git a/vue/templates/endQuiz.html.twig b/vue/templates/endQuiz.html.twig new file mode 100644 index 0000000..b34f4ea --- /dev/null +++ b/vue/templates/endQuiz.html.twig @@ -0,0 +1,19 @@ + + + + + + Wiki Fantasy : Quiz + + + + + + + +

{{ score }}

+

{{ nextquiz }}

+ +zeze + + From 0bef52622b586adaa7fa59d2a47d8dcea8008f2c Mon Sep 17 00:00:00 2001 From: "kevin.modejar" Date: Tue, 12 Nov 2024 09:24:13 +0100 Subject: [PATCH 3/5] =?UTF-8?q?modif=20certain=20probl=C3=A8me=20quote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controleur/FrontControler.php | 2 +- src/Controleur/VisitorControler.php | 3 +-- vue/accueil.php | 1 + vue/login.php | 1 + vue/quote.php | 2 +- vue/signin.php | 1 + vue/templates/head.html.twig | 6 +++++- vue/templates/quote.html | 2 +- 8 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php index f9d30b4..65421c0 100644 --- a/src/Controleur/FrontControler.php +++ b/src/Controleur/FrontControler.php @@ -37,7 +37,7 @@ Class FrontControler{ '' => '[^/\.]++' */ - $router->map('GET|POST', '/quote/[i:idQuote]?', 'VisitorControler','quote'); + $router->map('GET|POST', '/quote/[i:idQuote]', 'VisitorControler','quote'); $router->map('GET|POST', '/login', 'VisitorControler','login'); $router->map('GET|POST', '/signin', 'VisitorControler','signin'); diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php index bbf20a5..fd855c7 100644 --- a/src/Controleur/VisitorControler.php +++ b/src/Controleur/VisitorControler.php @@ -20,9 +20,8 @@ Class VisitorControler{ public function quote(array $arg){ global $vues; - $id=$arg['idQuote'] ?? 1; + $id=$arg['idQuote']; $q = $this->qMod->searchId($id); - //echo "{$id}"; require_once $vues['quote']; } diff --git a/vue/accueil.php b/vue/accueil.php index 5c6d764..e958d5e 100644 --- a/vue/accueil.php +++ b/vue/accueil.php @@ -4,6 +4,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Accueil", 'style' => "public/styles/styleAccueil.css", + 'scripts' => array("public/script/theme-toggle.js") )); echo $twig->render('bandeau.html.twig'); diff --git a/vue/login.php b/vue/login.php index 8abfc20..39ec7a4 100644 --- a/vue/login.php +++ b/vue/login.php @@ -5,6 +5,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Login", 'style' => "public/styles/styleLogin.css", + 'scripts' => array("public/script/theme-toggle.js") )); echo $twig->render('bandeau.html.twig'); diff --git a/vue/quote.php b/vue/quote.php index 0b7f5e2..9466ceb 100644 --- a/vue/quote.php +++ b/vue/quote.php @@ -5,6 +5,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Quote", 'style' => "../public/styles/styleQuote.css", + 'scripts' => array("../public/script/theme-toggle.js") )); echo $twig->render('bandeau.html.twig'); echo $twig->render('quote.html', array( @@ -14,7 +15,6 @@ 'sourceName' => $q->getTitleSrc(), 'dateSortie' => $q->getDateSrc(), 'nbLike' => $q->getLike(), - 'timeCode' =>"1h45", )); ?> \ No newline at end of file diff --git a/vue/signin.php b/vue/signin.php index 4cef884..efb8cd3 100644 --- a/vue/signin.php +++ b/vue/signin.php @@ -5,6 +5,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Sign in", 'style' => "public/styles/styleSignin.css", + 'scripts' => array("public/script/theme-toggle.js") )); echo $twig->render('bandeau.html.twig'); diff --git a/vue/templates/head.html.twig b/vue/templates/head.html.twig index 31c1ef9..8d9e7ce 100644 --- a/vue/templates/head.html.twig +++ b/vue/templates/head.html.twig @@ -6,6 +6,10 @@ {{ title }} - + {% if scripts|length > 0 %} + {% for script in scripts %} + + {% endfor %} + {% endif %} \ No newline at end of file diff --git a/vue/templates/quote.html b/vue/templates/quote.html index ddf2581..7395b09 100644 --- a/vue/templates/quote.html +++ b/vue/templates/quote.html @@ -5,7 +5,7 @@

“{{quoteContent}}”

    -
  • - {{sourceName}} ({{timeCode}})
  • +
  • - {{sourceName}}
  • - {{nameCarac}}
  • - {{dateSortie}}
From cecf7461496fb94ceccb22365e49ae643cb9f768 Mon Sep 17 00:00:00 2001 From: Leni BEAULATON Date: Tue, 12 Nov 2024 09:56:57 +0100 Subject: [PATCH 4/5] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'src/Gateway/us?= =?UTF-8?q?erGateway.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Gateway/userGateway.php | 119 ++++++++++++++++++++++++++++-------- 1 file changed, 92 insertions(+), 27 deletions(-) diff --git a/src/Gateway/userGateway.php b/src/Gateway/userGateway.php index 4760260..1ba5805 100644 --- a/src/Gateway/userGateway.php +++ b/src/Gateway/userGateway.php @@ -11,31 +11,26 @@ Class UserGateway{ public function insert(string $username,string $email,string $passwd):string{ - // récupération id - $query='SELECT id_user FROM Users WHERE id_user >= ALL (SELECT id_user FROM Users);'; - $this->con->executeQuery($query); - $result=$this->con->getResults(); - foreach($result as $row){ - $id=$row['id_user'] + 1; - } + //crypte passeword + $passwordEncrypted = crypt($passwd); // insertion user - $query='INSERT INTO Users VALUES (:id,:username,:email,:passwd,CURRENT_DATE,false);'; - $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR),':username' => array($u->username,PDO::PARAM_STR),':email' => array($u->email,PDO::PARAM_STR),':passwd' => array($u->passwd,PDO::PARAM_STR))); + $query='INSERT INTO Users VALUES (:username,:email,:passwd,CURRENT_DATE,false);'; + $this->con->executeQuery($query,array(':username' => array($u->username,PDO::PARAM_STR),':email' => array($u->email,PDO::PARAM_STR),':passwd' => array($u->passwordEncrypted,PDO::PARAM_STR))); return $id; } public function delete(string $id) : bool{ - // supretion user + // suppression user $query='DELETE FROM Users WHERE id_user = :id;'; - return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR))); + return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT))); } public function getFavorite(string $id):array{ //obtention favoris d'un user $query='SELECT * FROM Quote WHERE id_quote IN (SELECT id_quote IN Favorite f JOIN User u ON u.id_user = f.user WHERE id_user = :id);'; - $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR))); + $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT))); $result=$this->con->getResults(); return $result; } @@ -44,32 +39,101 @@ Class UserGateway{ //obtenir les information d'un user public function findDataUser(int $id):array{ $query = 'SELECT * FROM Users WHERE id_user=:idUser'; - $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR))); + $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT))); $result = $con->getResults(); return $result; } + public function createQuote(int $id, string $content, string $langue, string $caracter, string $source):array{ + + //recupère id du personnage + $queryCaracter = "SELECT id_caracter FROM Caracter WHERE caracter =:caracter"; + $con->executeQuery($queryCaracter, array( + ':caracter'=>array($caracter, PDO::PARAM_STR) + )); + $resultCaracter = $con->getResult(); + + if($resultCaracter == NULL){ + //ajout creationCaracter + } + + //recupère id de la source + $querySource = "SELECT id_source FROM Source WHERE title =:source"; + $con->executeQuery($querySource, array( + ':source'=>array($source, PDO::PARAM_STR) + )); + $resultSource = $con->getResult(); + + if($resultSource == NULL){ + //ajout creationSource + } + $queryInsert = "INSERT INTO Quote (content, langue, id_caracter, id_source, id_user_verif) VALUES (:content, :langue, :caracter, :source, :idverif)"; + $con->executeQuery($queryInsert, array( + ':content'=>array($content, PDO::PARAM_STR), + ':langue'=>array($langue, PDO::PARAM_STR), + ':caracter'=>array($resultCaracter, PDO::PARAM_STR), + ':source'=>array($resultSource, PDO::PARAM_STR), + ':idverif'=>array($id, PDO::PARAM_INT) + )); + } + + + + public function createCaracter(string $caracter, string $img):array{ + //creation du personnage + $queryCaracter = "INSERT INTO Caracter(caracter, img_path) VALUES (:caracter, :img)"; + $con->executeQuery($queryCaracter, array( + ':caracter'=>array($caracter, PDO::PARAM_STR), + 'img'=>array($img, PDO::PARAM_STR) + )); + + //récuperation de id caracter + $queryCaracter = "SELECT id_caracter FROM Caracter WHERE caracter =:caracter"; + $con->executeQuery($queryCaracter, array( + ':caracter'=>array($caracter, PDO::PARAM_STR) + )); + $resultCaracter = $con->getResult(); + } + + + + public function createSource(string $title, string $dateS):array{ + //creation du personnage + $querySource = "INSERT INTO Source(title, dateS) VALUES (:title, :dateS)"; + $con->executeQuery($querySource, array( + ':title'=>array($title, PDO::PARAM_STR), + 'dateS'=>array($dateS, PDO::PARAM_STR) + )); + + //recupère id de la source + $querySource = "SELECT id_source FROM Source WHERE title =:source"; + $con->executeQuery($querySource, array( + ':source'=>array($source, PDO::PARAM_STR) + )); + $querySource = $con->getResult(); + } + // ===================== UPDATE FUNCTION ===================== public function updateUsername(int $id, string $newUsername):array{ //Update le nom du user passé en paramètre $queryUpdate = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser'; - $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':newUsername'=> array($newUsername, PDO::PARAM_STR))); + $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_INT), ':newUsername'=> array($newUsername, PDO::PARAM_STR))); //Renvoie le nouveau nom du user $queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser'; - $con->executeQuery($queryReponse, array($id=>array($newUsername, PDO::PARAM_STR))); + $con->executeQuery($queryReponse, array($id=>array($id, PDO::PARAM_INT))); return $result; } public function updateEmail(int $id, string $newEmail):array{ //Update le email du user passé en paramètre $queryUpdate = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser'; - $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':newEmail'=> array($newEmail, PDO::PARAM_STR))); + $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_INT), ':newEmail'=> array($newEmail, PDO::PARAM_STR))); //Renvoie le nouveau email du user $queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser'; - $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR))); + $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_INT))); $result = $con->getResults(); return $result; } @@ -77,29 +141,30 @@ Class UserGateway{ public function updateImg(int $id, int $newImg):array{ //Update l'image du user passé en paramètre $query = 'UPDATE Users SET img=:newImg WHERE id_user=:idUser'; - $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR), ':newImg'=> array($newImg, PDO::PARAM_STR))); + $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT), ':newImg'=> array($newImg, PDO::PARAM_STR))); //Renvoie la nouvelle image du user $queryReponse = 'SELECT img FROM Users WHERE id_user=:idUser'; - $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR))); + $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_INT))); $result = $con->getResults(); return $result; } public function updatePasswd(int $id, string $newPassWd):array{ - //Update le passwd du user passé en paramètre - $query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser'; - $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR), ':newPassWd'=> array($newPassWd, PDO::PARAM_STR))); - //Renvoie le nouveau passwd du user - $queryReponse = 'SELECT pssword FROM Users WHERE id_user=:idUser'; - $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR))); - $result = $con->getResults(); - return $result; + //crypte le mot de passe + $passwordEncrypted = crypt($newPassWd); + + //Update le passwd du user passé en paramètre + $query = 'UPDATE Users SET password=:newPassWd WHERE id_user=:idUser'; + $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT), ':newPassWd'=> array($passwordEncrypted, PDO::PARAM_STR))); } } + + + $uG = new UserGateway(new Connection("pgsql:host=londres;dbname=dblebeaulato","lebeaulato","")); ?> From 5334bf79b5d99281c191be3907db08324cb0600b Mon Sep 17 00:00:00 2001 From: Rocher Date: Wed, 13 Nov 2024 18:24:02 +0100 Subject: [PATCH 5/5] le push pour kevin --- .idea/dataSources.local.xml | 19 - .idea/dataSources.xml | 12 - .../351a7e7c-c4d1-4e89-bf03-667b32764270.xml | 4998 ----------------- .../_src_/database/dbwikifantasy.OCIa2Q.meta | 1 - .../schema/public.abK9xQ.meta | 2 - .idea/material_theme_project_new.xml | 10 - .idea/php.xml | 33 - .idea/vcs.xml | 6 - .idea/workspace.xml | 131 - config/config.php | 7 +- index.php | 2 +- public/styles/styleAccueil.css | 1 + src/Controleur/FrontControler.php | 9 +- src/Controleur/UserControler.php | 13 + src/Controleur/VisitorControler.php | 34 +- src/Gateway/AccueilGateway.php | 49 + src/Gateway/favoritsGateway.php | 31 + src/Gateway/userGateway.php | 16 +- vue/accueil.php | 115 +- vue/favorite.html | 30 - vue/favorits.php | 25 + vue/templates/bandeau.html.twig | 2 +- vue/templates/citation_du_jour.html.twig | 10 + vue/templates/favorits.html.twig | 9 + vue/templates/suggestion.html.twig | 9 + 25 files changed, 221 insertions(+), 5353 deletions(-) delete mode 100644 .idea/dataSources.local.xml delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270.xml delete mode 100644 .idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q.meta delete mode 100644 .idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q/schema/public.abK9xQ.meta delete mode 100644 .idea/material_theme_project_new.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml create mode 100644 src/Gateway/AccueilGateway.php create mode 100644 src/Gateway/favoritsGateway.php delete mode 100644 vue/favorite.html create mode 100644 vue/favorits.php create mode 100644 vue/templates/citation_du_jour.html.twig create mode 100644 vue/templates/favorits.html.twig create mode 100644 vue/templates/suggestion.html.twig diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml deleted file mode 100644 index 84d5b20..0000000 --- a/.idea/dataSources.local.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - " - - - master_key - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index 1e5c461..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://localhost:5432/dbwikifantasy - $ProjectFileDir$ - - - \ No newline at end of file diff --git a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270.xml b/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270.xml deleted file mode 100644 index d3d97d5..0000000 --- a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270.xml +++ /dev/null @@ -1,4998 +0,0 @@ - - - - - mdy - 1||-9223372036854775808|c|G -1||10|c|G -1||10|C|G -1||10|T|G -14087||-9223372036854775808|c|G -14087||10|c|G -14087||10|C|G -14087||10|T|G - 676242 - 14.13 - 1728898708 - true ACDT -true ACSST -false ACST -false ACT -false ACWST -true ADT -true AEDT -true AESST -false AEST -false AFT -true AKDT -false AKST -true ALMST -false ALMT -false AMST -false AMT -false ANAST -false ANAT -false ARST -false ART -false AST -true AWSST -false AWST -true AZOST -false AZOT -false AZST -false AZT -false Africa/Abidjan -false Africa/Accra -false Africa/Addis_Ababa -false Africa/Algiers -false Africa/Asmara -false Africa/Asmera -false Africa/Bamako -false Africa/Bangui -false Africa/Banjul -false Africa/Bissau -false Africa/Blantyre -false Africa/Brazzaville -false Africa/Bujumbura -false Africa/Cairo -false Africa/Casablanca -false Africa/Ceuta -false Africa/Conakry -false Africa/Dakar -false Africa/Dar_es_Salaam -false Africa/Djibouti -false Africa/Douala -false Africa/El_Aaiun -false Africa/Freetown -false Africa/Gaborone -false Africa/Harare -false Africa/Johannesburg -false Africa/Juba -false Africa/Kampala -false Africa/Khartoum -false Africa/Kigali -false Africa/Kinshasa -false Africa/Lagos -false Africa/Libreville -false Africa/Lome -false Africa/Luanda -false Africa/Lubumbashi -false Africa/Lusaka -false Africa/Malabo -false Africa/Maputo -false Africa/Maseru -false Africa/Mbabane -false Africa/Mogadishu -false Africa/Monrovia -false Africa/Nairobi -false Africa/Ndjamena -false Africa/Niamey -false Africa/Nouakchott -false Africa/Ouagadougou -false Africa/Porto-Novo -false Africa/Sao_Tome -false Africa/Timbuktu -false Africa/Tripoli -false Africa/Tunis -false Africa/Windhoek -false America/Adak -false America/Anchorage -false America/Anguilla -false America/Antigua -false America/Araguaina -false America/Argentina/Buenos_Aires -false America/Argentina/Catamarca -false America/Argentina/ComodRivadavia -false America/Argentina/Cordoba -false America/Argentina/Jujuy -false America/Argentina/La_Rioja -false America/Argentina/Mendoza -false America/Argentina/Rio_Gallegos -false America/Argentina/Salta -false America/Argentina/San_Juan -false America/Argentina/San_Luis -false America/Argentina/Tucuman -false America/Argentina/Ushuaia -false America/Aruba -true America/Asuncion -false America/Atikokan -false America/Atka -false America/Bahia -false America/Bahia_Banderas -false America/Barbados -false America/Belem -false America/Belize -false America/Blanc-Sablon -false America/Boa_Vista -false America/Bogota -false America/Boise -false America/Buenos_Aires -false America/Cambridge_Bay -false America/Campo_Grande -false America/Cancun -false America/Caracas -false America/Catamarca -false America/Cayenne -false America/Cayman -false America/Chicago -false America/Chihuahua -false America/Ciudad_Juarez -false America/Coral_Harbour -false America/Cordoba -false America/Costa_Rica -false America/Creston -false America/Cuiaba -false America/Curacao -false America/Danmarkshavn -false America/Dawson -false America/Dawson_Creek -false America/Denver -false America/Detroit -false America/Dominica -false America/Edmonton -false America/Eirunepe -false America/El_Salvador -false America/Ensenada -false America/Fort_Nelson -false America/Fort_Wayne -false America/Fortaleza -false America/Glace_Bay -false America/Godthab -false America/Goose_Bay -false America/Grand_Turk -false America/Grenada -false America/Guadeloupe -false America/Guatemala -false America/Guayaquil -false America/Guyana -false America/Halifax -false America/Havana -false America/Hermosillo -false America/Indiana/Indianapolis -false America/Indiana/Knox -false America/Indiana/Marengo -false America/Indiana/Petersburg -false America/Indiana/Tell_City -false America/Indiana/Vevay -false America/Indiana/Vincennes -false America/Indiana/Winamac -false America/Indianapolis -false America/Inuvik -false America/Iqaluit -false America/Jamaica -false America/Jujuy -false America/Juneau -false America/Kentucky/Louisville -false America/Kentucky/Monticello -false America/Knox_IN -false America/Kralendijk -false America/La_Paz -false America/Lima -false America/Los_Angeles -false America/Louisville -false America/Lower_Princes -false America/Maceio -false America/Managua -false America/Manaus -false America/Marigot -false America/Martinique -false America/Matamoros -false America/Mazatlan -false America/Mendoza -false America/Menominee -false America/Merida -false America/Metlakatla -false America/Mexico_City -false America/Miquelon -false America/Moncton -false America/Monterrey -false America/Montevideo -false America/Montreal -false America/Montserrat -false America/Nassau -false America/New_York -false America/Nipigon -false America/Nome -false America/Noronha -false America/North_Dakota/Beulah -false America/North_Dakota/Center -false America/North_Dakota/New_Salem -false America/Nuuk -false America/Ojinaga -false America/Panama -false America/Pangnirtung -false America/Paramaribo -false America/Phoenix -false America/Port-au-Prince -false America/Port_of_Spain -false America/Porto_Acre -false America/Porto_Velho -false America/Puerto_Rico -false America/Punta_Arenas -false America/Rainy_River -false America/Rankin_Inlet -false America/Recife -false America/Regina -false America/Resolute -false America/Rio_Branco -false America/Rosario -false America/Santa_Isabel -false America/Santarem -true America/Santiago -false America/Santo_Domingo -false America/Sao_Paulo -false America/Scoresbysund -false America/Shiprock -false America/Sitka -false America/St_Barthelemy -false America/St_Johns -false America/St_Kitts -false America/St_Lucia -false America/St_Thomas -false America/St_Vincent -false America/Swift_Current -false America/Tegucigalpa -false America/Thule -false America/Thunder_Bay -false America/Tijuana -false America/Toronto -false America/Tortola -false America/Vancouver -false America/Virgin -false America/Whitehorse -false America/Winnipeg -false America/Yakutat -false America/Yellowknife -false Antarctica/Casey -false Antarctica/Davis -false Antarctica/DumontDUrville -true Antarctica/Macquarie -false Antarctica/Mawson -true Antarctica/McMurdo -false Antarctica/Palmer -false Antarctica/Rothera -true Antarctica/South_Pole -false Antarctica/Syowa -false Antarctica/Troll -false Antarctica/Vostok -false Arctic/Longyearbyen -false Asia/Aden -false Asia/Almaty -false Asia/Amman -false Asia/Anadyr -false Asia/Aqtau -false Asia/Aqtobe -false Asia/Ashgabat -false Asia/Ashkhabad -false Asia/Atyrau -false Asia/Baghdad -false Asia/Bahrain -false Asia/Baku -false Asia/Bangkok -false Asia/Barnaul -false Asia/Beirut -false Asia/Bishkek -false Asia/Brunei -false Asia/Calcutta -false Asia/Chita -false Asia/Choibalsan -false Asia/Chongqing -false Asia/Chungking -false Asia/Colombo -false Asia/Dacca -false Asia/Damascus -false Asia/Dhaka -false Asia/Dili -false Asia/Dubai -false Asia/Dushanbe -false Asia/Famagusta -false Asia/Gaza -false Asia/Harbin -false Asia/Hebron -false Asia/Ho_Chi_Minh -false Asia/Hong_Kong -false Asia/Hovd -false Asia/Irkutsk -false Asia/Istanbul -false Asia/Jakarta -false Asia/Jayapura -false Asia/Jerusalem -false Asia/Kabul -false Asia/Kamchatka -false Asia/Karachi -false Asia/Kashgar -false Asia/Kathmandu -false Asia/Katmandu -false Asia/Khandyga -false Asia/Kolkata -false Asia/Krasnoyarsk -false Asia/Kuala_Lumpur -false Asia/Kuching -false Asia/Kuwait -false Asia/Macao -false Asia/Macau -false Asia/Magadan -false Asia/Makassar -false Asia/Manila -false Asia/Muscat -false Asia/Nicosia -false Asia/Novokuznetsk -false Asia/Novosibirsk -false Asia/Omsk -false Asia/Oral -false Asia/Phnom_Penh -false Asia/Pontianak -false Asia/Pyongyang -false Asia/Qatar -false Asia/Qostanay -false Asia/Qyzylorda -false Asia/Rangoon -false Asia/Riyadh -false Asia/Saigon -false Asia/Sakhalin -false Asia/Samarkand -false Asia/Seoul -false Asia/Shanghai -false Asia/Singapore -false Asia/Srednekolymsk -false Asia/Taipei -false Asia/Tashkent -false Asia/Tbilisi -false Asia/Tehran -false Asia/Tel_Aviv -false Asia/Thimbu -false Asia/Thimphu -false Asia/Tokyo -false Asia/Tomsk -false Asia/Ujung_Pandang -false Asia/Ulaanbaatar -false Asia/Ulan_Bator -false Asia/Urumqi -false Asia/Ust-Nera -false Asia/Vientiane -false Asia/Vladivostok -false Asia/Yakutsk -false Asia/Yangon -false Asia/Yekaterinburg -false Asia/Yerevan -false Atlantic/Azores -false Atlantic/Bermuda -false Atlantic/Canary -false Atlantic/Cape_Verde -false Atlantic/Faeroe -false Atlantic/Faroe -false Atlantic/Jan_Mayen -false Atlantic/Madeira -false Atlantic/Reykjavik -false Atlantic/South_Georgia -false Atlantic/St_Helena -false Atlantic/Stanley -true Australia/ACT -true Australia/Adelaide -false Australia/Brisbane -true Australia/Broken_Hill -true Australia/Canberra -true Australia/Currie -false Australia/Darwin -false Australia/Eucla -true Australia/Hobart -true Australia/LHI -false Australia/Lindeman -true Australia/Lord_Howe -true Australia/Melbourne -true Australia/NSW -false Australia/North -false Australia/Perth -false Australia/Queensland -true Australia/South -true Australia/Sydney -true Australia/Tasmania -true Australia/Victoria -false Australia/West -true Australia/Yancowinna -true BDST -false BDT -false BNT -false BORT -false BOT -false BRA -true BRST -false BRT -true BST -false BTT -false Brazil/Acre -false Brazil/DeNoronha -false Brazil/East -false Brazil/West -true CADT -false CAST -false CCT -true CDT -true CEST -false CET -true CETDST -true CHADT -false CHAST -false CHUT -false CKT -true CLST -true CLT -false COT -false CST -false CST6CDT -false CXT -false Canada/Atlantic -false Canada/Central -false Canada/Eastern -false Canada/Mountain -false Canada/Newfoundland -false Canada/Pacific -false Canada/Saskatchewan -false Canada/Yukon -true Chile/Continental -true Chile/EasterIsland -false Cuba -false DAVT -false DDUT -true EASST -true EAST -false EAT -true EDT -true EEST -false EET -true EETDST -true EGST -false EGT -false EST -false EST5EDT -false Egypt -true Eire -false Etc/GMT -false Etc/GMT+0 -false Etc/GMT+1 -false Etc/GMT+10 -false Etc/GMT+11 -false Etc/GMT+12 -false Etc/GMT+2 -false Etc/GMT+3 -false Etc/GMT+4 -false Etc/GMT+5 -false Etc/GMT+6 -false Etc/GMT+7 -false Etc/GMT+8 -false Etc/GMT+9 -false Etc/GMT-0 -false Etc/GMT-1 -false Etc/GMT-10 -false Etc/GMT-11 -false Etc/GMT-12 -false Etc/GMT-13 -false Etc/GMT-14 -false Etc/GMT-2 -false Etc/GMT-3 -false Etc/GMT-4 -false Etc/GMT-5 -false Etc/GMT-6 -false Etc/GMT-7 -false Etc/GMT-8 -false Etc/GMT-9 -false Etc/GMT0 -false Etc/Greenwich -false Etc/UCT -false Etc/UTC -false Etc/Universal -false Etc/Zulu -false Europe/Amsterdam -false Europe/Andorra -false Europe/Astrakhan -false Europe/Athens -false Europe/Belfast -false Europe/Belgrade -false Europe/Berlin -false Europe/Bratislava -false Europe/Brussels -false Europe/Bucharest -false Europe/Budapest -false Europe/Busingen -false Europe/Chisinau -false Europe/Copenhagen -true Europe/Dublin -false Europe/Gibraltar -false Europe/Guernsey -false Europe/Helsinki -false Europe/Isle_of_Man -false Europe/Istanbul -false Europe/Jersey -false Europe/Kaliningrad -false Europe/Kiev -false Europe/Kirov -false Europe/Kyiv -false Europe/Lisbon -false Europe/Ljubljana -false Europe/London -false Europe/Luxembourg -false Europe/Madrid -false Europe/Malta -false Europe/Mariehamn -false Europe/Minsk -false Europe/Monaco -false Europe/Moscow -false Europe/Nicosia -false Europe/Oslo -false Europe/Paris -false Europe/Podgorica -false Europe/Prague -false Europe/Riga -false Europe/Rome -false Europe/Samara -false Europe/San_Marino -false Europe/Sarajevo -false Europe/Saratov -false Europe/Simferopol -false Europe/Skopje -false Europe/Sofia -false Europe/Stockholm -false Europe/Tallinn -false Europe/Tirane -false Europe/Tiraspol -false Europe/Ulyanovsk -false Europe/Uzhgorod -false Europe/Vaduz -false Europe/Vatican -false Europe/Vienna -false Europe/Vilnius -false Europe/Volgograd -false Europe/Warsaw -false Europe/Zagreb -false Europe/Zaporozhye -false Europe/Zurich -false FET -true FJST -false FJT -false FKST -false FKT -true FNST -false FNT -false Factory -false GALT -false GAMT -false GB -false GB-Eire -false GEST -false GET -false GFT -false GILT -false GMT -false GMT+0 -false GMT-0 -false GMT0 -false GYT -false Greenwich -false HKT -false HST -false Hongkong -false ICT -true IDT -false IOT -false IRKST -false IRKT -false IRT -false IST -false Iceland -false Indian/Antananarivo -false Indian/Chagos -false Indian/Christmas -false Indian/Cocos -false Indian/Comoro -false Indian/Kerguelen -false Indian/Mahe -false Indian/Maldives -false Indian/Mauritius -false Indian/Mayotte -false Indian/Reunion -false Iran -false Israel -false JAYT -false JST -false Jamaica -false Japan -true KDT -true KGST -false KGT -false KOST -false KRAST -false KRAT -false KST -false Kwajalein -true LHDT -false LHST -false LIGT -false LINT -false LKT -false Libya -false MAGST -false MAGT -false MART -false MAWT -true MDT -true MEST -true MESZ -false MET -true METDST -false MEZ -false MHT -false MMT -false MPT -true MSD -false MSK -false MST -false MST7MDT -true MUST -false MUT -false MVT -false MYT -false Mexico/BajaNorte -false Mexico/BajaSur -false Mexico/General -true NDT -false NFT -false NOVST -false NOVT -false NPT -false NST -false NUT -true NZ -true NZ-CHAT -true NZDT -false NZST -false NZT -false Navajo -false OMSST -false OMST -true PDT -false PET -false PETST -false PETT -false PGT -false PHT -true PKST -false PKT -true PMDT -false PMST -false PONT -false PRC -false PST -false PST8PDT -false PWT -true PYST -true PYT -false Pacific/Apia -true Pacific/Auckland -false Pacific/Bougainville -true Pacific/Chatham -false Pacific/Chuuk -true Pacific/Easter -false Pacific/Efate -false Pacific/Enderbury -false Pacific/Fakaofo -false Pacific/Fiji -false Pacific/Funafuti -false Pacific/Galapagos -false Pacific/Gambier -false Pacific/Guadalcanal -false Pacific/Guam -false Pacific/Honolulu -false Pacific/Johnston -false Pacific/Kanton -false Pacific/Kiritimati -false Pacific/Kosrae -false Pacific/Kwajalein -false Pacific/Majuro -false Pacific/Marquesas -false Pacific/Midway -false Pacific/Nauru -false Pacific/Niue -true Pacific/Norfolk -false Pacific/Noumea -false Pacific/Pago_Pago -false Pacific/Palau -false Pacific/Pitcairn -false Pacific/Pohnpei -false Pacific/Ponape -false Pacific/Port_Moresby -false Pacific/Rarotonga -false Pacific/Saipan -false Pacific/Samoa -false Pacific/Tahiti -false Pacific/Tarawa -false Pacific/Tongatapu -false Pacific/Truk -false Pacific/Wake -false Pacific/Wallis -false Pacific/Yap -false Poland -false Portugal -false RET -false ROC -false ROK -true SADT -false SAST -false SCT -false SGT -false Singapore -false TAHT -false TFT -false TJT -false TKT -false TMT -false TOT -false TRUT -false TVT -false Turkey -false UCT -true ULAST -false ULAT -false US/Alaska -false US/Aleutian -false US/Arizona -false US/Central -false US/East-Indiana -false US/Eastern -false US/Hawaii -false US/Indiana-Starke -false US/Michigan -false US/Mountain -false US/Pacific -false US/Samoa -false UT -false UTC -true UYST -false UYT -true UZST -false UZT -false Universal -false VET -false VLAST -false VLAT -false VOLT -false VUT -false W-SU -true WADT -false WAKT -false WAST -false WAT -true WDT -false WET -true WETDST -false WFT -true WGST -false WGT -false XJT -false YAKST -false YAKT -false YAPT -true YEKST -false YEKT -false Z -false Zulu - - - - 16384 - kiem - - - 1 - 11||10|C|G -11||-9223372036854775808|U|G -11||10|U|G -2200||-9223372036854775808|C|G -2200||10|C|G -2200||-9223372036854775808|U|G -2200||10|U|G -13722||10|C|G -13722||-9223372036854775808|U|G -13722||10|U|G - 676242 - 16457 - kiem - - - default administrative connection database - 14088 - kiem - - - 1 - 1 - 1 - 1 - 10 - 1 - 1 - - - 6171 - - - 4571 - - - 3373 - 3374 -3375 -3377 - - - 6181 - - - 3374 - - - 3375 - - - 4569 - - - 4200 - - - 3377 - - - 6182 - - - 4570 - - - 1663 - 1 - kiem - - - 1664 - 1 - kiem - - - block range index (BRIN) access method - 3580 - 1 - index - 335 - brinhandler - pg_catalog - - - b-tree index access method - 403 - 1 - index - 330 - bthandler - pg_catalog - - - GIN index access method - 2742 - 1 - index - 333 - ginhandler - pg_catalog - - - GiST index access method - 783 - 1 - index - 332 - gisthandler - pg_catalog - - - hash index access method - 405 - 1 - index - 331 - hashhandler - pg_catalog - - - heap table access method - 2 - 1 - table - 3 - heap_tableam_handler - pg_catalog - - - SP-GiST index access method - 4000 - 1 - index - 334 - spghandler - pg_catalog - - - assignment - function - 10202 - 1 - 2971 - text - pg_catalog - 16 - bool - pg_catalog - 1042 - bpchar - pg_catalog - - - explicit - function - 10035 - 1 - 2558 - int4 - pg_catalog - 16 - bool - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10197 - 1 - 2971 - text - pg_catalog - 16 - bool - pg_catalog - 1043 - varchar - pg_catalog - - - assignment - function - 10192 - 1 - 2971 - text - pg_catalog - 16 - bool - pg_catalog - 25 - text - pg_catalog - - - assignment - function - 10133 - 1 - 946 - text - pg_catalog - 18 - char - pg_catalog - 1043 - varchar - pg_catalog - - - explicit - function - 10143 - 1 - 77 - int4 - pg_catalog - 18 - char - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10132 - 1 - 860 - bpchar - pg_catalog - 18 - char - pg_catalog - 1042 - bpchar - pg_catalog - - - implicit - function - 10131 - 1 - 946 - text - pg_catalog - 18 - char - pg_catalog - 25 - text - pg_catalog - - - assignment - function - 10135 - 1 - 408 - bpchar - pg_catalog - 19 - name - pg_catalog - 1042 - bpchar - pg_catalog - - - assignment - function - 10136 - 1 - 1401 - varchar - pg_catalog - 19 - name - pg_catalog - 1043 - varchar - pg_catalog - - - implicit - function - 10134 - 1 - 406 - text - pg_catalog - 19 - name - pg_catalog - 25 - text - pg_catalog - - - implicit - function - 10097 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 3734 - regconfig - pg_catalog - - - implicit - function - 10083 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 4191 - regcollation - pg_catalog - - - implicit - function - 10090 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 2206 - regtype - pg_catalog - - - assignment - function - 10033 - 1 - 3812 - money - pg_catalog - 20 - int8 - pg_catalog - 790 - money - pg_catalog - - - implicit - function - 10002 - 1 - 652 - float4 - pg_catalog - 20 - int8 - pg_catalog - 700 - float4 - pg_catalog - - - implicit - function - 10076 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - function - 10113 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 4096 - regrole - pg_catalog - - - implicit - function - 10069 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 2204 - regoperator - pg_catalog - - - implicit - function - 10060 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 2203 - regoper - pg_catalog - - - implicit - function - 10120 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 4089 - regnamespace - pg_catalog - - - assignment - function - 10000 - 1 - 714 - int2 - pg_catalog - 20 - int8 - pg_catalog - 21 - int2 - pg_catalog - - - implicit - function - 10053 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 2202 - regprocedure - pg_catalog - - - explicit - function - 10186 - 1 - 2075 - bit - pg_catalog - 20 - int8 - pg_catalog - 1560 - bit - pg_catalog - - - implicit - function - 10044 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 24 - regproc - pg_catalog - - - assignment - function - 10001 - 1 - 480 - int4 - pg_catalog - 20 - int8 - pg_catalog - 23 - int4 - pg_catalog - - - implicit - function - 10004 - 1 - 1781 - numeric - pg_catalog - 20 - int8 - pg_catalog - 1700 - numeric - pg_catalog - - - implicit - function - 10104 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 3769 - regdictionary - pg_catalog - - - implicit - function - 10037 - 1 - 1287 - oid - pg_catalog - 20 - int8 - pg_catalog - 26 - oid - pg_catalog - - - implicit - function - 10003 - 1 - 482 - float8 - pg_catalog - 20 - int8 - pg_catalog - 701 - float8 - pg_catalog - - - implicit - function - 10038 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 26 - oid - pg_catalog - - - implicit - function - 10114 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 4096 - regrole - pg_catalog - - - implicit - function - 10121 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 4089 - regnamespace - pg_catalog - - - implicit - function - 10105 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 3769 - regdictionary - pg_catalog - - - implicit - function - 10098 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 3734 - regconfig - pg_catalog - - - implicit - function - 10091 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 2206 - regtype - pg_catalog - - - implicit - function - 10077 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - function - 10070 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 2204 - regoperator - pg_catalog - - - implicit - function - 10005 - 1 - 754 - int8 - pg_catalog - 21 - int2 - pg_catalog - 20 - int8 - pg_catalog - - - implicit - function - 10061 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 2203 - regoper - pg_catalog - - - implicit - function - 10054 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 2202 - regprocedure - pg_catalog - - - implicit - function - 10006 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 23 - int4 - pg_catalog - - - implicit - function - 10009 - 1 - 1782 - numeric - pg_catalog - 21 - int2 - pg_catalog - 1700 - numeric - pg_catalog - - - implicit - function - 10084 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 4191 - regcollation - pg_catalog - - - implicit - function - 10045 - 1 - 313 - int4 - pg_catalog - 21 - int2 - pg_catalog - 24 - regproc - pg_catalog - - - implicit - function - 10008 - 1 - 235 - float8 - pg_catalog - 21 - int2 - pg_catalog - 701 - float8 - pg_catalog - - - implicit - function - 10007 - 1 - 236 - float4 - pg_catalog - 21 - int2 - pg_catalog - 700 - float4 - pg_catalog - - - assignment - function - 10011 - 1 - 314 - int2 - pg_catalog - 23 - int4 - pg_catalog - 21 - int2 - pg_catalog - - - implicit - binary - 10062 - 1 - 23 - int4 - pg_catalog - 2203 - regoper - pg_catalog - - - implicit - binary - 10071 - 1 - 23 - int4 - pg_catalog - 2204 - regoperator - pg_catalog - - - implicit - binary - 10078 - 1 - 23 - int4 - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - binary - 10092 - 1 - 23 - int4 - pg_catalog - 2206 - regtype - pg_catalog - - - implicit - function - 10010 - 1 - 481 - int8 - pg_catalog - 23 - int4 - pg_catalog - 20 - int8 - pg_catalog - - - explicit - function - 10034 - 1 - 2557 - bool - pg_catalog - 23 - int4 - pg_catalog - 16 - bool - pg_catalog - - - assignment - function - 10032 - 1 - 3811 - money - pg_catalog - 23 - int4 - pg_catalog - 790 - money - pg_catalog - - - implicit - binary - 10099 - 1 - 23 - int4 - pg_catalog - 3734 - regconfig - pg_catalog - - - implicit - binary - 10106 - 1 - 23 - int4 - pg_catalog - 3769 - regdictionary - pg_catalog - - - implicit - function - 10013 - 1 - 316 - float8 - pg_catalog - 23 - int4 - pg_catalog - 701 - float8 - pg_catalog - - - implicit - function - 10012 - 1 - 318 - float4 - pg_catalog - 23 - int4 - pg_catalog - 700 - float4 - pg_catalog - - - implicit - binary - 10046 - 1 - 23 - int4 - pg_catalog - 24 - regproc - pg_catalog - - - implicit - binary - 10085 - 1 - 23 - int4 - pg_catalog - 4191 - regcollation - pg_catalog - - - implicit - binary - 10122 - 1 - 23 - int4 - pg_catalog - 4089 - regnamespace - pg_catalog - - - implicit - binary - 10039 - 1 - 23 - int4 - pg_catalog - 26 - oid - pg_catalog - - - implicit - binary - 10115 - 1 - 23 - int4 - pg_catalog - 4096 - regrole - pg_catalog - - - implicit - function - 10014 - 1 - 1740 - numeric - pg_catalog - 23 - int4 - pg_catalog - 1700 - numeric - pg_catalog - - - implicit - binary - 10055 - 1 - 23 - int4 - pg_catalog - 2202 - regprocedure - pg_catalog - - - explicit - function - 10144 - 1 - 78 - char - pg_catalog - 23 - int4 - pg_catalog - 18 - char - pg_catalog - - - explicit - function - 10187 - 1 - 1683 - bit - pg_catalog - 23 - int4 - pg_catalog - 1560 - bit - pg_catalog - - - implicit - binary - 10043 - 1 - 24 - regproc - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10047 - 1 - 1288 - int8 - pg_catalog - 24 - regproc - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10048 - 1 - 24 - regproc - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10049 - 1 - 24 - regproc - pg_catalog - 2202 - regprocedure - pg_catalog - - - implicit - binary - 10125 - 1 - 25 - text - pg_catalog - 1042 - bpchar - pg_catalog - - - assignment - function - 10137 - 1 - 944 - char - pg_catalog - 25 - text - pg_catalog - 18 - char - pg_catalog - - - implicit - function - 10140 - 1 - 407 - name - pg_catalog - 25 - text - pg_catalog - 19 - name - pg_catalog - - - explicit - function - 10194 - 1 - 2896 - xml - pg_catalog - 25 - text - pg_catalog - 142 - xml - pg_catalog - - - implicit - function - 10109 - 1 - 1079 - regclass - pg_catalog - 25 - text - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - binary - 10126 - 1 - 25 - text - pg_catalog - 1043 - varchar - pg_catalog - - - implicit - binary - 10095 - 1 - 26 - oid - pg_catalog - 3734 - regconfig - pg_catalog - - - implicit - binary - 10088 - 1 - 26 - oid - pg_catalog - 2206 - regtype - pg_catalog - - - implicit - binary - 10074 - 1 - 26 - oid - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - binary - 10067 - 1 - 26 - oid - pg_catalog - 2204 - regoperator - pg_catalog - - - implicit - binary - 10058 - 1 - 26 - oid - pg_catalog - 2203 - regoper - pg_catalog - - - implicit - binary - 10051 - 1 - 26 - oid - pg_catalog - 2202 - regprocedure - pg_catalog - - - assignment - binary - 10041 - 1 - 26 - oid - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10042 - 1 - 26 - oid - pg_catalog - 24 - regproc - pg_catalog - - - implicit - binary - 10081 - 1 - 26 - oid - pg_catalog - 4191 - regcollation - pg_catalog - - - implicit - binary - 10111 - 1 - 26 - oid - pg_catalog - 4096 - regrole - pg_catalog - - - implicit - binary - 10118 - 1 - 26 - oid - pg_catalog - 4089 - regnamespace - pg_catalog - - - implicit - binary - 10102 - 1 - 26 - oid - pg_catalog - 3769 - regdictionary - pg_catalog - - - assignment - function - 10040 - 1 - 1288 - int8 - pg_catalog - 26 - oid - pg_catalog - 20 - int8 - pg_catalog - - - assignment - io - 10215 - 1 - 114 - json - pg_catalog - 3802 - jsonb - pg_catalog - - - assignment - binary - 10198 - 1 - 142 - xml - pg_catalog - 1043 - varchar - pg_catalog - - - assignment - binary - 10193 - 1 - 142 - xml - pg_catalog - 25 - text - pg_catalog - - - assignment - binary - 10203 - 1 - 142 - xml - pg_catalog - 1042 - bpchar - pg_catalog - - - implicit - binary - 10145 - 1 - 194 - pg_node_tree - pg_catalog - 25 - text - pg_catalog - - - assignment - function - 10165 - 1 - 4091 - box - pg_catalog - 600 - point - pg_catalog - 603 - box - pg_catalog - - - explicit - function - 10166 - 1 - 1532 - point - pg_catalog - 601 - lseg - pg_catalog - 600 - point - pg_catalog - - - assignment - function - 10168 - 1 - 1449 - polygon - pg_catalog - 602 - path - pg_catalog - 604 - polygon - pg_catalog - - - explicit - function - 10167 - 1 - 1533 - point - pg_catalog - 602 - path - pg_catalog - 600 - point - pg_catalog - - - explicit - function - 10170 - 1 - 1541 - lseg - pg_catalog - 603 - box - pg_catalog - 601 - lseg - pg_catalog - - - explicit - function - 10169 - 1 - 1534 - point - pg_catalog - 603 - box - pg_catalog - 600 - point - pg_catalog - - - explicit - function - 10172 - 1 - 1479 - circle - pg_catalog - 603 - box - pg_catalog - 718 - circle - pg_catalog - - - assignment - function - 10171 - 1 - 1448 - polygon - pg_catalog - 603 - box - pg_catalog - 604 - polygon - pg_catalog - - - explicit - function - 10173 - 1 - 1540 - point - pg_catalog - 604 - polygon - pg_catalog - 600 - point - pg_catalog - - - assignment - function - 10174 - 1 - 1447 - path - pg_catalog - 604 - polygon - pg_catalog - 602 - path - pg_catalog - - - explicit - function - 10176 - 1 - 1474 - circle - pg_catalog - 604 - polygon - pg_catalog - 718 - circle - pg_catalog - - - explicit - function - 10175 - 1 - 1446 - box - pg_catalog - 604 - polygon - pg_catalog - 603 - box - pg_catalog - - - implicit - binary - 10182 - 1 - 650 - cidr - pg_catalog - 869 - inet - pg_catalog - - - assignment - function - 10190 - 1 - 730 - text - pg_catalog - 650 - cidr - pg_catalog - 25 - text - pg_catalog - - - assignment - function - 10195 - 1 - 730 - text - pg_catalog - 650 - cidr - pg_catalog - 1043 - varchar - pg_catalog - - - assignment - function - 10200 - 1 - 730 - text - pg_catalog - 650 - cidr - pg_catalog - 1042 - bpchar - pg_catalog - - - implicit - function - 10018 - 1 - 311 - float8 - pg_catalog - 700 - float4 - pg_catalog - 701 - float8 - pg_catalog - - - assignment - function - 10016 - 1 - 238 - int2 - pg_catalog - 700 - float4 - pg_catalog - 21 - int2 - pg_catalog - - - assignment - function - 10015 - 1 - 653 - int8 - pg_catalog - 700 - float4 - pg_catalog - 20 - int8 - pg_catalog - - - assignment - function - 10019 - 1 - 1742 - numeric - pg_catalog - 700 - float4 - pg_catalog - 1700 - numeric - pg_catalog - - - assignment - function - 10017 - 1 - 319 - int4 - pg_catalog - 700 - float4 - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10023 - 1 - 312 - float4 - pg_catalog - 701 - float8 - pg_catalog - 700 - float4 - pg_catalog - - - assignment - function - 10020 - 1 - 483 - int8 - pg_catalog - 701 - float8 - pg_catalog - 20 - int8 - pg_catalog - - - assignment - function - 10024 - 1 - 1743 - numeric - pg_catalog - 701 - float8 - pg_catalog - 1700 - numeric - pg_catalog - - - assignment - function - 10022 - 1 - 317 - int4 - pg_catalog - 701 - float8 - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10021 - 1 - 237 - int2 - pg_catalog - 701 - float8 - pg_catalog - 21 - int2 - pg_catalog - - - explicit - function - 10177 - 1 - 1416 - point - pg_catalog - 718 - circle - pg_catalog - 600 - point - pg_catalog - - - explicit - function - 10179 - 1 - 1544 - polygon - pg_catalog - 718 - circle - pg_catalog - 604 - polygon - pg_catalog - - - explicit - function - 10178 - 1 - 1480 - box - pg_catalog - 718 - circle - pg_catalog - 603 - box - pg_catalog - - - implicit - function - 10181 - 1 - 4124 - macaddr - pg_catalog - 774 - macaddr8 - pg_catalog - 829 - macaddr - pg_catalog - - - assignment - function - 10030 - 1 - 3823 - numeric - pg_catalog - 790 - money - pg_catalog - 1700 - numeric - pg_catalog - - - implicit - function - 10180 - 1 - 4123 - macaddr8 - pg_catalog - 829 - macaddr - pg_catalog - 774 - macaddr8 - pg_catalog - - - assignment - function - 10191 - 1 - 730 - text - pg_catalog - 869 - inet - pg_catalog - 25 - text - pg_catalog - - - assignment - function - 10183 - 1 - 1715 - cidr - pg_catalog - 869 - inet - pg_catalog - 650 - cidr - pg_catalog - - - assignment - function - 10201 - 1 - 730 - text - pg_catalog - 869 - inet - pg_catalog - 1042 - bpchar - pg_catalog - - - assignment - function - 10196 - 1 - 730 - text - pg_catalog - 869 - inet - pg_catalog - 1043 - varchar - pg_catalog - - - implicit - function - 10205 - 1 - 668 - bpchar - pg_catalog - 1042 - bpchar - pg_catalog - 1042 - bpchar - pg_catalog - - - assignment - function - 10138 - 1 - 944 - char - pg_catalog - 1042 - bpchar - pg_catalog - 18 - char - pg_catalog - - - implicit - function - 10127 - 1 - 401 - text - pg_catalog - 1042 - bpchar - pg_catalog - 25 - text - pg_catalog - - - explicit - function - 10204 - 1 - 2896 - xml - pg_catalog - 1042 - bpchar - pg_catalog - 142 - xml - pg_catalog - - - implicit - function - 10141 - 1 - 409 - name - pg_catalog - 1042 - bpchar - pg_catalog - 19 - name - pg_catalog - - - implicit - function - 10128 - 1 - 401 - text - pg_catalog - 1042 - bpchar - pg_catalog - 1043 - varchar - pg_catalog - - - implicit - function - 10206 - 1 - 669 - varchar - pg_catalog - 1043 - varchar - pg_catalog - 1043 - varchar - pg_catalog - - - implicit - binary - 10130 - 1 - 1043 - varchar - pg_catalog - 1042 - bpchar - pg_catalog - - - implicit - function - 10110 - 1 - 1079 - regclass - pg_catalog - 1043 - varchar - pg_catalog - 2205 - regclass - pg_catalog - - - implicit - binary - 10129 - 1 - 1043 - varchar - pg_catalog - 25 - text - pg_catalog - - - implicit - function - 10142 - 1 - 1400 - name - pg_catalog - 1043 - varchar - pg_catalog - 19 - name - pg_catalog - - - explicit - function - 10199 - 1 - 2896 - xml - pg_catalog - 1043 - varchar - pg_catalog - 142 - xml - pg_catalog - - - assignment - function - 10139 - 1 - 944 - char - pg_catalog - 1043 - varchar - pg_catalog - 18 - char - pg_catalog - - - implicit - function - 10152 - 1 - 2024 - timestamp - pg_catalog - 1082 - date - pg_catalog - 1114 - timestamp - pg_catalog - - - implicit - function - 10153 - 1 - 1174 - timestamptz - pg_catalog - 1082 - date - pg_catalog - 1184 - timestamptz - pg_catalog - - - implicit - function - 10207 - 1 - 1968 - time - pg_catalog - 1083 - time - pg_catalog - 1083 - time - pg_catalog - - - implicit - function - 10155 - 1 - 2047 - timetz - pg_catalog - 1083 - time - pg_catalog - 1266 - timetz - pg_catalog - - - implicit - function - 10154 - 1 - 1370 - interval - pg_catalog - 1083 - time - pg_catalog - 1186 - interval - pg_catalog - - - implicit - function - 10208 - 1 - 1961 - timestamp - pg_catalog - 1114 - timestamp - pg_catalog - 1114 - timestamp - pg_catalog - - - assignment - function - 10156 - 1 - 2029 - date - pg_catalog - 1114 - timestamp - pg_catalog - 1082 - date - pg_catalog - - - assignment - function - 10157 - 1 - 1316 - time - pg_catalog - 1114 - timestamp - pg_catalog - 1083 - time - pg_catalog - - - implicit - function - 10158 - 1 - 2028 - timestamptz - pg_catalog - 1114 - timestamp - pg_catalog - 1184 - timestamptz - pg_catalog - - - assignment - function - 10162 - 1 - 1388 - timetz - pg_catalog - 1184 - timestamptz - pg_catalog - 1266 - timetz - pg_catalog - - - assignment - function - 10159 - 1 - 1178 - date - pg_catalog - 1184 - timestamptz - pg_catalog - 1082 - date - pg_catalog - - - assignment - function - 10160 - 1 - 2019 - time - pg_catalog - 1184 - timestamptz - pg_catalog - 1083 - time - pg_catalog - - - assignment - function - 10161 - 1 - 2027 - timestamp - pg_catalog - 1184 - timestamptz - pg_catalog - 1114 - timestamp - pg_catalog - - - implicit - function - 10209 - 1 - 1967 - timestamptz - pg_catalog - 1184 - timestamptz - pg_catalog - 1184 - timestamptz - pg_catalog - - - implicit - function - 10210 - 1 - 1200 - interval - pg_catalog - 1186 - interval - pg_catalog - 1186 - interval - pg_catalog - - - assignment - function - 10163 - 1 - 1419 - time - pg_catalog - 1186 - interval - pg_catalog - 1083 - time - pg_catalog - - - assignment - function - 10164 - 1 - 2046 - time - pg_catalog - 1266 - timetz - pg_catalog - 1083 - time - pg_catalog - - - implicit - function - 10211 - 1 - 1969 - timetz - pg_catalog - 1266 - timetz - pg_catalog - 1266 - timetz - pg_catalog - - - implicit - binary - 10184 - 1 - 1560 - bit - pg_catalog - 1562 - varbit - pg_catalog - - - explicit - function - 10188 - 1 - 2076 - int8 - pg_catalog - 1560 - bit - pg_catalog - 20 - int8 - pg_catalog - - - explicit - function - 10189 - 1 - 1684 - int4 - pg_catalog - 1560 - bit - pg_catalog - 23 - int4 - pg_catalog - - - implicit - function - 10212 - 1 - 1685 - bit - pg_catalog - 1560 - bit - pg_catalog - 1560 - bit - pg_catalog - - - implicit - binary - 10185 - 1 - 1562 - varbit - pg_catalog - 1560 - bit - pg_catalog - - - implicit - function - 10213 - 1 - 1687 - varbit - pg_catalog - 1562 - varbit - pg_catalog - 1562 - varbit - pg_catalog - - - assignment - function - 10031 - 1 - 3824 - money - pg_catalog - 1700 - numeric - pg_catalog - 790 - money - pg_catalog - - - assignment - function - 10026 - 1 - 1783 - int2 - pg_catalog - 1700 - numeric - pg_catalog - 21 - int2 - pg_catalog - - - implicit - function - 10028 - 1 - 1745 - float4 - pg_catalog - 1700 - numeric - pg_catalog - 700 - float4 - pg_catalog - - - implicit - function - 10029 - 1 - 1746 - float8 - pg_catalog - 1700 - numeric - pg_catalog - 701 - float8 - pg_catalog - - - assignment - function - 10027 - 1 - 1744 - int4 - pg_catalog - 1700 - numeric - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10025 - 1 - 1779 - int8 - pg_catalog - 1700 - numeric - pg_catalog - 20 - int8 - pg_catalog - - - implicit - function - 10214 - 1 - 1703 - numeric - pg_catalog - 1700 - numeric - pg_catalog - 1700 - numeric - pg_catalog - - - assignment - function - 10056 - 1 - 1288 - int8 - pg_catalog - 2202 - regprocedure - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10057 - 1 - 2202 - regprocedure - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10050 - 1 - 2202 - regprocedure - pg_catalog - 24 - regproc - pg_catalog - - - implicit - binary - 10052 - 1 - 2202 - regprocedure - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10063 - 1 - 1288 - int8 - pg_catalog - 2203 - regoper - pg_catalog - 20 - int8 - pg_catalog - - - implicit - binary - 10059 - 1 - 2203 - regoper - pg_catalog - 26 - oid - pg_catalog - - - implicit - binary - 10065 - 1 - 2203 - regoper - pg_catalog - 2204 - regoperator - pg_catalog - - - assignment - binary - 10064 - 1 - 2203 - regoper - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10068 - 1 - 2204 - regoperator - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10072 - 1 - 1288 - int8 - pg_catalog - 2204 - regoperator - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10073 - 1 - 2204 - regoperator - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10066 - 1 - 2204 - regoperator - pg_catalog - 2203 - regoper - pg_catalog - - - assignment - binary - 10080 - 1 - 2205 - regclass - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10075 - 1 - 2205 - regclass - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10079 - 1 - 1288 - int8 - pg_catalog - 2205 - regclass - pg_catalog - 20 - int8 - pg_catalog - - - assignment - function - 10093 - 1 - 1288 - int8 - pg_catalog - 2206 - regtype - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10094 - 1 - 2206 - regtype - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10089 - 1 - 2206 - regtype - pg_catalog - 26 - oid - pg_catalog - - - implicit - io - 10147 - 1 - 3361 - pg_ndistinct - pg_catalog - 25 - text - pg_catalog - - - implicit - binary - 10146 - 1 - 3361 - pg_ndistinct - pg_catalog - 17 - bytea - pg_catalog - - - implicit - io - 10149 - 1 - 3402 - pg_dependencies - pg_catalog - 25 - text - pg_catalog - - - implicit - binary - 10148 - 1 - 3402 - pg_dependencies - pg_catalog - 17 - bytea - pg_catalog - - - assignment - function - 10100 - 1 - 1288 - int8 - pg_catalog - 3734 - regconfig - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10101 - 1 - 3734 - regconfig - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10096 - 1 - 3734 - regconfig - pg_catalog - 26 - oid - pg_catalog - - - implicit - binary - 10103 - 1 - 3769 - regdictionary - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10107 - 1 - 1288 - int8 - pg_catalog - 3769 - regdictionary - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10108 - 1 - 3769 - regdictionary - pg_catalog - 23 - int4 - pg_catalog - - - explicit - function - 10218 - 1 - 3449 - numeric - pg_catalog - 3802 - jsonb - pg_catalog - 1700 - numeric - pg_catalog - - - explicit - function - 10223 - 1 - 2580 - float8 - pg_catalog - 3802 - jsonb - pg_catalog - 701 - float8 - pg_catalog - - - explicit - function - 10217 - 1 - 3556 - bool - pg_catalog - 3802 - jsonb - pg_catalog - 16 - bool - pg_catalog - - - explicit - function - 10222 - 1 - 3453 - float4 - pg_catalog - 3802 - jsonb - pg_catalog - 700 - float4 - pg_catalog - - - explicit - function - 10219 - 1 - 3450 - int2 - pg_catalog - 3802 - jsonb - pg_catalog - 21 - int2 - pg_catalog - - - explicit - function - 10220 - 1 - 3451 - int4 - pg_catalog - 3802 - jsonb - pg_catalog - 23 - int4 - pg_catalog - - - assignment - io - 10216 - 1 - 3802 - jsonb - pg_catalog - 114 - json - pg_catalog - - - explicit - function - 10221 - 1 - 3452 - int8 - pg_catalog - 3802 - jsonb - pg_catalog - 20 - int8 - pg_catalog - - - explicit - function - 10224 - 1 - 4281 - int4multirange - pg_catalog - 3904 - int4range - pg_catalog - 4451 - int4multirange - pg_catalog - - - explicit - function - 10226 - 1 - 4284 - nummultirange - pg_catalog - 3906 - numrange - pg_catalog - 4532 - nummultirange - pg_catalog - - - explicit - function - 10228 - 1 - 4287 - tsmultirange - pg_catalog - 3908 - tsrange - pg_catalog - 4533 - tsmultirange - pg_catalog - - - explicit - function - 10229 - 1 - 4290 - tstzmultirange - pg_catalog - 3910 - tstzrange - pg_catalog - 4534 - tstzmultirange - pg_catalog - - - explicit - function - 10227 - 1 - 4293 - datemultirange - pg_catalog - 3912 - daterange - pg_catalog - 4535 - datemultirange - pg_catalog - - - explicit - function - 10225 - 1 - 4296 - int8multirange - pg_catalog - 3926 - int8range - pg_catalog - 4536 - int8multirange - pg_catalog - - - assignment - binary - 10124 - 1 - 4089 - regnamespace - pg_catalog - 23 - int4 - pg_catalog - - - assignment - function - 10123 - 1 - 1288 - int8 - pg_catalog - 4089 - regnamespace - pg_catalog - 20 - int8 - pg_catalog - - - implicit - binary - 10119 - 1 - 4089 - regnamespace - pg_catalog - 26 - oid - pg_catalog - - - implicit - binary - 10112 - 1 - 4096 - regrole - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10116 - 1 - 1288 - int8 - pg_catalog - 4096 - regrole - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10117 - 1 - 4096 - regrole - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10082 - 1 - 4191 - regcollation - pg_catalog - 26 - oid - pg_catalog - - - assignment - function - 10086 - 1 - 1288 - int8 - pg_catalog - 4191 - regcollation - pg_catalog - 20 - int8 - pg_catalog - - - assignment - binary - 10087 - 1 - 4191 - regcollation - pg_catalog - 23 - int4 - pg_catalog - - - implicit - binary - 10150 - 1 - 5017 - pg_mcv_list - pg_catalog - 17 - bytea - pg_catalog - - - implicit - io - 10151 - 1 - 5017 - pg_mcv_list - pg_catalog - 25 - text - pg_catalog - - - explicit - function - 10036 - 1 - 5071 - xid - pg_catalog - 5069 - xid8 - pg_catalog - 28 - xid - pg_catalog - - - PL/pgSQL procedural language - 14074 - 686 - 1.0 - 11 - pg_catalog - 14075 -14076 -14077 -14078 - - - dynamically-loaded C functions - 13 - 1 - fmgr_c_validator - pg_catalog - - - built-in functions - 12 - 1 - fmgr_internal_validator - pg_catalog - - - PL/pgSQL procedural language - plpgsql_call_handler - pg_catalog - plpgsql_inline_handler - pg_catalog - 14078 - 686 - 1 - plpgsql_validator - pg_catalog - - - SQL-language functions - 14 - 1 - 1 - fmgr_sql_validator - pg_catalog - - - 13722 - 532 - kiem - - - system catalog schema - 11 - 525 - kiem - - - standard public schema - 1 - 676242 - 2024-11-05.16:07:50 - 2200 - 526 - kiem - - - integer|0s - 22874 - 1 - 1 - 676202 - kiem - - - integer|0s - 22864 - 1 - 1 - 676201 - kiem - - - integer|0s - 22848 - 1 - 1 - 676200 - kiem - - - 22978 - 676209 - 2 - kiem -
- - 22898 - 676203 - 2 - kiem -
- - 22915 - 676204 - 2 - kiem -
- - 22841 - 676200 - 2 - kiem -
- - 22937 - 676207 - 2 - kiem -
- - 22930 - 676207 - 2 - kiem -
- - 22944 - 676207 - 2 - kiem -
- - 22875 - 676202 - 2 - kiem -
- - 22961 - 676208 - 2 - kiem -
- - 22865 - 676202 - 2 - kiem -
- - 22849 - 676200 - 2 - kiem -
- - numeric|0s - 1 - 1 - 676209 - 1700 - - - varchar(99)|0s - 1 - 2 - 676209 - 1043 - - - numeric|0s - 3 - 676209 - 1700 - - - img_char - 1 - 22985 - 676209 - 1 - 22841 - - - id_char - 1 - 22983 - 1 - 676209 - 1 - 403 - - - 1 - 22984 - 1 - 676209 - 22983 - - - numeric|0s - 1 - 1 - 676203 - 1700 - - - text|0s - 1 - 2 - 676203 - 25 - - - date|0s - 1 - 3 - 676203 - 1082 - - - integer|0s - 4 - 676203 - 23 - - - integer|0s - 5 - 676203 - 23 - - - user_c - 1 - 22905 - 676203 - 1 - 22849 - - - quote_c - 1 - 22910 - 676203 - 1 - 22875 - - - id_comment - 1 - 22903 - 1 - 676203 - 1 - 403 - - - 1 - 22904 - 1 - 676203 - 22903 - - - integer|0s - 1 - 1 - 676204 - 23 - - - integer|0s - 1 - 2 - 676204 - 23 - - - user_f - 1 - 22920 - 676204 - 1 - 22849 - - - quote_f - 1 - 22925 - 676204 - 1 - 22875 - - - user_f -quote_f - 22918 - 1 - 676204 - 1 - 403 - - - 22919 - 1 - 676204 - 22918 - - - numeric|0s - 1 - 1 - 676199 - 1700 - - - varchar(99)|0s - 1 - 2 - 676199 - 1043 - - - boolean|0s - 1 - 3 - 676199 - 16 - - - id_image - 1 - 22846 - 1 - 676199 - 1 - 403 - - - 1 - 22847 - 1 - 676199 - 22846 - - - numeric|0s - 1 - 1 - 676206 - 1700 - - - varchar(99)|0s - 1 - 2 - 676206 - 1043 - - - varchar(99)|0s - 1 - 3 - 676206 - 1043 - - - varchar(99)|0s - 1 - 4 - 676206 - 1043 - - - varchar(99)|0s - 1 - 5 - 676206 - 1043 - - - varchar(99)|0s - 1 - 6 - 676206 - 1043 - - - varchar(99)|0s - 1 - 7 - 676206 - 1043 - - - id_question - 1 - 22942 - 1 - 676206 - 1 - 403 - - - 1 - 22943 - 1 - 676206 - 22942 - - - numeric|0s - 1 - 1 - 676205 - 1700 - - - integer|0s - 1 - 2 - 676205 - 23 - - - id_quiz - 1 - 22935 - 1 - 676205 - 1 - 403 - - - 1 - 22936 - 1 - 676205 - 22935 - - - numeric|0s - 1 - 1 - 676207 - 1700 - - - numeric|0s - 1 - 2 - 676207 - 1700 - - - quiz_qq - 1 - 22951 - 676207 - 1 - 22930 - - - question_qq - 1 - 22956 - 676207 - 1 - 22937 - - - quiz_qq -question_qq - 22949 - 1 - 676207 - 1 - 403 - - - 22950 - 1 - 676207 - 22949 - - - is_valid -reason - 22881 - is_valid OR (reason IS NOT NULL) - 676202 - - - integer|0s - nextval('quote_id_quote_seq'::regclass) - 1 - 1 - 676202 - 22874 - 23 - - - text|0s - 1 - 2 - 676202 - 25 - - - varchar(50)|0s - 1 - 3 - 676202 - 1043 - - - numeric|0s - 0 - 1 - 4 - 676202 - 1700 - - - varchar(50)|0s - 1 - 5 - 676202 - 1043 - - - boolean|0s - true - 1 - 6 - 676202 - 16 - - - text|0s - 7 - 676202 - 25 - - - integer|0s - 8 - 676202 - 23 - - - integer|0s - 9 - 676202 - 23 - - - user_q - 1 - 22888 - 676202 - 1 - 22849 - - - source - 1 - 22893 - 676202 - 1 - 22865 - - - id_quote - 1 - 22884 - 1 - 676202 - 1 - 403 - - - content - 1 - 22886 - 676202 - 1 - 403 - default - 100 - pg_catalog - - - 1 - 22885 - 1 - 676202 - 22884 - - - 1 - 22887 - 676202 - 22886 - - - numeric|0s - 1 - 1 - 676208 - 1700 - - - numeric|0s - 1 - 2 - 676240 - 1700 - - - integer|0s - 1 - 3 - 676208 - 23 - - - integer|0s - 1 - 4 - 676208 - 23 - - - user_r - 1 - 22968 - 676208 - 1 - 22849 - - - quiz_r - 1 - 22973 - 676208 - 1 - 22930 - - - user_r -quiz_r - 22966 - 1 - 676208 - 1 - 403 - - - 22967 - 1 - 676208 - 22966 - - - type - 22869 - (type)::text = ANY ((ARRAY['movie'::character varying, 'video-game'::character varying, 'novel'::character varying, 'anime'::character varying, 'tv'::character varying])::text[]) - 676201 - - - integer|0s - nextval('source_id_source_seq'::regclass) - 1 - 1 - 676201 - 22864 - 23 - - - varchar(99)|0s - 1 - 2 - 676201 - 1043 - - - varchar(30)|0s - 1 - 3 - 676201 - 1043 - - - numeric|0s - 1 - 4 - 676201 - 1700 - - - id_source - 1 - 22872 - 1 - 676201 - 1 - 403 - - - 1 - 22873 - 1 - 676201 - 22872 - - - integer|0s - nextval('users_id_user_seq'::regclass) - 1 - 1 - 676200 - 22848 - 23 - - - varchar(50)|0s - 1 - 2 - 676200 - 1043 - - - varchar(50)|0s - 1 - 3 - 676200 - 1043 - - - varchar(99)|0s - 1 - 4 - 676200 - 1043 - - - date|0s - 1 - 5 - 676200 - 1082 - - - boolean|0s - 1 - 6 - 676200 - 16 - - - numeric|0s - 7 - 676200 - 1700 - - - img_prfl - 1 - 22859 - 676200 - 1 - 22841 - - - id_user - 1 - 22855 - 1 - 676200 - 1 - 403 - - - username -email - 22857 - 676200 - 1 - 403 - 100 -100 - default -default - pg_catalog -pg_catalog - - - 1 - 22856 - 1 - 676200 - 22855 - - - 22858 - 676200 - 22857 - -
-
\ No newline at end of file diff --git a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q.meta b/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q.meta deleted file mode 100644 index c87485e..0000000 --- a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q.meta +++ /dev/null @@ -1 +0,0 @@ -#n:dbwikifantasy \ No newline at end of file diff --git a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q/schema/public.abK9xQ.meta b/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q/schema/public.abK9xQ.meta deleted file mode 100644 index 54e5111..0000000 --- a/.idea/dataSources/351a7e7c-c4d1-4e89-bf03-667b32764270/storage_v2/_src_/database/dbwikifantasy.OCIa2Q/schema/public.abK9xQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:public -! [676242, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml deleted file mode 100644 index 0d9afcc..0000000 --- a/.idea/material_theme_project_new.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index bc07ff3..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 882bd96..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - $PROJECT_DIR$/composer.json - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - "customColor": "", - "associatedIndex": 4 -} - - - - - - - - - - - - - - - - - - - - 1730794293135 - - - - - - \ No newline at end of file diff --git a/config/config.php b/config/config.php index 60abcb1..746e2b5 100644 --- a/config/config.php +++ b/config/config.php @@ -9,9 +9,9 @@ $rep = __DIR__ . '/../'; //BD -$base = 'dbkemondejar'; -$login = 'kemondejar'; -$mdp = ''; +$base = 'dbmarocher8'; +$login = 'marocher8'; +$mdp = 'sucepute'; //Vues @@ -21,6 +21,7 @@ $vues['quote'] = 'vue/quote.php'; $vues['login'] = 'vue/login.php'; $vues['signin'] = 'vue/signin.php'; $vues['quiz'] = 'vue/quiz.html'; +$vues['favorite'] = 'vue/favorits.php'; diff --git a/index.php b/index.php index 5b3e0d1..1b7ac9f 100644 --- a/index.php +++ b/index.php @@ -19,7 +19,7 @@ $twig = new \Twig\Environment($loader, [ 'cache' => false, ]); -$twig->addGlobal('racine','/~kekentin/WF/WF-Website'); +$twig->addGlobal('racine','/~marocher8/WF-Website'); $cont = new Controleur\FrontControler($co); diff --git a/public/styles/styleAccueil.css b/public/styles/styleAccueil.css index 7afb3e1..e0976f3 100644 --- a/public/styles/styleAccueil.css +++ b/public/styles/styleAccueil.css @@ -54,6 +54,7 @@ overflow: hidden; margin-bottom: 20px; height: 150px; + margin-left: 5%; } .suggestion { diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php index f9d30b4..0a8b24f 100644 --- a/src/Controleur/FrontControler.php +++ b/src/Controleur/FrontControler.php @@ -16,15 +16,15 @@ Class FrontControler{ - $this->listAction = ['visitor' => array('accueil','search','quote','login','signin'), - 'user' => array('quiz','commentary','favorite','logout'), - 'admin' => array('null')]; + $this->listAction = ['visitor' => array('accueil','search','quote','login','signin', 'favorite'), + 'user' => array('quiz','commentary','logout'), + 'admin' => array('null')]; $dVueEreur = []; $router = new \AltoRouter(); - $router->setBasePath('/~kemondejar/WF-Website'); + $router->setBasePath('/~marocher8/WF-Website'); $router->map('GET', '/', 'VisitorControler','accueil'); @@ -40,6 +40,7 @@ Class FrontControler{ $router->map('GET|POST', '/quote/[i:idQuote]?', 'VisitorControler','quote'); $router->map('GET|POST', '/login', 'VisitorControler','login'); $router->map('GET|POST', '/signin', 'VisitorControler','signin'); + $router->map('GET|POST', '/favorite', 'VisitorControler','favorite'); $router->map('GET|POST', '/quiz/[i:id]?', 'QuizControler','quiz'); diff --git a/src/Controleur/UserControler.php b/src/Controleur/UserControler.php index 2cc513a..1f8d264 100644 --- a/src/Controleur/UserControler.php +++ b/src/Controleur/UserControler.php @@ -7,4 +7,17 @@ Class UserControler{ global $vues; require_once $vues['quiz']; } + + public function favorits() { + global $vues; + + $user = $_SESSION['username']; + + $idUser = $this->userGateway->getIdUser($user); + + + $suggestions = $this->favoritsGateway->getFavorits(0, 'fr'); + + require_once $vues['favorits']; + } } diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php index bbf20a5..e03a88e 100644 --- a/src/Controleur/VisitorControler.php +++ b/src/Controleur/VisitorControler.php @@ -1,40 +1,52 @@ qMod = new QuoteModel(new QuoteGateway($co)); + $this->accueilGateway = new AccueilGateway($co); } - public function accueil(){ + public function accueil() { global $vues; + + // Récupérer la citation du jour via AccueilGateway + $citationDuJour = $this->accueilGateway->getQuoteOfTheDay('fr'); + $suggestions = $this->accueilGateway->getSuggestions(0, 'fr'); + + // Passer les données à la vue require_once $vues['accueil']; } - public function quote(array $arg){ + public function quote(array $arg) { global $vues; - $id=$arg['idQuote'] ?? 1; + $id = $arg['idQuote'] ?? 1; $q = $this->qMod->searchId($id); - //echo "{$id}"; require_once $vues['quote']; } - public function login(){ - + public function login() { global $vues; require_once $vues['login']; } - public function signin(){ - + public function signin() { global $vues; require_once $vues['signin']; } + + public function favorite() { + global $vues; + require_once $vues['favorite']; + } } diff --git a/src/Gateway/AccueilGateway.php b/src/Gateway/AccueilGateway.php new file mode 100644 index 0000000..e9699f4 --- /dev/null +++ b/src/Gateway/AccueilGateway.php @@ -0,0 +1,49 @@ +con = $con; + } + + public function getQuoteOfTheDay(string $language): array { + $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue + FROM Quote q + JOIN Caracter c ON c.id_caracter = q.id_caracter + JOIN Source s ON s.id_source = q.id_source + JOIN Image i ON c.id_img = i.id_img + WHERE q.isValide = true AND q.isCitationDuJour = true AND q.langue = :language + ORDER BY id_quote DESC LIMIT 1;"; + try { + $this->con->executeQuery($query, [':language' => [$language, PDO::PARAM_STR]]); + $result = $this->con->getResults(); + return $result[0] ?? []; + } catch (PDOException $e) { + echo "Erreur dans getQuoteOfTheDay: " . $e->getMessage(); + return []; + } + } + + + public function getSuggestions(int $numpage, string $language): array { + $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue + FROM Quote q + JOIN Caracter c ON c.id_caracter = q.id_caracter + JOIN Source s ON s.id_source = q.id_source + JOIN Image i ON c.id_img = i.id_img + WHERE q.isValide = true AND q.langue = :language + ORDER BY RANDOM() + LIMIT 20 OFFSET :offset;"; + + $this->con->executeQuery($query, [ + ':language' => [$language, PDO::PARAM_STR], + ':offset' => [$numpage * 20, PDO::PARAM_INT] + ]); + return $this->con->getResults(); + } +} diff --git a/src/Gateway/favoritsGateway.php b/src/Gateway/favoritsGateway.php new file mode 100644 index 0000000..dc2ce93 --- /dev/null +++ b/src/Gateway/favoritsGateway.php @@ -0,0 +1,31 @@ +con = $con; + } + + public function getSuggestions(int $numpage, string $language): array { + + $username = $_SESSION['username']; + $userId = $this->userGateway->getIdUser($username); + + $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue + FROM Quote q + JOIN Favorite f ON f.quote = q.id_quote + JOIN Caracter c ON c.id_caracter = q.id_caracter + JOIN Source s ON s.id_source = q.id_source + JOIN Image i ON c.id_img = i.id_img + WHERE q.isValide = true + AND q.langue = :language + AND f.users = :userId"; + + return $this->con->getResults(); + } +} diff --git a/src/Gateway/userGateway.php b/src/Gateway/userGateway.php index 4760260..25ae228 100644 --- a/src/Gateway/userGateway.php +++ b/src/Gateway/userGateway.php @@ -31,15 +31,6 @@ Class UserGateway{ return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR))); } - public function getFavorite(string $id):array{ - - //obtention favoris d'un user - $query='SELECT * FROM Quote WHERE id_quote IN (SELECT id_quote IN Favorite f JOIN User u ON u.id_user = f.user WHERE id_user = :id);'; - $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR))); - $result=$this->con->getResults(); - return $result; - } - //obtenir les information d'un user public function findDataUser(int $id):array{ @@ -98,6 +89,13 @@ Class UserGateway{ return $result; } + public function getIdUser(string $username):array{ + $query = 'SELECT id_user FROM Users WHERE username=:username'; + $con->executeQuery($query, array(':username'=>array($username, PDO::PARAM_STR))); + $result = $con->getResults(); + return $result; + } + } $uG = new UserGateway(new Connection("pgsql:host=londres;dbname=dblebeaulato","lebeaulato","")); diff --git a/vue/accueil.php b/vue/accueil.php index 5c6d764..f40330d 100644 --- a/vue/accueil.php +++ b/vue/accueil.php @@ -1,88 +1,39 @@ render('head.html.twig', array( - 'title' => "Accueil", - 'style' => "public/styles/styleAccueil.css", - )); - - echo $twig->render('bandeau.html.twig'); - -?> -"; - -if ($citationDuJour) { - $quote = htmlspecialchars(trim(substr($citationDuJour[1], 1))); // Retirer le symbole µ - $movie = htmlspecialchars(trim($citationDuJour[2])); - $character = htmlspecialchars(trim($citationDuJour[3])); - $year = htmlspecialchars(trim($citationDuJour[4])); - $imagePath = htmlspecialchars(trim($citationDuJour[5])); - - echo "

Citation du jour

"; - echo "
"; - echo "$movie"; - echo "
"; - echo "

\"$quote\"

"; - echo "

- $movie

"; - echo "

Personnage : $character

"; - echo "

Année : $year

"; - echo "
"; - echo "
"; +global $twig; + +// Rendu de l'en-tête +echo $twig->render('head.html.twig', [ + 'title' => "Accueil", + 'style' => "public/styles/styleAccueil.css", +]); + +// Rendu du bandeau +echo $twig->render('bandeau.html.twig'); + +// Vérification de la présence de la "Citation du jour" +if (!empty($citationDuJour)) { + echo $twig->render('citation_du_jour.html.twig', [ + 'quote' => $citationDuJour['content'], + 'movie' => $citationDuJour['title'], + 'character' => $citationDuJour['caracter'], + 'year' => $citationDuJour['dates'], + 'imagePath' => $citationDuJour['imgpath'] + ]); } else { echo "

Aucune citation du jour n'a été trouvée.

"; } -if (!empty($suggestions)) { - echo "

Suggestions

"; - echo "
"; - foreach ($suggestions as $suggestion) { - $quote = htmlspecialchars(trim($suggestion[0])); - $movie = htmlspecialchars(trim($suggestion[1])); - $character = htmlspecialchars(trim($suggestion[2])); - $year = htmlspecialchars(trim($suggestion[3])); - $imagePath = htmlspecialchars(trim($suggestion[4])); - - echo "
"; - echo "$movie"; - echo "
"; - echo "

\"$quote\"

"; - echo "

- $movie

"; - echo "

Personnage : $character

"; - echo "

Année : $year

"; - echo "
"; - echo "
"; - } - echo "
"; +// Affichage des suggestions de citations +echo "

Suggestions

"; +echo "
"; +foreach ($suggestions as $suggestion) { + echo $twig->render('suggestion.html.twig', [ + 'quote' => $suggestion['content'], + 'movie' => $suggestion['title'], + 'character' => $suggestion['caracter'], + 'year' => $suggestion['dates'], + 'imagePath' => $suggestion['imgpath'] + ]); } - -echo "
"; -?> - - \ No newline at end of file +echo "
"; +?> \ No newline at end of file diff --git a/vue/favorite.html b/vue/favorite.html deleted file mode 100644 index b87e07f..0000000 --- a/vue/favorite.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Wiki Fantasy : Favoris - - - - - - -
-
- - -
- user -
-
-
-

Wiki Fantasy

- - diff --git a/vue/favorits.php b/vue/favorits.php new file mode 100644 index 0000000..b0632c7 --- /dev/null +++ b/vue/favorits.php @@ -0,0 +1,25 @@ +render('head.html.twig', [ + 'title' => "Accueil", + 'style' => "public/styles/styleAccueil.css", +]); + +// Rendu du bandeau +echo $twig->render('bandeau.html.twig'); + +echo "

Favorits

"; +echo "
"; +foreach ($suggestions as $suggestion) { + echo $twig->render('favorits.html.twig', [ + 'quote' => $suggestion['content'], + 'movie' => $suggestion['title'], + 'character' => $suggestion['caracter'], + 'year' => $suggestion['dates'], + 'imagePath' => $suggestion['imgpath'] + ]); +} +echo "
"; +?> \ No newline at end of file diff --git a/vue/templates/bandeau.html.twig b/vue/templates/bandeau.html.twig index be606e7..5e0cb7d 100644 --- a/vue/templates/bandeau.html.twig +++ b/vue/templates/bandeau.html.twig @@ -1,6 +1,6 @@