pull/21/head
Leni BEAULATON 6 months ago
commit df9bac28fc

@ -36,11 +36,11 @@ Class QuoteGateway{
return $result; return $result;
} }
public function getComment(int $id):array{ public function searchId(string $id):array{
//obtention des commentaire d'une citation //recherche par id
$query="SELECT c.id_comment u.username, u.imgPath, c.comment, c.date FROM Commentary c JOIN Quote q ON c.quote = q.id_quote JOIN User u ON u.id_user = c.user JOIN Image i ON i.id_img = u.img WHERE id_quote = :id;"; $query="SELECT q.id_quote, q.content, c.caracter, c.img_path, s.title, s.date, q.like, q.language FROM Quote q JOIN Caracter c ON c.id_caracter = q.id_caracter JOIN Source s ON s.id_source = q.id_source WHERE q.id_quote = '%:id%' AND q.isValid = true;";
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT))); $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR)));
$result=$this->con->getResults(); $result=$this->con->getResults();
return $result; return $result;
} }
@ -64,7 +64,7 @@ Class QuoteGateway{
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT))); $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
} }
public function validQuote(int $id){ public function invalidQuote(int $id){
//Invalide la quote par l'admin (suppression) //Invalide la quote par l'admin (suppression)
$query ='DELETE FROM Quote WHERE id_Quote=:id'; $query ='DELETE FROM Quote WHERE id_Quote=:id';
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT))); $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));

@ -11,9 +11,9 @@
$this->gateway = $gate; $this->gateway = $gate;
} }
public function searchQuote(string $quote,int $numpage,string $language) : Quote{ public function searchId(int $id): Quote{
$res = $this->gateway->searchQuote($quote,$numpage,$language); $res = $this->gate->searchId($id)[0];
return new Quote($res[0]['']); return new Quote($res["q.id_quote"],$res["q.content"],$res["c.caracter"],$res["c.img_path"],$res["s.title"],$res["s.date"],$res["q.like"],$res["q.language"]);
} }
} }

@ -1,14 +1,6 @@
<?php <?php
//appele avec index.php ne pas metre si controleur fonctionnel global $twig;
require __DIR__ . '/../vendor/autoload.php';
$loader = new \Twig\Loader\FilesystemLoader('vue/templates');
$twig = new \Twig\Environment($loader, [
'cache' => false,
]);
//global $twig;
echo $twig->render('head.html.twig', array( echo $twig->render('head.html.twig', array(
'title' => "Quote", 'title' => "Quote",

@ -3,6 +3,7 @@
<a href="favorite.html"><img src="../images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false"></a> <a href="favorite.html"><img src="../images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false"></a>
<img id="theme-icon" src="../images/light.svg" alt="toggle theme" width="72px" height="37px" onmousedown="return false" onclick="toggleTheme()"> <img id="theme-icon" src="../images/light.svg" alt="toggle theme" width="72px" height="37px" onmousedown="return false" onclick="toggleTheme()">
<a href="/quiz"><img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false"></a> <a href="/quiz"><img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false"></a>
</div> </div>
<div class="logo"> <div class="logo">
<a href="/"><img src="../images/WIKIFANTASY.png" alt="Logo" width="227px" height="106px" onmousedown="return false"></a> <a href="/"><img src="../images/WIKIFANTASY.png" alt="Logo" width="227px" height="106px" onmousedown="return false"></a>

Loading…
Cancel
Save