Clean Master for Merge
continuous-integration/drone/push Build is failing
Details
@ -1,7 +0,0 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"stdio.h": "c",
|
||||
"stdbool.h": "c",
|
||||
"tp2.h": "c"
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
require_once(__DIR__ . '/../models/CitationModel.php');
|
||||
require_once(__DIR__ . '/../views/CitationView.php');
|
||||
require_once(__DIR__ . '/../views/HeaderView.php');
|
||||
|
||||
class CitationController {
|
||||
|
||||
public function index() {
|
||||
// Gestion du thème
|
||||
if (isset($_POST['theme'])) {
|
||||
$theme = $_POST['theme'];
|
||||
setcookie('theme', $theme, time() + (30 * 24 * 60 * 60), "/");
|
||||
} elseif (isset($_COOKIE['theme'])) {
|
||||
$theme = $_COOKIE['theme'];
|
||||
} else {
|
||||
$theme = 'dark-mode';
|
||||
}
|
||||
|
||||
// Récupérer les données via le modèle
|
||||
$model = new CitationModel();
|
||||
$citationDuJour = $model->getCitationDuJour();
|
||||
$suggestions = $model->getSuggestions($citationDuJour);
|
||||
|
||||
// Afficher la page via la vue
|
||||
HeaderView::display($theme);
|
||||
CitationView::display($citationDuJour, $suggestions);
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 28 KiB |
@ -1,29 +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</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<script defer src="../script/theme-toggle.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()">
|
||||
<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>
|
||||
</div>
|
||||
<h1>Wiki Fantasy</h1>
|
||||
</body>
|
||||
</html>
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
class CitationModel {
|
||||
|
||||
private $filePath = __DIR__ . '/../citation.txt';
|
||||
|
||||
// Fonction pour obtenir la citation du jour
|
||||
public function getCitationDuJour() {
|
||||
if (!file_exists($this->filePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$citations = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach ($citations as $citation) {
|
||||
$parts = explode(';', $citation);
|
||||
// Vérifier si la citation commence par 'µ'
|
||||
if (strpos(trim($parts[0]), 'µ') === 0) {
|
||||
return $parts; // Retourne la citation du jour
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fonction pour obtenir les suggestions de citations
|
||||
public function getSuggestions($citationDuJour) {
|
||||
if (!file_exists($this->filePath)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$citations = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
$suggestions = [];
|
||||
|
||||
foreach ($citations as $citation) {
|
||||
$parts = explode(';', $citation);
|
||||
// On ajoute la citation si elle n'est pas la citation du jour
|
||||
if (!($parts[0] === $citationDuJour[0])) {
|
||||
$suggestions[] = $parts;
|
||||
}
|
||||
}
|
||||
|
||||
// Limiter à 10 suggestions
|
||||
shuffle($suggestions);
|
||||
return array_slice($suggestions, 0, 10);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
class ArtisteGateway {
|
||||
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function findByName($name)
|
||||
{
|
||||
$query = "SELECT * FROM Artiste WHERE nom = :nom";
|
||||
|
||||
$this -> co -> executeQuery($query, array('nom' => array($name, PDO::PARAM_STR)));
|
||||
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
foreach ($res as $row)
|
||||
{
|
||||
$tab[] = new Artiste(
|
||||
$row['id'],
|
||||
$row['nom'],
|
||||
$row['prenom'],
|
||||
$row['nb'],
|
||||
);
|
||||
}
|
||||
return $tab;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach ($listNews as $news)
|
||||
{
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
require_once('../../controllers/CitationController.php');
|
||||
|
||||
$controller = new CitationController();
|
||||
$controller->index();
|
||||
?>
|
@ -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="../styles/style.css">
|
||||
<script defer src="../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>
|
@ -1,49 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="../styles/styleLogin.css" media="screen">
|
||||
<title>Wiki Fantasy : Connexion</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
<script defer src="../script/theme-toggle.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()">
|
||||
<img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false">
|
||||
</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>▶ Connexion ◀</h1>
|
||||
|
||||
<div class="login">
|
||||
<p> <strong>Identifiant *</strong></p>
|
||||
<input type="text" class="connexion" name="name" required />
|
||||
|
||||
<p> <strong> Mot de passe *</strong></p>
|
||||
<input type="password" class="connexion" name="passwd" required />
|
||||
|
||||
<div class="createAccount">
|
||||
<p class="createAccount">Vous n'avez pas de compte?</p>
|
||||
<a href="signin.html" class="createAccount">S'incrire</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="buttonSudmiteDiv">
|
||||
<button class="buttonSudmite">Connexion</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,53 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="../styles/styleProfil.css" media="screen">
|
||||
<title>Wiki Fantasy : Profil</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
<script defer src="../script/theme-toggle.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()">
|
||||
<img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false">
|
||||
</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>
|
||||
</div>
|
||||
|
||||
<div class="login">
|
||||
<h1>▶ Profil ◀</h1>
|
||||
|
||||
|
||||
<img src="../images/imageProfil.png" class="imageProfil" onmousedown="return false"/>
|
||||
|
||||
<p class="nameProfil"> <strong> Tyler De Dordogne</strong></p>
|
||||
|
||||
<p class="nameProfil"> <strong> user@wikiFantasy.com</strong></p>
|
||||
<p class="nameProfil"> <strong> *********</strong></p>
|
||||
|
||||
<div class="languageDiv">
|
||||
<p class="languageTitle">Language :</p>
|
||||
</div>
|
||||
<img class="languageImage" src="../images/drapeauFrance.png" onmousedown="return false"/>
|
||||
|
||||
<div class="createQuote">
|
||||
<a href="rien" class="createQuote">Ajouter une citation</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="buttonSudmiteDiv">
|
||||
<button class="buttonSudmite">Se déconnecter</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,74 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="../styles/styleProfil.css" media="screen">
|
||||
<title>Wiki Fantasy : Profil</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
<script defer src="../script/theme-toggle.js"></script>
|
||||
<script defer src="../script/changeData.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()">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="login">
|
||||
<h1>▶ Profil ◀</h1>
|
||||
|
||||
<?php
|
||||
include ('../script/user.php');
|
||||
|
||||
echo "<img src='{$u->img}' class='imageProfil' onmousedown='return false'/>";
|
||||
|
||||
// Nom d'utilisateur
|
||||
echo "<p id='username' class='infoProfil'>
|
||||
<strong>{$u->username}
|
||||
<img class='imgModify' src='../../images/modify.svg' onclick='editFieldUsername(\"username\")'/>
|
||||
</strong>
|
||||
</p>";
|
||||
|
||||
// Email
|
||||
echo "<p id='email' class='infoProfil'>
|
||||
<strong>{$u->email}
|
||||
<img class='imgModify' src='../../images/modify.svg' onclick='editFieldEmail(\"email\")'/>
|
||||
</strong>
|
||||
</p>";
|
||||
|
||||
// Mot de passe
|
||||
echo "<p id='passwd' class='infoProfil'>
|
||||
<strong>{$u->hidenPasswd}
|
||||
<img class='imgModify' src='../../images/modify.svg' onclick='editFieldPassWd(\"passwd\")'/>
|
||||
</strong>
|
||||
</p>";
|
||||
?>
|
||||
|
||||
<div class="languageDiv">
|
||||
<p class="languageTitle">Language :</p>
|
||||
</div>
|
||||
<img class="languageImage" src="../../images/drapeauFrance.png" onmousedown="return false"/>
|
||||
|
||||
<div class="createQuote">
|
||||
<a href="rien" class="createQuote">Ajouter une citation</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="buttonSudmiteDiv">
|
||||
<button class="buttonSudmite">Se déconnecter</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,61 +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 : Quiz</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link rel="stylesheet" href="../styles/styleQuiz.css">
|
||||
<script defer src="../script/theme-toggle.js"></script>
|
||||
<script>
|
||||
// Timer pour 5 minutes
|
||||
|
||||
var timeLeft = 300;
|
||||
function countdown() {
|
||||
var timerDisplay = document.getElementById("timer");
|
||||
if (timeLeft <= 0) {
|
||||
document.getElementById("quizForm").submit();
|
||||
} else {
|
||||
timerDisplay.innerHTML = timeLeft + " seconds left";
|
||||
timeLeft -= 1;
|
||||
setTimeout(countdown, 1000);
|
||||
}
|
||||
}
|
||||
window.onload = countdown;
|
||||
</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">
|
||||
<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>
|
||||
|
||||
<h1>▶ Quiz ◀</h1>
|
||||
|
||||
<div class="quiz">
|
||||
<h2>Question 1</h2>
|
||||
<p>“Tu es un sorcier Harry”</p>
|
||||
|
||||
<!-- Grille de réponses (2 par ligne) -->
|
||||
<div class="answers">
|
||||
<button class="answer">Fight Club</button>
|
||||
<button class="answer">Jurassic World</button>
|
||||
<button class="answer">La 7ème compagnie</button>
|
||||
<button class="answer">Harry Potter à l'école des sorciers</button>
|
||||
</div>
|
||||
|
||||
<div class="submit-button">
|
||||
<button class="buttonSudmite" type="submit">Confirmer</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// Configuration de la base de données
|
||||
$host = 'localhost';
|
||||
$db = 'dbwikifantasy'; // Remplace par le nom de ta base de données
|
||||
$user = 'kiem'; // Remplace par ton nom d'utilisateur
|
||||
|
||||
try {
|
||||
// Créer une connexion à la base de données avec PDO
|
||||
$conn = new PDO("pgsql:host=$host;dbname=$db", $user);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// Requête pour récupérer une question du quiz
|
||||
$sql = "SELECT * FROM question WHERE id_question = 1"; // Adapte cette requête selon ta table de questions
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
// Récupère toutes les questions
|
||||
$question = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "Erreur de connexion : " . $e->getMessage();
|
||||
}
|
||||
|
||||
// Ferme la connexion (optionnel avec PDO)
|
||||
$conn = null;
|
||||
?>
|
||||
|
||||
<!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="../styles/styleQuiz.css">
|
||||
<script defer src="../script/theme-toggle.js"></script>
|
||||
<script>
|
||||
// Timer pour 5 minutes
|
||||
var timeLeft = 300;
|
||||
function countdown() {
|
||||
var timerDisplay = document.getElementById("timer");
|
||||
if (timeLeft <= 0) {
|
||||
document.getElementById("quizForm").submit();
|
||||
} else {
|
||||
timerDisplay.innerHTML = timeLeft + " seconds left";
|
||||
timeLeft -= 1;
|
||||
setTimeout(countdown, 1000);
|
||||
}
|
||||
}
|
||||
window.onload = countdown;
|
||||
</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>
|
||||
|
||||
<h1>▶ Quiz ◀</h1>
|
||||
<div class="quiz">
|
||||
<h2>Question 1</h2>
|
||||
<h3><?=$question[0]['question']?></h3>
|
||||
<a id="timer"> 300 seconds left .. </a>
|
||||
|
||||
<form id="quizForm" method="POST" action="submit_quiz.php">
|
||||
<div class="answers">
|
||||
<button class="answer" type="submit" name="answer" value="A">
|
||||
<?=$question[0]['answera']?>
|
||||
</button>
|
||||
<button class="answer" type="submit" name="answer" value="B">
|
||||
<?=$question[0]['answerb']?>
|
||||
</button>
|
||||
<button class="answer" type="submit" name="answer" value="C">
|
||||
<?=$question[0]['answerc']?>
|
||||
</button>
|
||||
<button class="answer" type="submit" name="answer" value="D">
|
||||
<?=$question[0]['answerd']?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="submit-button">
|
||||
<button class="buttonSudmite" type="submit">Confirmer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,211 +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 : Quizz</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap');
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1, body.dark-mode h2, body.dark-mode p {
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.dark-mode .quizz {
|
||||
background-color: black;
|
||||
width: 50%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
body.dark-mode .answer {
|
||||
background-color: #1b0048;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
width: 45%;
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .answer:hover {
|
||||
background-color: #6100ff;
|
||||
}
|
||||
|
||||
body.dark-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
body.dark-mode .buttonSudmite {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1, body.light-mode h2, body.light-mode p {
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.light-mode .quizz {
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
body.light-mode .answer {
|
||||
background-color: #fff1f1;
|
||||
color: black;
|
||||
border: 1px solid black;
|
||||
border-radius: 25px;
|
||||
width: 45%;
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .answer:hover {
|
||||
background-color: #c7f6c4;
|
||||
}
|
||||
|
||||
body.light-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
body.light-mode .buttonSudmite {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.user img {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="dark-mode"> <!-- Ajouter ici la classe pour le mode sombre ou clair -->
|
||||
|
||||
<!-- Bandeau du haut avec les images -->
|
||||
<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()">
|
||||
<img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false">
|
||||
</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>
|
||||
|
||||
<!-- Section du quizz -->
|
||||
<h1>▶ Quizz ◀</h1>
|
||||
|
||||
<div class="quizz">
|
||||
<h2>Question 1</h2>
|
||||
<p>“Tu es un sorcier Harry”</p>
|
||||
|
||||
<!-- Grille de réponses (2 par ligne) -->
|
||||
<div class="answers">
|
||||
<button class="answer">Fight Club</button>
|
||||
<button class="answer">Jurassic World</button>
|
||||
<button class="answer">La 7ème compagnie</button>
|
||||
<button class="answer">Harry Potter à l'école des sorciers</button>
|
||||
</div>
|
||||
|
||||
<div class="submit-button">
|
||||
<button class="buttonSudmite">Confirmer</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const body = document.body;
|
||||
body.classList.toggle("dark-mode");
|
||||
body.classList.toggle("light-mode");
|
||||
|
||||
const themeIcon = document.getElementById("theme-icon");
|
||||
if (body.classList.contains("dark-mode")) {
|
||||
themeIcon.src = "../images/light.svg";
|
||||
} else {
|
||||
themeIcon.src = "../images/dark.svg";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="../styles/styleQuote.css" media="screen">
|
||||
<title>Wiki Fantasy : Citations</title>
|
||||
<link rel="icon" href="../images/Logo.ico">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,63 +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</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<script defer src="../script/theme-toggle.js"></script>
|
||||
<script src="../script/auth-check.js"></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()">
|
||||
<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">
|
||||
<a href="profil.html"><img src="../images/user_dark.png" alt="user" width="70px" height="70px" onmousedown="return false"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div>
|
||||
<input class="searchBarre" type="text" value="" placeholder="Rechercher"/>
|
||||
<div>
|
||||
<?php
|
||||
|
||||
#session_start();
|
||||
#require_once('../bd/connexionDB.php');
|
||||
#
|
||||
#if(isset($_GET['user'])){
|
||||
#$user = (String) trim($_GET['user']);
|
||||
#
|
||||
#$req = $DB->query("SELECT *
|
||||
# FROM utilisateur
|
||||
# WHERE nom LIKE ?
|
||||
# LIMIT 10",
|
||||
# array("$user%"));
|
||||
#
|
||||
#$req = $req->fetchALL();
|
||||
$req=array(array('nom'=>'nom1','prenom'=>'prenom1'),array('nom'=>'nom2','prenom'=>'prenom2'),array('nom'=>'nom3','prenom'=>'prenom3'));
|
||||
|
||||
foreach($req as $r){
|
||||
?>
|
||||
<div style="margin-top: 20px 0; border-bottom: 2px solid #ccc"><?= $r['nom'] . " " . $r['prenom'] ?></div><?php
|
||||
}
|
||||
|
||||
#}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,62 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="../styles/styleSignin.css" media="screen">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
|
||||
<script defer src="../script/theme-toggle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<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()">
|
||||
<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>▶ S'inscrire ◀</h1>
|
||||
<form action="../script/signin.php" method="post">
|
||||
<div class="signin">
|
||||
<div class="DivId">
|
||||
<p>Identifiant *</p>
|
||||
<input type="text" class="champ" id="name" name="name" required/>
|
||||
</div>
|
||||
|
||||
<div class="DivEmail">
|
||||
<p>Email *</p>
|
||||
<input type="email" class="champ" id="email" name="email" required/>
|
||||
</div>
|
||||
|
||||
<div class="mdp">
|
||||
<p>Mot de passe *</p>
|
||||
<input type="password" class="champ" id="pswd" name="pswd" required/>
|
||||
</div>
|
||||
|
||||
<div class="confmdp">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type="password" class="champ" id="confpswd" name="confpswd" required/>
|
||||
</div>
|
||||
|
||||
<div class="imgprof">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="confirmer">
|
||||
<input type="submit" class="btn" value="Inscription" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
class Connection extends PDO {
|
||||
|
||||
private $stmt;
|
||||
|
||||
public function __construct(string $dsn, string $username, string $password) {
|
||||
parent::__construct($dsn,$username,$password);
|
||||
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
|
||||
|
||||
/** * @param string $query
|
||||
* @param array $parameters *
|
||||
* @return bool Returns `true` on success, `false` otherwise
|
||||
*/
|
||||
|
||||
public function executeQuery(string $query, array $parameters = []) : bool{
|
||||
$this->stmt = parent::prepare($query);
|
||||
foreach ($parameters as $name => $value) {
|
||||
$this->stmt->bindValue($name, $value[0], $value[1]);
|
||||
}
|
||||
|
||||
return $this->stmt->execute();
|
||||
}
|
||||
|
||||
public function getResults() : array {
|
||||
return $this->stmt->fetchall();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,27 +0,0 @@
|
||||
|
||||
<?php
|
||||
|
||||
#session_start();
|
||||
#require_once('../bd/connexionDB.php');
|
||||
#
|
||||
#if(isset($_GET['user'])){
|
||||
#$user = (String) trim($_GET['user']);
|
||||
#
|
||||
#$req = $DB->query("SELECT *
|
||||
# FROM utilisateur
|
||||
# WHERE nom LIKE ?
|
||||
# LIMIT 10",
|
||||
# array("$user%"));
|
||||
#
|
||||
#$req = $req->fetchALL();
|
||||
$req=query(array('nom'=>'nom1','prenom'=>'prenom1'),array('nom'=>'nom2','prenom'=>'prenom2'),array('nom'=>'nom3','prenom'=>'prenom3'));
|
||||
$req = $req->fetchALL();
|
||||
|
||||
foreach($req as $r){
|
||||
?>
|
||||
<div style="margin-top: 20px 0; border-bottom: 2px solid #ccc"><?= $r['nom'] . " " . $r['prenom'] ?></div><?php
|
||||
}
|
||||
|
||||
#}
|
||||
|
||||
?>
|
@ -1,39 +0,0 @@
|
||||
// auth-check.js
|
||||
|
||||
// Vérifier si l'utilisateur est connecté
|
||||
function isUserLoggedIn() {
|
||||
// Vérifiez si 'isLoggedIn' est défini dans le localStorage ou par un cookie
|
||||
return localStorage.getItem('isLoggedIn') === 'true';
|
||||
}
|
||||
|
||||
// Redirection des liens en fonction de l'état de connexion
|
||||
function setupLinks() {
|
||||
const favoriteLink = document.querySelector('a[href="favorite.html"]');
|
||||
const quizLink = document.querySelector('a[href="quiz.html"]');
|
||||
const userIcon = document.querySelector('.user img');
|
||||
|
||||
if (!isUserLoggedIn()) {
|
||||
// Si l'utilisateur n'est pas connecté, rediriger vers la page de connexion
|
||||
if (favoriteLink) favoriteLink.href = "login.html";
|
||||
if (quizLink) quizLink.href = "login.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "login.html";
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Si l'utilisateur est connecté, définir les liens vers les pages dédiées
|
||||
if (favoriteLink) favoriteLink.href = "favorite.html";
|
||||
if (quizLink) quizLink.href = "quiz.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "user-profile.html";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialiser les liens lors du chargement de la page
|
||||
document.addEventListener('DOMContentLoaded', setupLinks);
|
@ -1,169 +0,0 @@
|
||||
|
||||
function editFieldUsername(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'text';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldUsername("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour le username
|
||||
function saveFieldUsername(id, newValue) {
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../../images/modify.svg" onclick="editFieldUsername(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldEmail(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'email';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldEmail("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour l'email
|
||||
function saveFieldEmail(id, newValue) {
|
||||
if (id === 'email') {
|
||||
if (!validateEmail(newValue)) {
|
||||
alert('Adresse email invalide. Veuillez entrer un email valide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si l'email n'est pas valide
|
||||
}
|
||||
}
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id); // Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../../images/modify.svg" onclick="editFieldEmail(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Email valide
|
||||
function validateEmail(email) {
|
||||
var re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;// Regex pour vérifier le format de l'email
|
||||
return re.test(String(email).toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldPassWd(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
pElement.innerHTML = '';// Effacer le contenu actuel de <p> pour insérer les inputs
|
||||
|
||||
// Créer le champ de saisie pour le nouveau mot de passe
|
||||
var inputNewPass = document.createElement('input');
|
||||
inputNewPass.type = 'password';
|
||||
inputNewPass.placeholder = 'Nouveau mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputNewPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputNewPass.setAttribute('id', 'newPassword'); // Ajouter un ID pour la gestion
|
||||
inputNewPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
|
||||
// Créer le champ de saisie pour la confirmation du mot de passe
|
||||
var inputConfirmPass = document.createElement('input');
|
||||
inputConfirmPass.type = 'password';
|
||||
inputConfirmPass.placeholder = 'Confirmer le mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputConfirmPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputConfirmPass.setAttribute('id', 'confirmPassword'); // Ajouter un ID pour la gestion
|
||||
inputConfirmPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
// Ajouter un bouton de sauvegarde
|
||||
var saveButton = document.createElement('button');
|
||||
saveButton.textContent = 'Sauvegarder le mot de passe';
|
||||
saveButton.classList.add('saveButtonPasswd'); // Ajouter une classe au bouton
|
||||
|
||||
saveButton.onclick = function() {
|
||||
savePasswordFields(id, inputNewPass.value, inputConfirmPass.value);
|
||||
|
||||
};
|
||||
|
||||
// Ajouter les deux champs de saisie et le bouton dans l'élément <p>
|
||||
pElement.appendChild(inputNewPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer les champs
|
||||
pElement.appendChild(inputConfirmPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer
|
||||
pElement.appendChild(saveButton);
|
||||
|
||||
inputNewPass.focus();// Mettre le focus sur le premier champ de saisie
|
||||
}
|
||||
|
||||
|
||||
|
||||
function savePasswordFields(id, newPassword, confirmPassword) {
|
||||
// Vérification si les champs sont vides
|
||||
if (newPassword.trim() === "" || confirmPassword.trim() === ""){
|
||||
alert("Les champs de mot de passe ne doivent pas être vides.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Vérification de la correspondance des deux mots de passe
|
||||
if (newPassword === confirmPassword) {
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
if(newPassword.length >= 16){
|
||||
var maskedPassword = '*'.repeat(16); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
else{
|
||||
var maskedPassword = "*".repeat(newPassword.length); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
|
||||
// Remplacer les champs input par le texte masqué
|
||||
pElement.innerHTML = '<strong>' + maskedPassword + '</strong> <img class="imgModify" src="../../images/modify.svg" onclick="editFieldPassWd(\'' + id + '\')"/></strong>';
|
||||
alert('Mot de passe mis à jour avec succès');
|
||||
|
||||
// Possibilité d'ajouter ici une fonction pour envoyer les nouveaux mots de passe au serveur
|
||||
|
||||
} else {
|
||||
alert('Les mots de passe ne correspondent pas.');
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Quote{
|
||||
public int $id;
|
||||
public string $content;
|
||||
public string $carac;
|
||||
public string $imgPath;
|
||||
public string $titleSrc;
|
||||
public string $dateSrc;
|
||||
public int $like;
|
||||
public string $langue;
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
include('Connection.php');
|
||||
|
||||
Class UserGateway{
|
||||
private Connection $con;
|
||||
|
||||
public function __construct(Connection $con){
|
||||
$this->con=$con;
|
||||
}
|
||||
|
||||
public function searchQuote(string $quote,int $numpage,string $language):array{
|
||||
|
||||
//recherche par citation
|
||||
$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 content LIKE '%:quote%' AND isValid = true AND language = :language LIMIT 20 OFFSET :page*20;";
|
||||
$this->con->executeQuery($query,array(':quote' => array($quote,PDO::PARAM_STR),':page' => array($numpage,PDO::PARAM_INT),':language' => array($language,PDO::PARAM_STR)));
|
||||
$result=$this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function searchSource(string $source,int $numpage,string $language):array{
|
||||
|
||||
//recherche par source
|
||||
$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 s.title LIKE '%:source%' AND q.isValid = true AND language = :language LIMIT 20 OFFSET :page*20;";
|
||||
$this->con->executeQuery($query,array(':source' => array($source,PDO::PARAM_STR),':page' => array($numpage,PDO::PARAM_INT),':language' => array($language,PDO::PARAM_STR)));
|
||||
$result=$this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function searchPers(string $Carac,int $numpage,string $language):array{
|
||||
|
||||
//recherche par personnage
|
||||
$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 c.caracter LIKE '%:pers%' AND q.isValid = true AND language = :language LIMIT 20 OFFSET :page*20;";
|
||||
$this->con->executeQuery($query,array(':pers' => array($Pers,PDO::PARAM_STR),':page' => array($numpage,PDO::PARAM_INT),':language' => array($language,PDO::PARAM_STR)));
|
||||
$result=$this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getComment(int $id):array{
|
||||
|
||||
//obtention des commentaire d'une citation
|
||||
$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;";
|
||||
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
|
||||
$result=$this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
?>
|
@ -1,51 +0,0 @@
|
||||
// Quand le document est prêt
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
// Vérifie si les éléments existent bien avant d'y accéder
|
||||
if (themeIcon && favicon) {
|
||||
const currentTheme = localStorage.getItem('theme') || 'dark'; // Par défaut, sombre
|
||||
|
||||
// Applique le bon thème au chargement de la page
|
||||
if (currentTheme === 'light') {
|
||||
document.body.classList.remove('dark-mode');
|
||||
document.body.classList.add('light-mode');
|
||||
themeIcon.src = '../../images/light.svg'; // Affiche l'icône pour basculer vers le mode sombre
|
||||
favicon.href = '../../images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
} else {
|
||||
document.body.classList.add('dark-mode');
|
||||
themeIcon.src = '../../images/dark.svg'; // Affiche l'icône pour basculer vers le mode clair
|
||||
favicon.href = '../../images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
}
|
||||
} else {
|
||||
console.error("Élément(s) manquant(s) : icône du thème ou favicon.");
|
||||
}
|
||||
});
|
||||
|
||||
// Fonction pour basculer entre les thèmes
|
||||
function toggleTheme() {
|
||||
const body = document.body;
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
if (themeIcon && favicon) {
|
||||
if (body.classList.contains('dark-mode')) {
|
||||
// Si on est en mode sombre, on passe en mode clair
|
||||
body.classList.remove('dark-mode');
|
||||
body.classList.add('light-mode');
|
||||
themeIcon.src = '../../images/light.svg'; // Change vers le logo sombre
|
||||
favicon.href = '../../images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
localStorage.setItem('theme', 'light'); // Enregistre le thème clair dans localStorage
|
||||
} else {
|
||||
// Sinon, on repasse en mode sombre
|
||||
body.classList.remove('light-mode');
|
||||
body.classList.add('dark-mode');
|
||||
themeIcon.src = '../../images/dark.svg'; // Change vers le logo clair
|
||||
favicon.href = '../../images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
localStorage.setItem('theme', 'dark'); // Enregistre le thème sombre dans localStorage
|
||||
}
|
||||
} else {
|
||||
console.error("Impossible de trouver l'icône ou le favicon.");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const quoteElements = document.querySelectorAll('.citation-container .quote');
|
||||
|
||||
quoteElements.forEach(quote => {
|
||||
let maxLength = 135; // Nombre max de caractères avant la coupure
|
||||
if (quote.textContent.length > maxLength) {
|
||||
let displayedText = quote.textContent.slice(0, maxLength) + '...\"';
|
||||
quote.textContent = displayedText;
|
||||
}
|
||||
});
|
||||
});
|
@ -1,96 +0,0 @@
|
||||
<?php
|
||||
class User{
|
||||
public string $id;
|
||||
public string $username;
|
||||
public string $passwd;
|
||||
public string $hidenPasswd;
|
||||
public string $img;
|
||||
public string $email;
|
||||
|
||||
function __construct(string $id, string $pseudo, string $password, string $image, string $mail) {
|
||||
$this->id = $id;
|
||||
$this->username = $pseudo;
|
||||
$this->passwd = $password;
|
||||
$this->hidenPasswd = hidenPassWd($password);
|
||||
$this->img = $image;
|
||||
$this->email = $mail;
|
||||
}
|
||||
|
||||
public function updateUsername(string $newUsername){
|
||||
if(isset($newUsername)){
|
||||
$this->username = $newUsername;
|
||||
}
|
||||
}
|
||||
|
||||
public function updateEmail(string $newEmail) {
|
||||
if(isset($newEmail)){
|
||||
$this->email = $newEmail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function modifyImage(string $image){
|
||||
if(isset($image)){
|
||||
$u->img = $image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//include("userGateway.php");
|
||||
//$result = donneeUser('U003');
|
||||
|
||||
|
||||
// ============================================ En attente du Model ============================================
|
||||
include("Connection.php");
|
||||
$dsn = "pgsql:host=londres;dbname=dblebeaulato";
|
||||
$username = "lebeaulato";
|
||||
$password = "MaSQL:2004!";
|
||||
|
||||
$con = new Connection($dsn,$username,$password);
|
||||
|
||||
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
|
||||
$u = new User($result[0]['id_user'],$result[0]['username'], $result[0]['pssword'], '../../images/imageProfil.png', $result[0]['email']); /*Test*/
|
||||
|
||||
|
||||
//UPDATE username User
|
||||
$query = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newUsername'=> array('Hello', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->username = $result[0]['username']; /*Test*/
|
||||
|
||||
|
||||
//UPDATE email User
|
||||
$query = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newEmail'=> array('Sinper42Gamer@gmail.com', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->email = $result[0]['email']; /*Test*/
|
||||
|
||||
//UPDATE passwd User
|
||||
$query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newPassWd'=> array('TestMotDePasssse', PDO::PARAM_STR)));
|
||||
|
||||
$queryReponse = 'SELECT pssword FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->passwd = $result[0]['pssword']; /*Test*/
|
||||
|
||||
// ================================================================================================================
|
||||
|
||||
function hidenPassWd(string $passwd){
|
||||
if(strlen($passwd) >= 16) return str_repeat('*', 16);
|
||||
return str_repeat('*', strlen($passwd));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@ -1,105 +0,0 @@
|
||||
<?php
|
||||
include('Connection.php');
|
||||
|
||||
Class UserGateway{
|
||||
private Connection $con;
|
||||
|
||||
public function __construct(Connection $con){
|
||||
$this->con=$con;
|
||||
}
|
||||
|
||||
public function insert(string $username,string $email,string $passwd):int{
|
||||
|
||||
// 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;
|
||||
}
|
||||
// insertion user
|
||||
$query='INSERT INTO Users VALUES (:id,:username,:email,:passwd,CURRENT_DATE,false);';
|
||||
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT),':username' => array($u->username,PDO::PARAM_STR),':email' => array($u->email,PDO::PARAM_STR),':passwd' => array($u->passwd,PDO::PARAM_STR)));
|
||||
return $id;
|
||||
}
|
||||
|
||||
public function delete(int $id){
|
||||
|
||||
// supretion user
|
||||
$query='DELETE FROM Users WHERE id_user = :id;';
|
||||
$this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
|
||||
}
|
||||
|
||||
public function getFavorite(int $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_INT)));
|
||||
$result=$this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function donneeUser(string $id):array{
|
||||
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
|
||||
$this->con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR)));
|
||||
$result = $this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
// ===================== UPDATE FUNCTION =====================
|
||||
|
||||
public function updateUsername(string $id, string $newUsername):array{
|
||||
//Update le nom du user passé en paramètre
|
||||
$queryUpdate = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser';
|
||||
$this->con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':newUsername'=> array($newUsername, PDO::PARAM_STR)));
|
||||
|
||||
//Renvoie le nouveau nom du user
|
||||
$queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser';
|
||||
$this->con->executeQuery($queryReponse, array($id=>array($newUsername, PDO::PARAM_STR)));
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateEmail(string $id, string $newEmail):array{
|
||||
//Update le email du user passé en paramètre
|
||||
$queryUpdate = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser';
|
||||
$this->con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':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)));
|
||||
$result = $con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateImg(string $id, string $newImg):array{
|
||||
//Update l'image du user passé en paramètre
|
||||
$query = 'UPDATE Users SET img=:newImg WHERE id_user=:idUser';
|
||||
$this->con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR), ':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)));
|
||||
$result = $this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updatePasswd(string $id, string $newPassWd):array{
|
||||
//Update le passwd du user passé en paramètre
|
||||
$query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser';
|
||||
$this->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 = $this->con->getResults();
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//$uG = new UserGateway(new Connection("pgsql:host=londres;dbname=dbkekentin","kekentin",""));
|
||||
$uG = new UserGateway(new Connection("pgsql:host=londres;dbname=dblebeaulato","lebeaulato",""));
|
||||
$uG->delete(2);
|
||||
?>
|
@ -1,145 +0,0 @@
|
||||
/* header.css */
|
||||
|
||||
/* Styles généraux */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #120b1d;
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 200px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
background-color: #000000;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.user {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
/* Mode sombre */
|
||||
body.dark-mode {
|
||||
background-color: #120B1D;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
body.dark-mode .header {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
body.dark-mode .header img {
|
||||
filter: invert(0%);
|
||||
}
|
||||
|
||||
body.dark-mode .nav img:hover {
|
||||
filter: invert(59%) sepia(96%) saturate(6733%) hue-rotate(275deg) brightness(112%) contrast(122%);
|
||||
}
|
||||
|
||||
/* Mode clair */
|
||||
body.light-mode {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
body.light-mode .header {
|
||||
background-color: #F7F7EB;
|
||||
}
|
||||
|
||||
body.light-mode .header img {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
body.light-mode .nav img:hover {
|
||||
filter: invert(22%) sepia(6%) saturate(2269%) hue-rotate(193deg) brightness(98%) contrast(106%);
|
||||
}
|
||||
|
||||
/* Media queries for responsiveness */
|
||||
|
||||
/* For tablets and small devices */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav, .logo, .user {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* For mobile phones */
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.nav img, .logo img {
|
||||
width: 50px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banner images should be responsive */
|
||||
.header img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Media queries for different screen sizes */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
}
|
||||
.header img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
}
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
@import url('style.css'); /* Import de style.css */
|
||||
|
||||
/* Conteneur général pour les citations */
|
||||
.citations-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
padding: 20px 0;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin: 0 0;
|
||||
}
|
||||
|
||||
/* Conteneur pour les suggestions en deux colonnes */
|
||||
.suggestions-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Citations */
|
||||
.citation-container {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
border-radius: 12px;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
width: 49%; /* Chaque citation occupe 45% de la largeur pour laisser 5% d'espace */
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
height: 150px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
word-wrap: break-word; /* Permet de couper les mots trop longs */
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* Fixe la taille pour s'assurer que toutes les citations restent cohérentes */
|
||||
.citation-container .text-content {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/* Citation du jour - toujours en pleine largeur */
|
||||
.citation-du-jour {
|
||||
width: 90%; /* Prend toute la largeur */
|
||||
background: linear-gradient(to right, #ff5722, #ff9800); /* Dégradé spécial pour la citation du jour */
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.suggestion {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.citation-image {
|
||||
width: 150px;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.text-content {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center; /* Centre verticalement le texte */
|
||||
word-wrap: break-word; /* Permet de couper les mots trop longs */
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.quote {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.movie, .character, .year {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* Mode sombre */
|
||||
body.dark-mode .suggestion {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
color:white;
|
||||
}
|
||||
|
||||
/* Mode clair */
|
||||
body.light-mode .suggestion {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
color:black; /* Changer le texte en noir pour le mode clair */
|
||||
}
|
||||
|
||||
body.light-mode .quote,
|
||||
body.light-mode .movie,
|
||||
body.light-mode .character,
|
||||
body.light-mode .year {
|
||||
color: black; /* Forcer le texte en noir pour le mode clair */
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
.suggestions-container {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.citation-container {
|
||||
width: 100%; /* Chaque citation prend toute la largeur sur mobile */
|
||||
max-width: 100%;
|
||||
height: 100px; /* Supprimer la hauteur fixe sur mobile */
|
||||
}
|
||||
|
||||
.citation-image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.quote {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1{
|
||||
color : white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
body.dark-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : white;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.dark-mode .login{
|
||||
background-color: black;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 3%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid transparent;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
body.dark-mode .createAccount{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: white;
|
||||
border: 1px solid transparent;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.dark-mode .buttonSudmite{
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .connexion{
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: none;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1{
|
||||
color : black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
body.light-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : black;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.light-mode .login{
|
||||
background-color: white;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 3%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
body.light-mode .createAccount{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.light-mode .buttonSudmite{
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
body.light-mode .connexion{
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: 1px solid black;
|
||||
background-color: #fff1f1;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.buttonSudmiteDiv{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -1,226 +0,0 @@
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1{
|
||||
color : white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
body.dark-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : white;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .buttonSudmite{
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
body.dark-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.dark-mode .login{
|
||||
background-color: black;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
filter: invert(100%) brightness(1000%) contrast(1000%);
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: none;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.dark-mode .saveButtonPasswd {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1{
|
||||
color : black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
body.light-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : black;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .buttonSudmite{
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
body.light-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.light-mode .login{
|
||||
background-color: white;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: 1px solid black;
|
||||
background-color: #fff1f1;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
color : black;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.light-mode .saveButtonPasswd {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.buttonSudmiteDiv{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.changeValue{
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
.imageProfil{
|
||||
width: 25%;
|
||||
border-radius: 25px;
|
||||
display:block;
|
||||
margin-left: 38%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
.infoProfil{
|
||||
margin-left: 10%;
|
||||
text-align: center;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
|
||||
.languageDiv{
|
||||
margin-left: 25%;
|
||||
}
|
||||
.languageTitle{
|
||||
text-align: left;
|
||||
font-size: 100%;
|
||||
}
|
||||
.languageImage{
|
||||
width: 300px;
|
||||
height: 40px;
|
||||
margin-left: 25%;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
@ -1,154 +0,0 @@
|
||||
@import url(./style.css);
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap');
|
||||
|
||||
body, html {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1, body.dark-mode h2, body.dark-mode p {
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.dark-mode .quiz {
|
||||
background-color: black;
|
||||
height: 60%;
|
||||
width: 80%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
|
||||
row-gap: 80px;
|
||||
}
|
||||
|
||||
body.dark-mode .answer {
|
||||
background-color: #1b0048;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
width: 35%;
|
||||
padding: 35px;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .answer:hover {
|
||||
background-color: #6100ff;
|
||||
}
|
||||
|
||||
body.dark-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
|
||||
}
|
||||
|
||||
body.dark-mode .buttonSudmite {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1, body.light-mode h2, body.light-mode p {
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.light-mode .quiz {
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
height: 90%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
gap: 1000px;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
body.light-mode .answer {
|
||||
background-color: #fff1f1;
|
||||
color: black;
|
||||
border: 1px solid black;
|
||||
border-radius: 25px;
|
||||
width: 45%;
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .answer:hover {
|
||||
background-color: #c7f6c4;
|
||||
}
|
||||
|
||||
body.light-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
body.light-mode .buttonSudmite {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.user img {
|
||||
margin-left: 10px;
|
||||
}
|
@ -1 +0,0 @@
|
||||
@import url(./style.css);
|
@ -1,120 +0,0 @@
|
||||
@import url(./style.css);
|
||||
|
||||
h1{
|
||||
margin-top: 10%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.signin{
|
||||
border-radius: 25px;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: repeat(5, 1fr);
|
||||
width : 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 3%;
|
||||
padding : 2%;
|
||||
}
|
||||
|
||||
p{
|
||||
font-size: 20px;
|
||||
margin-top: 7%;
|
||||
margin-bottom: 2%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.DivId{
|
||||
grid-area: 1 / 1 / 2 / 2;
|
||||
}
|
||||
|
||||
.DivEmail{
|
||||
grid-area: 2 / 1 / 3 / 2;
|
||||
}
|
||||
|
||||
.mdp{
|
||||
grid-area: 3 / 1 / 4 / 3;
|
||||
}
|
||||
|
||||
.confmdp{
|
||||
grid-area: 4 / 1 / 5 / 3;
|
||||
}
|
||||
|
||||
.imgprof{
|
||||
grid-area: 1 / 2 / 3 / 3;
|
||||
}
|
||||
|
||||
.confirmer{
|
||||
grid-area: 5 / 1 / 6 / 3;
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.champ{
|
||||
width: 90%;
|
||||
height : 35%;
|
||||
border-radius: 25px;
|
||||
margin-left: 1%;
|
||||
padding-left: 3%;
|
||||
margin-top: -1%;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.btn{
|
||||
margin-top: 10%;
|
||||
width:75%;
|
||||
font-size: 20px;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: none;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
/*Dark mode*/
|
||||
|
||||
body.dark-mode .signin{
|
||||
background-color: #000000;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .h1{
|
||||
color : white;
|
||||
}
|
||||
|
||||
body.dark-mode .p{
|
||||
color : white;
|
||||
}
|
||||
|
||||
body.dark-mode .btn{
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
color : white;
|
||||
}
|
||||
|
||||
body.dark-mode .champ{
|
||||
background-color: #ffffff;
|
||||
border: 2px solid #ffffff;
|
||||
}
|
||||
|
||||
/*Light*/
|
||||
|
||||
body.light-mode .signin{
|
||||
background-color: #ffffff;
|
||||
border: 2px solid #000000;
|
||||
}
|
||||
|
||||
body.light-mode .h1{
|
||||
color : #000000;
|
||||
}
|
||||
|
||||
body.light-mode .p{
|
||||
color : #000000;
|
||||
}
|
||||
|
||||
body.light-mode .btn{
|
||||
background: linear-gradient(90deg, #caffde 0%, #b7c8ff 100%);
|
||||
color : #000000;
|
||||
}
|
||||
|
||||
body.light-mode .champ{
|
||||
background-color: #fff1f1;
|
||||
border: 1px solid #000000;
|
||||
}
|
@ -1,231 +0,0 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
import time
|
||||
|
||||
# Liste de films associée à la liste de personnages fournie plus tôt
|
||||
films = [
|
||||
"Harry Potter", "Star Wars", "Le Seigneur des Anneaux", "Batman", "Spider-Man",
|
||||
"Iron Man", "Les Avengers", "Doctor Strange", "Deadpool", "X-Men",
|
||||
"Black Panther", "Aquaman", "La Ligue des Justiciers", "Shazam", "Les Gardiens de la Galaxie",
|
||||
"Le Parrain", "Le Chevalier Noir", "Inception", "Fight Club", "Pulp Fiction",
|
||||
"Forrest Gump", "Matrix", "Jurassic Park", "Gladiator", "Le Silence des Agneaux",
|
||||
"La Liste de Schindler", "Braveheart", "La Ligne Verte", "Il faut sauver le soldat Ryan", "Thor",
|
||||
"Captain America", "Logan", "Joker", "Wonder Woman", "L'Homme d'Acier",
|
||||
"Hunger Games", "Divergente", "Les Animaux Fantastiques", "Le Hobbit",
|
||||
"Pirates des Caraïbes", "Toy Story", "La Reine des Neiges", "Le Roi Lion", "La Belle et la Bête",
|
||||
"Aladdin", "Mulan", "Cendrillon", "La Belle au bois dormant", "Blanche-Neige",
|
||||
"Raiponce", "Vaiana", "Zootopie", "Vice-versa", "Le Monde de Nemo",
|
||||
"Les Indestructibles", "Ratatouille", "WALL-E", "Là-haut", "Coco",
|
||||
"Monstres & Cie", "Cars", "Madagascar", "Shrek", "Kung Fu Panda",
|
||||
"Dragons", "L'Âge de glace", "Les Croods"
|
||||
]
|
||||
|
||||
# Petite base de données locale avec les années des films
|
||||
film_years = {
|
||||
"Harry Potter": "2001",
|
||||
"Star Wars": "1977",
|
||||
"Le Seigneur des Anneaux": "2001",
|
||||
"Batman": "1989",
|
||||
"Spider-Man": "2002",
|
||||
"Iron Man": "2008",
|
||||
"Les Avengers": "2012",
|
||||
"Doctor Strange": "2016",
|
||||
"Deadpool": "2016",
|
||||
"X-Men": "2000",
|
||||
"Black Panther": "2018",
|
||||
"Aquaman": "2018",
|
||||
"La Ligue des Justiciers": "2017",
|
||||
"Shazam": "2019",
|
||||
"Les Gardiens de la Galaxie": "2014",
|
||||
"Le Parrain": "1972",
|
||||
"Le Chevalier Noir": "2008",
|
||||
"Inception": "2010",
|
||||
"Fight Club": "1999",
|
||||
"Pulp Fiction": "1994",
|
||||
"Forrest Gump": "1994",
|
||||
"Matrix": "1999",
|
||||
"Jurassic Park": "1993",
|
||||
"Gladiator": "2000",
|
||||
"Le Silence des Agneaux": "1991",
|
||||
"La Liste de Schindler": "1993",
|
||||
"Braveheart": "1995",
|
||||
"La Ligne Verte": "1999",
|
||||
"Il faut sauver le soldat Ryan": "1998",
|
||||
"Thor": "2011",
|
||||
"Captain America": "2011",
|
||||
"Logan": "2017",
|
||||
"Joker": "2019",
|
||||
"Wonder Woman": "2017",
|
||||
"L'Homme d'Acier": "2013",
|
||||
"Hunger Games": "2012",
|
||||
"Divergente": "2014",
|
||||
"Les Animaux Fantastiques": "2016",
|
||||
"Le Hobbit": "2012",
|
||||
"Pirates des Caraïbes": "2003",
|
||||
"Toy Story": "1995",
|
||||
"La Reine des Neiges": "2013",
|
||||
"Le Roi Lion": "1994",
|
||||
"La Belle et la Bête": "1991",
|
||||
"Aladdin": "1992",
|
||||
"Mulan": "1998",
|
||||
"Cendrillon": "1950",
|
||||
"La Belle au bois dormant": "1959",
|
||||
"Blanche-Neige": "1937",
|
||||
"Raiponce": "2010",
|
||||
"Vaiana": "2016",
|
||||
"Zootopie": "2016",
|
||||
"Vice-versa": "2015",
|
||||
"Le Monde de Nemo": "2003",
|
||||
"Les Indestructibles": "2004",
|
||||
"Ratatouille": "2007",
|
||||
"WALL-E": "2008",
|
||||
"Là-haut": "2009",
|
||||
"Coco": "2017",
|
||||
"Monstres & Cie": "2001",
|
||||
"Cars": "2006",
|
||||
"Madagascar": "2005",
|
||||
"Shrek": "2001",
|
||||
"Kung Fu Panda": "2008",
|
||||
"Dragons": "2010",
|
||||
"L'Âge de glace": "2002",
|
||||
"Les Croods": "2013"
|
||||
}
|
||||
|
||||
# Fonction pour rechercher une image sur Bing
|
||||
def search_image_bing(personnage, film):
|
||||
url = f"https://www.bing.com/images/search?q={personnage.replace(' ', '+')}+{film.replace(' ', '+')}"
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}
|
||||
|
||||
response = requests.get(url, headers=headers)
|
||||
soup = BeautifulSoup(response.text, 'lxml')
|
||||
|
||||
# Rechercher la première image
|
||||
image = soup.find('img', {'class': 'mimg'})
|
||||
if image and 'src' in image.attrs:
|
||||
return image['src']
|
||||
return None
|
||||
|
||||
# Vérifier si une citation est en français
|
||||
common_french_words = {
|
||||
'le', 'la', 'les', 'et', 'est', 'pour', 'que', 'qui', 'un', 'une', 'de', 'du', 'ce', 'cela',
|
||||
'dans', 'sur', 'par', 'avec', 'en', 'au', 'aux', 'des', 'ou', 'mais', 'si', 'ne', 'pas',
|
||||
'il', 'elle', 'ils', 'elles', 'nous', 'vous', 'tu', 'je', 'me', 'te', 'se', 'sont', 'été',
|
||||
'avoir', 'être', 'faire', 'dire', 'pouvoir', 'aller', 'venir', 'voir', 'vouloir', 'savoir',
|
||||
'bien', 'tout', 'mon', 'ton', 'son', 'notre', 'votre', 'leur', 'plus', 'aussi', 'comme',
|
||||
'faut', 'a', 'le', 'la', 'les'
|
||||
}
|
||||
|
||||
def is_french(citation_text):
|
||||
words_in_citation = citation_text.lower().split()
|
||||
french_word_count = sum(1 for word in words_in_citation if word in common_french_words)
|
||||
|
||||
# On considère que c'est français si au moins 50% des mots sont reconnus comme français
|
||||
return french_word_count / len(words_in_citation) >= 0.5
|
||||
|
||||
# Fonction pour obtenir l'année du film depuis la base de données locale ou via Google
|
||||
def get_film_year(film_name):
|
||||
if film_name in film_years:
|
||||
return film_years[film_name]
|
||||
return '0' # Retourner 0 si l'année est inconnue
|
||||
|
||||
# Fonction pour scraper les citations d'un film
|
||||
def scrape_citations(film_name):
|
||||
url = "https://www.kaakook.fr/rechercher"
|
||||
data = {
|
||||
"extrfilm": film_name, # Nom du film
|
||||
"extrcitation": "" # On laisse vide pour chercher toutes les citations du film
|
||||
}
|
||||
|
||||
# Faire la requête POST
|
||||
response = requests.post(url, data=data)
|
||||
if response.status_code != 200:
|
||||
print(f"Erreur avec le film {film_name}. Status code: {response.status_code}")
|
||||
return []
|
||||
|
||||
# Parser la réponse HTML
|
||||
soup = BeautifulSoup(response.content, "html.parser")
|
||||
citations = []
|
||||
|
||||
# Extraire les citations et autres informations
|
||||
articles = soup.find_all('article')
|
||||
for article in articles:
|
||||
citation_text = article.find('a').get_text().strip().replace("\n", " ").replace(" ", " ")
|
||||
|
||||
# Ignorer les citations contenant du HTML <br> (donc multi-lignes)
|
||||
if "<br>" in str(article):
|
||||
continue
|
||||
|
||||
# Vérifier si la citation commence par un tiret (dialogue)
|
||||
if citation_text.startswith('-'):
|
||||
continue
|
||||
|
||||
# Vérifier si la citation est en français
|
||||
if not is_french(citation_text):
|
||||
continue
|
||||
|
||||
source = article.find('cite').get_text().strip()
|
||||
|
||||
# Récupérer le personnage (ignorer si le personnage est inconnu)
|
||||
footer_links = article.find('footer').find_all('a')
|
||||
character = footer_links[1].get_text().strip() if len(footer_links) > 1 else 'Inconnu'
|
||||
|
||||
# Si le personnage est inconnu, on ignore cette citation
|
||||
if character == 'Inconnu':
|
||||
continue
|
||||
|
||||
# Récupérer l'image associée
|
||||
img_tag = article.find('img')
|
||||
image_url = img_tag['src'] if img_tag else 'images/default.jpg'
|
||||
|
||||
|
||||
# Télécharger l'image si elle n'existe pas déjà
|
||||
if image_url == 'images/default.jpg':
|
||||
image_url = search_image_bing(character, film_name)
|
||||
if image_url:
|
||||
download_image(image_url, character)
|
||||
|
||||
# Récupérer l'année via la base de données locale ou Google
|
||||
year = get_film_year(film_name)
|
||||
|
||||
# Stocker les résultats sous la forme "citation; source; character; year; image"
|
||||
citations.append(f"\n{citation_text}; {source}; {character}; {year}; {image_url}")
|
||||
|
||||
return citations
|
||||
|
||||
# Fonction pour télécharger une image
|
||||
def download_image(image_url, character_name):
|
||||
image_name = f"{character_name.replace(' ', '_')}.jpg"
|
||||
image_path = os.path.join("images", image_name)
|
||||
|
||||
# Vérifier si le dossier "images" existe, sinon le créer
|
||||
if not os.path.exists("images"):
|
||||
os.makedirs("images")
|
||||
|
||||
# Si l'image n'existe pas déjà, la télécharger
|
||||
if not os.path.exists(image_path):
|
||||
try:
|
||||
img_data = requests.get(image_url).content
|
||||
with open(image_path, 'wb') as handler:
|
||||
handler.write(img_data)
|
||||
print(f"Image téléchargée : {image_path}")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors du téléchargement de l'image {image_url} : {e}")
|
||||
|
||||
# Ecrire les résultats dans un fichier txt unique
|
||||
def save_citations_to_file(citations):
|
||||
with open("citation.txt", "a", encoding="utf-8") as file:
|
||||
for citation in citations:
|
||||
file.write(citation + "\n")
|
||||
|
||||
# Itérer sur la liste des films et récupérer les citations
|
||||
for film in films:
|
||||
print(f"Recherche des citations pour le film : {film}")
|
||||
citations = scrape_citations(film)
|
||||
if citations:
|
||||
save_citations_to_file(citations)
|
||||
print(f"Ajouté {len(citations)} citation(s) pour {film}.")
|
||||
else:
|
||||
print(f"Aucune citation trouvée pour {film}.")
|
||||
time.sleep(2) # Petite pause pour éviter d'envoyer trop de requêtes rapidement
|
@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
class QuestionEntity {
|
||||
private int $id_question;
|
||||
private string $question;
|
||||
private string $answerA;
|
||||
private string $answerB;
|
||||
private string $answerC;
|
||||
private string $answerD;
|
||||
private string $cAnswer;
|
||||
|
||||
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
|
||||
{
|
||||
$this -> id_question = $id_question;
|
||||
$this -> question = $question;
|
||||
$this -> answerA = $answerA;
|
||||
$this -> answerB = $answerB;
|
||||
$this -> answerC = $answerC;
|
||||
$this -> answerD = $answerD;
|
||||
$this -> cAnswer = $cAnswer;
|
||||
}
|
||||
|
||||
public function getIdQuestion() : int
|
||||
{
|
||||
return $this -> id_question;
|
||||
}
|
||||
|
||||
public function getQuestion() : string
|
||||
{
|
||||
return $this -> question;
|
||||
}
|
||||
|
||||
public function getAnswerA() : string
|
||||
{
|
||||
return $this -> answerA;
|
||||
}
|
||||
|
||||
public function getAnswerB() : string
|
||||
{
|
||||
return $this -> answerB;
|
||||
}
|
||||
|
||||
public function getAnswerC() : string
|
||||
{
|
||||
return $this -> answerC;
|
||||
}
|
||||
|
||||
public function getAnswerD() : string
|
||||
{
|
||||
return $this -> answerD;
|
||||
}
|
||||
|
||||
public function getCAnswer() : string
|
||||
{
|
||||
return $this -> cAnswer;
|
||||
}
|
||||
|
||||
public function setQuestion(string $new_question) : void
|
||||
{
|
||||
$this -> question = $new_question;
|
||||
}
|
||||
|
||||
public function setAnswerA(string $new_answera) : void
|
||||
{
|
||||
$this -> answerA = $new_answera;
|
||||
}
|
||||
|
||||
public function setAnswerB(string $new_answerb) : void
|
||||
{
|
||||
$this -> answerB = $new_answerb;
|
||||
}
|
||||
|
||||
public function setAnswerC(string $new_answerc) : void
|
||||
{
|
||||
$this -> answerC = $new_answerc;
|
||||
}
|
||||
|
||||
public function setAnswerD(string $new_answerd) : void
|
||||
{
|
||||
$this -> answerD = $new_answerd;
|
||||
}
|
||||
|
||||
public function setCAnswer(string $new_canswer) : void
|
||||
{
|
||||
$this -> cAnswer = $new_canswer;
|
||||
}
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once("../public/script/Connection.php");
|
||||
require_once("questionEntity.php");
|
||||
|
||||
class QuestionGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts a new question into the database
|
||||
*
|
||||
* @param QuestionEntity $q The `Question` object to insert
|
||||
* @return bool True if the question was successfully inserted, false otherwise
|
||||
*/
|
||||
public function create(QuestionEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Question
|
||||
VALUES (:id_q, :question, :answerA, :answerB, :answerC, :answerD, :cAnswer)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($q -> getIdQuestion(), PDO::PARAM_INT),
|
||||
'question' => array($q -> getQuestion(), PDO::PARAM_STR),
|
||||
'answerA' => array($q -> getAnswerA(), PDO::PARAM_STR),
|
||||
'answerB' => array($q -> getAnswerB(), PDO::PARAM_STR),
|
||||
'answerC' => array($q -> getAnswerC(), PDO::PARAM_STR),
|
||||
'answerD' => array($q -> getAnswerD(), PDO::PARAM_STR),
|
||||
'cAnswer' => array($q -> getAnswerC(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a question from the database by its ID
|
||||
*
|
||||
* @param int $id The ID of the question to retrieve
|
||||
* @return QuestionEntity|null The `Question` object if found, null otherwise
|
||||
*/
|
||||
public function findById(int $id) : ?QuestionEntity
|
||||
{
|
||||
$query = "SELECT * FROM Question WHERE id_question = :id_q";
|
||||
$this -> co -> executeQuery($query, ['id_q' => $id]);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
if ($res)
|
||||
return new QuestionEntity(
|
||||
$res['id_q'],
|
||||
$res['question'],
|
||||
$res['answerA'],
|
||||
$res['answerB'],
|
||||
$res['answerC'],
|
||||
$res['answerD'],
|
||||
$res['cAnswer'],
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the text of and an existing question in the database
|
||||
*
|
||||
* @param QuestionEntity $q The `Question` object with updated information
|
||||
* @return bool True if the text of the question was successfully updated, false otherwise
|
||||
*/
|
||||
public function updateText(QuestionEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET question = :question
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($q -> getIdQuestion(), PDO::PARAM_INT),
|
||||
'question' => array($q -> getQuestion(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the answers of an existing question in the database
|
||||
*
|
||||
* @param QuestionEntity $q The `Question` object with updated information
|
||||
* @return bool True if the answers of the question was successfully updated, false otherwise
|
||||
*/
|
||||
public function updateAnswers(QuestionEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET answerA = :answerA, answerB = :answerB,
|
||||
answerC = :answerC, answerD = :answerD, cAnswer = :cAnswer
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($q -> getIdQuestion(), PDO::PARAM_INT),
|
||||
'answerA' => array($q -> getAnswerA(), PDO::PARAM_STR),
|
||||
'answerB' => array($q -> getAnswerB(), PDO::PARAM_STR),
|
||||
'answerC' => array($q -> getAnswerC(), PDO::PARAM_STR),
|
||||
'answerD' => array($q -> getAnswerD(), PDO::PARAM_STR),
|
||||
'cAnswer' => array($q -> getAnswerC(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a question from the database by its ID
|
||||
*
|
||||
* @param int $id The ID of the question
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Question WHERE id_question = :id_q";
|
||||
|
||||
return $this -> co -> executeQuery($query, ['id_q' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all quizzes from the database
|
||||
*
|
||||
* @return QuestionEntity[] An array of `Question` objects
|
||||
*/
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Question";
|
||||
$this -> co -> executeQuery($query);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
$questions = [];
|
||||
|
||||
foreach ($res as $q)
|
||||
$questions[] = new QuestionEntity(
|
||||
$q['id_question'],
|
||||
$q['question'],
|
||||
$q['answerA'],
|
||||
$q['answerB'],
|
||||
$q['answerC'],
|
||||
$q['answerD'],
|
||||
$q['cAnswer']
|
||||
);
|
||||
|
||||
return $questions;
|
||||
}
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once("questionEntity.php");
|
||||
require_once("questionGateway.php");
|
||||
|
||||
class QuestionModel {
|
||||
private QuestionGateway $gateway;
|
||||
|
||||
public function __construct(QuestionGateway $gateway)
|
||||
{
|
||||
$this -> gateway = $gateway;
|
||||
}
|
||||
|
||||
public function createQuestion(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer) : bool
|
||||
{
|
||||
$q = new QuestionEntity($id_question, $question, $answerA, $answerB, $answerC, $answerD, $cAnswer);
|
||||
return $this -> gateway -> create($q);
|
||||
}
|
||||
|
||||
public function getQuestion(int $id_question) : ?QuestionEntity
|
||||
{
|
||||
return $this -> gateway -> findById($id_question);
|
||||
}
|
||||
|
||||
public function updateTextQuestion(int $id_question, string $question) : bool
|
||||
{
|
||||
$q = $this -> gateway -> findById($id_question);
|
||||
|
||||
if ($q)
|
||||
{
|
||||
$q -> setQuestion($question);
|
||||
return $this -> gateway -> updateText($q);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateAnswersQuestion(int $id_question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer) : bool
|
||||
{
|
||||
$q = $this -> gateway -> findById($id_question);
|
||||
|
||||
if ($q)
|
||||
{
|
||||
$q -> setAnswerA($answerA);
|
||||
$q -> setAnswerB($answerB);
|
||||
$q -> setAnswerC($answerC);
|
||||
$q -> setAnswerD($answerD);
|
||||
$q -> setAnswerC($cAnswer);
|
||||
return $this -> gateway -> updateAnswers($q);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function deleteQuestion(int $id_question) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_question);
|
||||
}
|
||||
|
||||
public function getAllQuestions() : array
|
||||
{
|
||||
return $this -> gateway -> findAll();
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
class QuizEntity {
|
||||
|
||||
private int $id_quiz;
|
||||
|
||||
private int $level;
|
||||
|
||||
private int $timer;
|
||||
|
||||
public function __construct(int $id_quiz, int $level, int $timer)
|
||||
{
|
||||
$this -> id_quiz = $id_quiz;
|
||||
$this -> level = $level;
|
||||
$this -> timer = $timer;
|
||||
}
|
||||
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this -> id_quiz;
|
||||
}
|
||||
|
||||
public function getLevel(): int
|
||||
{
|
||||
return $this -> level;
|
||||
}
|
||||
|
||||
public function getTimer(): int
|
||||
{
|
||||
return $this -> timer;
|
||||
}
|
||||
|
||||
public function setLevel(int $new_level): void
|
||||
{
|
||||
$this -> level = $new_level;
|
||||
}
|
||||
|
||||
public function setTimer(int $new_timer): void
|
||||
{
|
||||
$this -> timer = $new_timer;
|
||||
}
|
||||
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once("../public/script/Connection.php");
|
||||
require_once("quizEntity.php");
|
||||
|
||||
class QuizGateway {
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(QuizEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Quiz
|
||||
VALUES (:id_quiz, :level, :timer)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
':id_quiz' => array($q -> getIdQuiz(), PDO::PARAM_INT),
|
||||
':level' => array($q -> getLevel(), PDO::PARAM_INT),
|
||||
':timer' => array($q -> getTimer(), PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findQuizById(int $id) : ?QuizEntity
|
||||
{
|
||||
$query = "SELECT * FROM Quiz WHERE id_quiz = :id_q";
|
||||
|
||||
$this->co->executeQuery($query, [':id_q' => $id]);
|
||||
|
||||
$res = $this->co->getResults();
|
||||
|
||||
if ($res)
|
||||
return new QuizEntity(
|
||||
$res['id_quiz'],
|
||||
$res['level'],
|
||||
$res['timer']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function updateLevel(QuizEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Quiz
|
||||
SET level = :level
|
||||
WHERE id_quiz = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
':id_q' => array($q -> getIdQuiz(), PDO::PARAM_INT),
|
||||
':level' => array($q -> getLevel(), PDO::PARAM_INT),
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateTimer(QuizEntity $q) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Quiz
|
||||
SET timer = :timer
|
||||
WHERE id_quiz = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
':id_q' => array($q -> getIdQuiz(), PDO::PARAM_INT),
|
||||
':timer' => array($q -> getTimer(), PDO::PARAM_INT),
|
||||
]);
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Quiz WHERE id_quiz = :id_q";
|
||||
|
||||
return $this -> co -> executeQuery($query, [':id_q' => $id]);
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Quiz";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
$quiz = [];
|
||||
|
||||
foreach ($res as $q)
|
||||
$quiz[] = new QuizEntity(
|
||||
$q['id_quiz'],
|
||||
$q['level'],
|
||||
$q['timer']
|
||||
);
|
||||
|
||||
return $quiz;
|
||||
}
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once("quizEntity.php");
|
||||
require_once("quizGateway.php");
|
||||
|
||||
class QuizModel {
|
||||
|
||||
private QuizGateway $gateway;
|
||||
|
||||
public function __construct(QuizGateway $gateway)
|
||||
{
|
||||
$this -> gateway = $gateway;
|
||||
}
|
||||
|
||||
public function createQuiz(int $id_quiz, int $level, int $timer) : bool
|
||||
{
|
||||
$q = new QuizEntity($id_quiz, $level, $timer);
|
||||
return $this -> gateway -> create($q);
|
||||
}
|
||||
|
||||
public function getQuiz(int $id_quiz) : ?QuizEntity
|
||||
{
|
||||
return $this -> gateway -> findQuizById($id_quiz);
|
||||
}
|
||||
|
||||
public function updateLevelQuiz(int $id_quiz, int $level) : bool
|
||||
{
|
||||
$q = $this -> gateway -> findQuizById($id_quiz);
|
||||
|
||||
if ($q)
|
||||
{
|
||||
$q -> setLevel($level);
|
||||
return $this -> gateway -> updateLevel($q);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateTimerQuiz(int $id_quiz, int $timer) : bool
|
||||
{
|
||||
$q = $this -> gateway -> findQuizById($id_quiz);
|
||||
|
||||
if ($q)
|
||||
{
|
||||
$q -> setTimer($timer);
|
||||
return $this -> gateway -> updateTimer($q);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function deleteQuiz(int $id_quiz) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_quiz);
|
||||
}
|
||||
|
||||
public function getAllQuiz() : array
|
||||
{
|
||||
return $this -> gateway -> findAll();
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once('../script/Connection.php');
|
||||
require_once('../src/questionGateway.php');
|
||||
require_once('../src/questionModel.php');
|
||||
|
||||
$uAnswer = $_POST['answer'];
|
||||
var_dump($_POST);
|
||||
$cAnswer = $_POST['cAnswer'];
|
||||
var_dump($cAnswer);
|
@ -1,4 +0,0 @@
|
||||
TesteurFichier
|
||||
motDepasseFichier
|
||||
../images/imageProfil.png
|
||||
testeurFichier.compte@wikifantasy.com
|
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
class CitationView {
|
||||
|
||||
public static function display($citationDuJour, $suggestions) {
|
||||
echo "<div class='citations-section'>";
|
||||
|
||||
// Afficher la citation du jour
|
||||
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 {
|
||||
echo "<p class='error'>Aucune citation du jour n'a été trouvée.</p>";
|
||||
}
|
||||
|
||||
// Filtrer les suggestions pour éviter de reprendre la citation du jour
|
||||
$filteredSuggestions = array_filter($suggestions, function($suggestion) use ($citationDuJour) {
|
||||
// Vérifie que les deux citations ne sont pas identiques
|
||||
return isset($suggestion[0]) && trim($suggestion[0]) !== trim($citationDuJour[1]);
|
||||
});
|
||||
|
||||
// Afficher les suggestions
|
||||
if (!empty($filteredSuggestions)) {
|
||||
echo "<h2>Suggestions</h2>";
|
||||
echo "<div class='suggestions-container'>"; // Conteneur pour gérer les colonnes
|
||||
foreach ($filteredSuggestions as $suggestion) {
|
||||
// Vérifier si tous les éléments requis sont bien présents dans $suggestion
|
||||
$quote = isset($suggestion[0]) ? htmlspecialchars(trim($suggestion[0])) : '';
|
||||
$movie = isset($suggestion[1]) ? htmlspecialchars(trim($suggestion[1])) : '';
|
||||
$character = isset($suggestion[2]) ? htmlspecialchars(trim($suggestion[2])) : 'Inconnu';
|
||||
$year = isset($suggestion[3]) ? htmlspecialchars(trim($suggestion[3])) : 'Inconnue';
|
||||
$imagePath = isset($suggestion[4]) ? htmlspecialchars(trim($suggestion[4])) : 'images/default.jpg';
|
||||
|
||||
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>"; // Fin du conteneur suggestions
|
||||
}
|
||||
|
||||
echo "</div>"; // Fin de la section des citations
|
||||
echo "</body></html>"; // Clôture la structure HTML
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
class HeaderView {
|
||||
|
||||
public static function display($theme) {
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Wiki Fantasy</title>
|
||||
<link id="favicon" rel="icon" href="../images/dark.svg" type="image/x-icon" />
|
||||
<script src="../script/truncateQuotes.js"></script>
|
||||
<link rel="stylesheet" href="../styles/styleAccueil.css"> <!-- Import de styleAccueil.css -->
|
||||
<script defer src="../script/theme-toggle.js"></script> <!-- Import du script -->
|
||||
</head>
|
||||
<body class="<?php echo htmlspecialchars($theme); ?>">
|
||||
<div class="container">
|
||||
<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/dark.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">
|
||||
<a href="profil.html"><img src="../../images/user_dark.png" alt="user" width="70px" height="70px" onmousedown="return false"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|