reglement conflit

pull/21/head
kevin.modejar 5 months ago
commit 90cb24707a

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="PS-241.18034.69">
<data-source name="dbwikifantasy" uuid="351a7e7c-c4d1-4e89-bf03-667b32764270">
<database-info product="PostgreSQL" version="14.13 (Homebrew)" jdbc-version="4.2" driver-name="PostgreSQL JDBC Driver" driver-version="42.6.0" dbms="POSTGRES" exact-version="14.13" exact-driver-version="42.6">
<identifier-quote-string>&quot;</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="exact" />
<secret-storage>master_key</secret-storage>
<schema-mapping>
<introspection-scope>
<node kind="database" qname="@">
<node kind="schema" qname="@" />
</node>
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="dbwikifantasy" uuid="351a7e7c-c4d1-4e89-bf03-667b32764270">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/dbwikifantasy</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

@ -3,7 +3,9 @@
<component name="MaterialThemeProjectNewConfig">
<option name="metadata">
<MTProjectMetadataState>
<option name="userId" value="5c5a39c9:192fb929d1e:-7ffa" />
<option name="migrated" value="true" />
<option name="pristineConfig" value="false" />
<option name="userId" value="-1562669c:19061473cbf:-7ffe" />
</MTProjectMetadataState>
</option>
</component>

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/altorouter/altorouter" />
<path value="$PROJECT_DIR$/vendor/twig/twig" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.3">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -5,19 +5,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="afa12d51-331f-4dbc-a297-7289ad4e396d" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Controleur/FrontControler.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Controleur/FrontControler.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Controleur/QuizController.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Controleur/QuizController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Gateway/Connection.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Gateway/Connection.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Gateway/QuestionGateway.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Gateway/QuestionGateway.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Gateway/QuizGateway.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Gateway/QuizGateway.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Model/QuestionModel.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Model/QuestionModel.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Model/QuizQuestionModel.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Model/QuizQuestionModel.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vendor/composer/autoload_psr4.php" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/composer/autoload_psr4.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vendor/composer/autoload_static.php" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/composer/autoload_static.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vue/accueil.php" beforeDir="false" afterPath="$PROJECT_DIR$/vue/accueil.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vue/quiz.php" beforeDir="false" afterPath="$PROJECT_DIR$/vue/templates/quiz.html.twig" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -78,6 +67,9 @@
&quot;associatedIndex&quot;: 4
}</component>
<component name="ProjectId" id="2oQGGlghI0ydDNgxjOeok3kwC7m" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="1" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
@ -85,7 +77,7 @@
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master",
"git-widget-placeholder": "quizPart",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@ -121,7 +113,7 @@
<option name="presentableId" value="Default" />
<updated>1730794293135</updated>
<workItem from="1730794294713" duration="2741000" />
<workItem from="1730797544484" duration="27887000" />
<workItem from="1730797544484" duration="43165000" />
</task>
<servers />
</component>

@ -0,0 +1,95 @@
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* endQuiz.html.twig */
class __TwigTemplate_c06a302c21f2b7c0cffcc93742935dad extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
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 "<!DOCTYPE html>
<html lang=\"fr\">
<head>
<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Wiki Fantasy : Quiz</title>
<link id=\"favicon\" rel=\"icon\" href=\"../../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
<link rel=\"stylesheet\" href=\"../../public/styles/styleQuiz.css\">
<script defer src=\"../../public/script/theme-toggle.js\"></script>
</head>
<body>
<h2> ";
// line 14
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["score"] ?? null), "html", null, true);
yield " </h2>
</body>
</html>
";
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");
}
}

@ -8,10 +8,9 @@ $rep = __DIR__ . '/../';
//$dConfig['includes']= array('controleur/Validation.php');
//BD
$base = 'dbkemondejar';
$login = 'kemondejar';
$mdp = 'Ctvl-21122005';
$base = 'dbmarocher8';
$login = 'marocher8';
$mdp = 'sucepute';
//Vues
@ -21,6 +20,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';

@ -19,12 +19,9 @@ $twig = new \Twig\Environment($loader, [
'cache' => false,
]);
$twig->addGlobal('racine','/~kemondejar/WF-Website');
$twig->addGlobal('racine','/~marocher8/WF-Website');
$cont = new Controleur\FrontControler($co);
session_unset();
session_destroy();
$_SESSION = array();
?>

@ -54,6 +54,7 @@
overflow: hidden;
margin-bottom: 20px;
height: 150px;
margin-left: 5%;
}
.suggestion {

@ -16,15 +16,21 @@ Class FrontControler{
<<<<<<< HEAD
$this->listAction = ['visitor' => array('accueil','search','quote','login','signin'),
'user' => array('quiz','commentary','favorite','logout','addComment'),
'admin' => array('null')];
=======
$this->listAction = ['visitor' => array('accueil','search','quote','login','signin', 'favorite'),
'user' => array('quiz','commentary','logout'),
'admin' => array('null')];
>>>>>>> refs/remotes/origin/master
$dVueEreur = [];
$router = new \AltoRouter();
$router->setBasePath('/~kemondejar/WF-Website');
$router->setBasePath('/~marocher8/WF-Website');
$router->map('GET', '/', 'VisitorControler','accueil');
@ -41,6 +47,7 @@ Class FrontControler{
$router->map('GET|POST', '/login', 'VisitorControler','login');
$router->map('GET|POST', '/signin', 'VisitorControler','signin');
$router->map('GET|POST', '/addComment', 'UserControler','addComment');
$router->map('GET|POST', '/favorite', 'VisitorControler','favorite');
$router->map('GET|POST', '/quiz/[i:id]?', 'QuizControler','quiz');

@ -1,5 +1,4 @@
<?php
namespace Controleur;
use Entity\QuestionEntity;
@ -18,7 +17,6 @@ use Twig\Loader\FilesystemLoader;
class QuizControler
{
private int $no_question = 0;
private Connection $co;
@ -35,24 +33,21 @@ class QuizControler
public function __construct(Connection $co)
{
$this -> co = $co;
$this -> gw = new QuestionGateway($this->co);
$this -> mdl = new QuestionModel($this->gw);
$loader = new FilesystemLoader('vue/templates');
$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";
$this->no_question ++;
echo $this->no_question;
$this->showQuestion($id, $this->no_question);
$_SESSION['score'] = isset($_SESSION['score']) ? ($_SESSION['score'] + 1) : 1;
$this->continueQuiz($id, $nb_questions);
break;
default:
switch($id)
@ -61,13 +56,48 @@ class QuizControler
// page erreur
break;
default:
$this->showQuestion($id, $this->no_question);
$_SESSION['score'] = $_SESSION['score'] ?? 0;
$this->showQuestion($id, $_SESSION['no_question'] ?? 0);
break;
}
}
}
/**
* @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;
@ -108,37 +138,23 @@ class QuizControler
* @throws SyntaxError
* @throws LoaderError
*/
public function showQuestion(int $id, int $no) : void
public function showQuestion(int $id, int $num) : void
{
global $twig;
echo $num;
echo " : ", $_SESSION['score'];
$q = $this->GetQuestion($id);
$question = $q[$no];
$question = $q[$num] ?? $q[0];
$idquestion = $question->getIdQuestion();
echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]);
}
public function getNumberOfQuestion() : int
public function getNumberOfQuestion(int $id) : int
{
$gw = new QuizGateway($this->co);
$mdl = new QuizModel($gw);
return 0;
return $mdl->getQuiz($id)->getNbQuestions();
}
}
/*
<php
foreach ($news as $new)
{
<h2 href=<?= $new->getUrl() ?>> <?= $new->getTitle() ?> </h2>
}
?>
*/
}

@ -17,7 +17,21 @@ Class UserControler{
require_once $vues['quiz'];
}
<<<<<<< HEAD
public function addComment(){
echo $_POST['content'];
=======
public function favorits() {
global $vues;
$user = $_SESSION['username'];
$idUser = $this->userGateway->getIdUser($user);
$suggestions = $this->favoritsGateway->getFavorits(0, 'fr');
require_once $vues['favorits'];
>>>>>>> refs/remotes/origin/master
}
}

@ -1,28 +1,39 @@
<?php
namespace Controleur;
use Model\QuoteModel;
use Model\CommentaryModel;
use Gateway\Connection;
use Gateway\QuoteGateway;
use Gateway\CommentaryGateway;
use Gateway\AccueilGateway;
Class VisitorControler{
class VisitorControler {
private QuoteModel $qMod;
private CommentaryModel $cMod;
private AccueilGateway $accueilGateway;
public function __construct(){
global $co;
$this->qMod = new QuoteModel(new QuoteGateway($co));
$this->cMod = new CommentaryModel(new CommentaryGateway($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'];
$q = $this->qMod->searchId($id);
@ -30,17 +41,18 @@ Class VisitorControler{
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'];
}
}

@ -0,0 +1,49 @@
<?php
namespace Gateway;
use PDO;
class AccueilGateway {
private Connection $con;
public function __construct(Connection $con) {
$this->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();
}
}

@ -0,0 +1,31 @@
<?php
namespace Gateway;
use PDO;
class AccueilGateway {
private Connection $con;
public function __construct(Connection $con) {
$this->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();
}
}

@ -26,6 +26,7 @@ Class UserGateway{
return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
}
public function getFavorite(string $id):array{
//obtention favoris d'un user
@ -35,7 +36,6 @@ Class UserGateway{
return $result;
}
//obtenir les information d'un user
public function findDataUser(int $id):array{
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
@ -160,6 +160,13 @@ Class UserGateway{
$con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT), ':newPassWd'=> array($passwordEncrypted, PDO::PARAM_STR)));
}
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;
}
}

@ -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;

@ -1,89 +1,40 @@
<?php
global $twig;
global $twig;
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');
echo $twig->render('head.html.twig', [
'title' => "Accueil",
'style' => "public/styles/styleAccueil.css",
]);
?>
<?php
$file = 'citation.txt';
$citations = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$citationDuJour = null;
$suggestions = [];
foreach ($citations as $citation) {
$parts = explode(';', $citation);
if (strpos(trim($parts[0]), 'µ') === 0) {
$citationDuJour = $parts;
} else {
$suggestions[] = $parts;
}
}
shuffle($suggestions);
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
$suggestions = array_filter($suggestions, function($suggestion) use ($citationDuJour) {
return count($suggestion) == 5 && !($suggestion[0] === trim($citationDuJour[1]));
});
$suggestions = array_slice($suggestions, 0, 10);
echo "<div class='citations-section'>";
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 "<h2>Citation du jour</h2>";
echo "<div class='citation-container citation-du-jour'>";
echo "<img src='$imagePath' alt='$movie' class='citation-image'>";
echo "<div class='text-content'>";
echo "<p class='quote'>\"$quote\"</p>";
echo "<p class='movie'>- $movie</p>";
echo "<p class='character'>Personnage : $character</p>";
echo "<p class='year'>Année : $year</p>";
echo "</div>";
echo "</div>";
// 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 "<p class='error'>Aucune citation du jour n'a été trouvée.</p>";
}
if (!empty($suggestions)) {
echo "<h2>Suggestions</h2>";
echo "<div class='suggestions-container'>";
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 "<div class='citation-container suggestion'>";
echo "<img src='$imagePath' alt='$movie' class='citation-image'>";
echo "<div class='text-content'>";
echo "<p class='quote'>\"$quote\"</p>";
echo "<p class='movie'>- $movie</p>";
echo "<p class='character'>Personnage : $character</p>";
echo "<p class='year'>Année : $year</p>";
echo "</div>";
echo "</div>";
}
echo "</div>";
// Affichage des suggestions de citations
echo "<h2>Suggestions</h2>";
echo "<div class='suggestions-container'>";
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 "</div>";
?>
</body>
</html>
echo "</div>";
?>

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wiki Fantasy : Favoris</title>
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
<link rel="stylesheet" href="../public/styles/style.css">
<script defer src="../public/script/theme-toggle.js"></script>
<script src="../script/auth-check.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<div class="nav">
<img src="../images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false">
<img id="theme-icon" src="../images/light.svg" alt="toggle theme" width="72px" height="37px" onmousedown="return false" onclick="toggleTheme()">
<a href="quiz.html"><img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false"></a>
</div>
<div class="logo">
<a href="accueil.html"><img src="../images/WIKIFANTASY.png" alt="Logo" width="227px" height="106px" onmousedown="return false"></a>
</div>
<div class="user">
<img src="../images/user_dark.png" alt="user" width="70px" height="70px" onmousedown="return false">
</div>
</div>
</div>
<h1>Wiki Fantasy</h1>
</body>
</html>

@ -0,0 +1,25 @@
<?php
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');
echo "<h2>Favorits</h2>";
echo "<div class='suggestions-container'>";
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 "</div>";
?>

@ -1,6 +1,6 @@
<div class="header">
<div class="nav">
<a href="favorite.html"><img src="images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false"></a>
<a href="{{ racine }}/favorite"><img src="images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false"></a>
<img id="theme-icon" src="images/dark.svg" alt="toggle theme" width="72px" height="37px" onmousedown="return false" onclick="toggleTheme()">
<a href="{{ racine }}/quiz"><img src="images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false"></a>

@ -0,0 +1,10 @@
<h2>Citation du jour</h2>
<div class="citation-container citation-du-jour">
<img src="{{ imagePath }}" alt="{{ movie }}" class="citation-image">
<div class="text-content">
<p class="quote">"{{ quote }}"</p>
<p class="movie">- {{ movie }}</p>
<p class="character">Personnage : {{ character }}</p>
<p class="year">Année : {{ year }}</p>
</div>
</div>

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wiki Fantasy : Quiz</title>
<link id="favicon" rel="icon" href="../../images/iconeSombre.ico"> <!-- Par défaut sombre -->
<link rel="stylesheet" href="../../public/styles/styleQuiz.css">
<script defer src="../../public/script/theme-toggle.js"></script>
</head>
<body>
<h1 style="color: #b7c8ff"> {{ score }} </h1>
<h1> {{ nextquiz }} </h1>
zeze
</body>
</html>

@ -0,0 +1,9 @@
<div class="citation-container suggestion">
<img src="{{ imagePath }}" alt="{{ movie }}" class="citation-image">
<div class="text-content">
<p class="quote">"{{ quote }}"</p>
<p class="movie">- {{ movie }}</p>
<p class="character">Personnage : {{ character }}</p>
<p class="year">Année : {{ year }}</p>
</div>
</div>

@ -9,7 +9,7 @@
<script defer src="../../public/script/theme-toggle.js"></script>
<script>
// Timer pour 5 minutes
var timeLeft = 300;
var timeLeft = 10;
function countdown() {
var timerDisplay = document.getElementById("timer");
if (timeLeft <= 0) {
@ -24,25 +24,12 @@
</script>
</head>
<body>
<div class="header">
<div class="nav">
<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 src="../../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false">
</div>
<div class="logo">
<img src="../../images/WIKIFANTASY.png" alt="Logo" width="227px" height="106px" onmousedown="return false">
</div>
<div class="user">
<img src="../../images/user_dark.png" alt="user" width="70px" height="70px" onmousedown="return false">
</div>
</div>
{{ include "bandeau.html.twig" }}
<h1>▶ Quiz ◀</h1>
<div class="quiz">
<h2> {{ question.question }} </h2>
<a id="timer"> 300 seconds left .. </a>
<a id="timer"> 10 seconds left .. </a>
<form id="quizForm" method="POST">
<div class="answers">
@ -59,7 +46,7 @@
{{ question.answerd }}
</button>
</div>
<input type="hidden" name="action" value="canswer">
<input type="hidden" name="action" value="">
</form>
</div>
</body>

@ -0,0 +1,9 @@
<div class="citation-container suggestion">
<img src="{{ imagePath }}" alt="{{ movie }}" class="citation-image">
<div class="text-content">
<p class="quote">"{{ quote }}"</p>
<p class="movie">- {{ movie }}</p>
<p class="character">Personnage : {{ character }}</p>
<p class="year">Année : {{ year }}</p>
</div>
</div>
Loading…
Cancel
Save