parent
efb5ae6287
commit
5334bf79b5
@ -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>"</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
@ -1 +0,0 @@
|
|||||||
#n:dbwikifantasy
|
|
@ -1,2 +0,0 @@
|
|||||||
#n:public
|
|
||||||
!<md> [676242, 0, null, null, -2147483648, -2147483648]
|
|
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MaterialThemeProjectNewConfig">
|
|
||||||
<option name="metadata">
|
|
||||||
<MTProjectMetadataState>
|
|
||||||
<option name="userId" value="5c5a39c9:192fb929d1e:-7ffa" />
|
|
||||||
</MTProjectMetadataState>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -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>
|
|
@ -1,131 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="AutoImportSettings">
|
|
||||||
<option name="autoReloadType" value="SELECTIVE" />
|
|
||||||
</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$/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" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="ComposerSettings" synchronizationState="SYNCHRONIZE">
|
|
||||||
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
|
||||||
<execution />
|
|
||||||
</component>
|
|
||||||
<component name="Git.Settings">
|
|
||||||
<excluded-from-favorite>
|
|
||||||
<branch-storage>
|
|
||||||
<map>
|
|
||||||
<entry type="LOCAL">
|
|
||||||
<value>
|
|
||||||
<list>
|
|
||||||
<branch-info repo="$PROJECT_DIR$" source="master" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</branch-storage>
|
|
||||||
</excluded-from-favorite>
|
|
||||||
<favorite-branches>
|
|
||||||
<branch-storage>
|
|
||||||
<map>
|
|
||||||
<entry type="LOCAL">
|
|
||||||
<value>
|
|
||||||
<list>
|
|
||||||
<branch-info repo="$PROJECT_DIR$" source="reorganisation" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</branch-storage>
|
|
||||||
</favorite-branches>
|
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
|
||||||
<map>
|
|
||||||
<entry key="$PROJECT_DIR$" value="master" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
||||||
</component>
|
|
||||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="/opt/homebrew/Cellar/php/8.3.8/bin/php">
|
|
||||||
<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="ProjectColorInfo">{
|
|
||||||
"customColor": "",
|
|
||||||
"associatedIndex": 4
|
|
||||||
}</component>
|
|
||||||
<component name="ProjectId" id="2oQGGlghI0ydDNgxjOeok3kwC7m" />
|
|
||||||
<component name="ProjectViewState">
|
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
|
||||||
<option name="showLibraryContents" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}]]></component>
|
|
||||||
<component name="RecentsManager">
|
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
|
||||||
<recent name="$PROJECT_DIR$/vue/templates" />
|
|
||||||
</key>
|
|
||||||
</component>
|
|
||||||
<component name="SharedIndexes">
|
|
||||||
<attachedChunks>
|
|
||||||
<set>
|
|
||||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-PS-241.18034.69" />
|
|
||||||
<option value="bundled-php-predefined-ba97393d7c68-48a1a656d44e-com.jetbrains.php.sharedIndexes-PS-241.18034.69" />
|
|
||||||
</set>
|
|
||||||
</attachedChunks>
|
|
||||||
</component>
|
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
||||||
<component name="TaskManager">
|
|
||||||
<task active="true" id="Default" summary="Default task">
|
|
||||||
<changelist id="afa12d51-331f-4dbc-a297-7289ad4e396d" name="Changes" comment="" />
|
|
||||||
<created>1730794293135</created>
|
|
||||||
<option name="number" value="Default" />
|
|
||||||
<option name="presentableId" value="Default" />
|
|
||||||
<updated>1730794293135</updated>
|
|
||||||
<workItem from="1730794294713" duration="2741000" />
|
|
||||||
<workItem from="1730797544484" duration="27887000" />
|
|
||||||
</task>
|
|
||||||
<servers />
|
|
||||||
</component>
|
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
|
||||||
<option name="version" value="3" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,40 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Controleur;
|
namespace Controleur;
|
||||||
|
|
||||||
use Model\QuoteModel;
|
use Model\QuoteModel;
|
||||||
use Gateway\Connection;
|
use Gateway\Connection;
|
||||||
use Gateway\QuoteGateway;
|
use Gateway\QuoteGateway;
|
||||||
|
use Gateway\AccueilGateway;
|
||||||
|
|
||||||
Class VisitorControler{
|
class VisitorControler {
|
||||||
|
|
||||||
private QuoteModel $qMod;
|
private QuoteModel $qMod;
|
||||||
|
private AccueilGateway $accueilGateway;
|
||||||
public function __construct(){
|
|
||||||
|
public function __construct() {
|
||||||
global $co;
|
global $co;
|
||||||
$this->qMod = new QuoteModel(new QuoteGateway($co));
|
$this->qMod = new QuoteModel(new QuoteGateway($co));
|
||||||
|
$this->accueilGateway = new AccueilGateway($co);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function accueil(){
|
public function accueil() {
|
||||||
global $vues;
|
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'];
|
require_once $vues['accueil'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function quote(array $arg){
|
public function quote(array $arg) {
|
||||||
global $vues;
|
global $vues;
|
||||||
$id=$arg['idQuote'] ?? 1;
|
$id = $arg['idQuote'] ?? 1;
|
||||||
$q = $this->qMod->searchId($id);
|
$q = $this->qMod->searchId($id);
|
||||||
//echo "{$id}";
|
|
||||||
require_once $vues['quote'];
|
require_once $vues['quote'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login(){
|
public function login() {
|
||||||
|
|
||||||
global $vues;
|
global $vues;
|
||||||
require_once $vues['login'];
|
require_once $vues['login'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function signin(){
|
public function signin() {
|
||||||
|
|
||||||
global $vues;
|
global $vues;
|
||||||
require_once $vues['signin'];
|
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();
|
||||||
|
}
|
||||||
|
}
|
@ -1,88 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
echo $twig->render('head.html.twig', array(
|
// Rendu de l'en-tête
|
||||||
'title' => "Accueil",
|
echo $twig->render('head.html.twig', [
|
||||||
'style' => "public/styles/styleAccueil.css",
|
'title' => "Accueil",
|
||||||
));
|
'style' => "public/styles/styleAccueil.css",
|
||||||
|
]);
|
||||||
echo $twig->render('bandeau.html.twig');
|
|
||||||
|
// Rendu du bandeau
|
||||||
?>
|
echo $twig->render('bandeau.html.twig');
|
||||||
<?php
|
|
||||||
|
// Vérification de la présence de la "Citation du jour"
|
||||||
$file = 'citation.txt';
|
if (!empty($citationDuJour)) {
|
||||||
$citations = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
echo $twig->render('citation_du_jour.html.twig', [
|
||||||
|
'quote' => $citationDuJour['content'],
|
||||||
$citationDuJour = null;
|
'movie' => $citationDuJour['title'],
|
||||||
$suggestions = [];
|
'character' => $citationDuJour['caracter'],
|
||||||
|
'year' => $citationDuJour['dates'],
|
||||||
|
'imagePath' => $citationDuJour['imgpath']
|
||||||
foreach ($citations as $citation) {
|
]);
|
||||||
$parts = explode(';', $citation);
|
|
||||||
|
|
||||||
if (strpos(trim($parts[0]), 'µ') === 0) {
|
|
||||||
$citationDuJour = $parts;
|
|
||||||
} else {
|
|
||||||
$suggestions[] = $parts;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shuffle($suggestions);
|
|
||||||
|
|
||||||
$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>";
|
|
||||||
} else {
|
} else {
|
||||||
echo "<p class='error'>Aucune citation du jour n'a été trouvée.</p>";
|
echo "<p class='error'>Aucune citation du jour n'a été trouvée.</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($suggestions)) {
|
// Affichage des suggestions de citations
|
||||||
echo "<h2>Suggestions</h2>";
|
echo "<h2>Suggestions</h2>";
|
||||||
echo "<div class='suggestions-container'>";
|
echo "<div class='suggestions-container'>";
|
||||||
foreach ($suggestions as $suggestion) {
|
foreach ($suggestions as $suggestion) {
|
||||||
$quote = htmlspecialchars(trim($suggestion[0]));
|
echo $twig->render('suggestion.html.twig', [
|
||||||
$movie = htmlspecialchars(trim($suggestion[1]));
|
'quote' => $suggestion['content'],
|
||||||
$character = htmlspecialchars(trim($suggestion[2]));
|
'movie' => $suggestion['title'],
|
||||||
$year = htmlspecialchars(trim($suggestion[3]));
|
'character' => $suggestion['caracter'],
|
||||||
$imagePath = htmlspecialchars(trim($suggestion[4]));
|
'year' => $suggestion['dates'],
|
||||||
|
'imagePath' => $suggestion['imgpath']
|
||||||
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>";
|
|
||||||
}
|
}
|
||||||
|
echo "</div>";
|
||||||
echo "</div>";
|
?>
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -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>";
|
||||||
|
?>
|
@ -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,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>
|
@ -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…
Reference in new issue