From 41b56bfa3565d58f2a954ddbfc2599b5a15b2087 Mon Sep 17 00:00:00 2001 From: "kevin.modejar" Date: Wed, 6 Nov 2024 17:55:46 +0100 Subject: [PATCH 1/4] premier test quote -> bdd --- config/config.php | 4 ++-- index.php | 4 ++-- src/Controleur/VisitorControler.php | 11 ++++++++++- vue/quote.php | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/config/config.php b/config/config.php index cd389e1..792db41 100644 --- a/config/config.php +++ b/config/config.php @@ -10,8 +10,8 @@ $rep = __DIR__ . '/../'; //BD $base = 'dbkemondejar'; -$login = ''; -$mdp = ''; +$login = 'kemondejar'; +$mdp = 'Ctvl-21122005'; //Vues $vues['erreur'] = 'vue/erreur.php'; diff --git a/index.php b/index.php index bebf483..c8e83c7 100644 --- a/index.php +++ b/index.php @@ -11,7 +11,7 @@ require_once __DIR__ . '/config/config.php'; require __DIR__ . '/vendor/autoload.php'; -$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbwikifantasy;', 'kiem', ''); +$co = new \Gateway\Connection("pgsql:host=localhost;dbname={$base};", $login, $mdp); //twig $loader = new \Twig\Loader\FilesystemLoader('vue/templates'); @@ -20,7 +20,7 @@ $twig = new \Twig\Environment($loader, [ ]); -$cont = new Controleur\FrontControler($co); +$cont = new Controleur\FrontControler(); session_unset(); session_destroy(); diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php index 8b3cd3c..d0fbdfc 100644 --- a/src/Controleur/VisitorControler.php +++ b/src/Controleur/VisitorControler.php @@ -1,8 +1,17 @@ qMod = new QuoteModel(new QuoteGateway($co)); + } + public function accueil(){ global $vues; require_once $vues['accueil']; @@ -11,7 +20,7 @@ Class VisitorControler{ public function quote(array $arg){ global $vues; $id=$arg['idQuote'] ?? 1; - + $q = $qMod->searchId($id); //echo "{$id}"; require_once $vues['quote']; diff --git a/vue/quote.php b/vue/quote.php index 809a8c1..e71364b 100644 --- a/vue/quote.php +++ b/vue/quote.php @@ -1,6 +1,6 @@ render('head.html.twig', array( 'title' => "Quote", From 295b82cde394eeededd0d13d529d4a7b55a50224 Mon Sep 17 00:00:00 2001 From: "kevin.modejar" Date: Tue, 12 Nov 2024 08:18:18 +0100 Subject: [PATCH 2/4] supression du var dump --- src/Model/QuoteModel.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Model/QuoteModel.php b/src/Model/QuoteModel.php index e879b5e..2bcaea4 100644 --- a/src/Model/QuoteModel.php +++ b/src/Model/QuoteModel.php @@ -13,7 +13,6 @@ public function searchId(int $id): Quote{ $res = $this->gateway->searchId($id); - var_dump($res); if( count($res) == 0) return new Quote(-1,"NULL","NULL","NULL","NULL","NULL",0,"Default"); else From efb5ae6287e66f3cb682d19ddeadac1f9b4b5de9 Mon Sep 17 00:00:00 2001 From: "kevin.modejar" Date: Tue, 12 Nov 2024 08:22:22 +0100 Subject: [PATCH 3/4] micro modif --- config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.php b/config/config.php index bfa17ed..60abcb1 100644 --- a/config/config.php +++ b/config/config.php @@ -11,7 +11,7 @@ $rep = __DIR__ . '/../'; $base = 'dbkemondejar'; $login = 'kemondejar'; -$mdp = 'Ctvl-21122005'; +$mdp = ''; //Vues From 5f742119aab65eeec84bfecbedd76ae7b9f96769 Mon Sep 17 00:00:00 2001 From: "kevin.modejar" Date: Tue, 12 Nov 2024 08:43:59 +0100 Subject: [PATCH 4/4] modif --- config/config.php | 2 +- index.php | 2 +- vue/login.php | 2 +- vue/quote.php | 2 +- vue/templates/login.html | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.php b/config/config.php index 60abcb1..bfa17ed 100644 --- a/config/config.php +++ b/config/config.php @@ -11,7 +11,7 @@ $rep = __DIR__ . '/../'; $base = 'dbkemondejar'; $login = 'kemondejar'; -$mdp = ''; +$mdp = 'Ctvl-21122005'; //Vues diff --git a/index.php b/index.php index 5b3e0d1..d76fc9d 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','/~kemondejar/WF-Website'); $cont = new Controleur\FrontControler($co); diff --git a/vue/login.php b/vue/login.php index e6fea79..8abfc20 100644 --- a/vue/login.php +++ b/vue/login.php @@ -4,7 +4,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Login", - 'style' => "public/styles/styleLogin.css", + 'style' => "public/styles/styleLogin.css", )); echo $twig->render('bandeau.html.twig'); diff --git a/vue/quote.php b/vue/quote.php index 8332bf2..0b7f5e2 100644 --- a/vue/quote.php +++ b/vue/quote.php @@ -4,7 +4,7 @@ echo $twig->render('head.html.twig', array( 'title' => "Quote", - 'style' => "public/styles/styleQuote.css", + 'style' => "../public/styles/styleQuote.css", )); echo $twig->render('bandeau.html.twig'); echo $twig->render('quote.html', array( diff --git a/vue/templates/login.html b/vue/templates/login.html index e4cd68d..3005264 100644 --- a/vue/templates/login.html +++ b/vue/templates/login.html @@ -6,7 +6,7 @@ quizz
user @@ -24,7 +24,7 @@

Vous n'avez pas de compte?

- S'incrire + S'incrire