Compare commits

...

35 Commits

Author SHA1 Message Date
Maxime ROCHER da2a2395d8 pagination favoris
1 month ago
Maxime ROCHER 25c49e6600 modifications légères header
1 month ago
Maxime ROCHER 248d75441d pagination recherche
1 month ago
Maxime ROCHER 9fec0c90b3 création du style pour ajouter une quote et deplacement du bouton
1 month ago
Maxime ROCHER 331d139b29 Mise à jour de 'README.md'
3 months ago
Maxime ROCHER dde7c7736f Mise à jour de 'README.md'
3 months ago
Leni BEAULATON 434c6f4144 Mise à jour de 'README.md'
3 months ago
Leni BEAULATON f7bd335735 Mise à jour de 'README.md'
3 months ago
brongniart c909aae222 correction petite erreur
3 months ago
Kentin BRONGNIART 3403a5592c Merge pull request 'Création du Quiz random' (#30) from ajoutQuiz into master
3 months ago
brongniart 63ab93f3ca merge
3 months ago
brongniart 42aa62aece Création du Quiz random
3 months ago
Maxime ROCHER 8f99b30a0e retour au quiz dispo
3 months ago
Maxime ROCHER 00a9cc3641 Merge branch 'ajoutQuiz'
3 months ago
Maxime ROCHER 165b1fcbd9 jsp
3 months ago
brongniart dfa5813ace style Profil
3 months ago
Maxime ROCHER f61062ae8a style Accueil quote & review style recherche
3 months ago
Kevin MONDEJAR 0b226224cf Merge pull request 'modifCitation' (#25) from modifCitation into master
3 months ago
kevin.modejar 48c5114e0c merge modifCitation
3 months ago
kevin.modejar 4c365356a2 ajourt type de source
3 months ago
Maxime ROCHER 37f0c11f4c fix AccueilQuiz
3 months ago
Maxime ROCHER 342a9f1de8 Merge branch 'ajoutQuiz' of https://codefirst.iut.uca.fr/git/WikiFantasy/WF-Website into ajoutQuiz
3 months ago
Maxime ROCHER a38e64c2bc t
3 months ago
kevin.modejar 5090c8407e Page d'erreur
3 months ago
Maxime ROCHER 7e553a63e7 Merge branch 'ajoutQuiz' of https://codefirst.iut.uca.fr/git/WikiFantasy/WF-Website into ajoutQuiz
3 months ago
Maxime ROCHER 82b2b047c5 modifs CSS +ajout font
3 months ago
kevin.modejar cd767ee45a j'avais oublier un <<
3 months ago
kevin.modejar ca81cd84bf merge
3 months ago
kevin.modejar c25b7b5030 Submit Quote
3 months ago
kevin.modejar fda3d1e68f Submit Quote
3 months ago
kevin.modejar 60e2f0729f resolution conflit
3 months ago
kevin.modejar c86de066fd modif ajout citation
3 months ago
kevin.modejar ccc48431e8 debut ajout quiz aléatoire
3 months ago
Maxime ROCHER 8c848bc67d ajout liste quiz
3 months ago
kevin.modejar ab176cb06e modif quiz
3 months ago

@ -1,2 +1,73 @@
# WikiFantasyWeb # Projet web What the Fantasy
Current deployment state : [![Build Status](https://codefirst.iut.uca.fr/api/badges/WhatTheFantasy/WF-Website/status.svg)](https://codefirst.iut.uca.fr/WhatTheFantasy/WF-Website)
## Description
Le site **What the Fantasy** est une application web permettant aux utilisateurs de découvrir des citations célèbres du monde de la fantasy. En plus de pouvoir lire et apprécier les citations, les utilisateurs peuvent créer un compte pour interagir avec elles en les likant, en les commentant, et en participant à des quiz à thème ou aléatoires.
### Fonctionnalités principales
- **Découverte de citations** : Parcourez une large sélection de citations tirées de l'univers de la fantasy.
- **Interaction avec les citations** : Les utilisateurs connectés peuvent **liker** et **commenter** les citations.
- **Création de compte utilisateur** : Inscription et connexion des utilisateurs pour accéder à des fonctionnalités supplémentaires.
- **Quiz interactifs** : Les utilisateurs peuvent participer à des quiz à thème (par exemple, quiz sur les personnages de la fantasy) ou un quiz aléatoire pour deviner qui a dit une citation parmi une liste d'auteurs célèbres.
## Prérequis
Avant d'exécuter le site, vous devez avoir installé les éléments suivants sur votre machine :
- **Apache2** : Le serveur web Apache2 pour héberger le site.
- [Installation d'Apache2](https://httpd.apache.org/docs/)
- **PHP** : Le langage côté serveur utilisé pour gérer la logique d'interaction et les données dynamiques.
- Vous pouvez installer PHP sur votre serveur via [ces instructions](https://www.php.net/manual/en/install.php).
- **PostgreSQL** : La base de données pour stocker les utilisateurs, citations et résultats des quiz.
- [Installation de PostgreSQL](https://www.postgresql.org/download/)
- **JavaScript** : Pour les fonctionnalités interactives côté client.
## Installation
### 1. Cloner le dépôt
Clonez le dépôt Git sur votre machine locale avec la commande suivante :
```bash
git clone https://codefirst.iut.uca.fr/git/WhatTheFantasy/WF-Website.git
```
### 2. Installer Apache2, PHP et MySQL/MariaDB
**Sur Ubuntu/Debian (exemple d'installation) :**
```bash
sudo apt update
sudo apt install apache2
```
Cela installera Apache2.
**Lancer le serveur Apache**
Assurez-vous que le serveur Apache2 est en fonctionnement. Sur Ubuntu/Debian, vous pouvez redémarrer Apache avec la commande suivante :
```bash
sudo systemctl restart apache2
```
**Sur Windows :**<br/>
Téléchargez et installez [XAMPP](https://www.apachefriends.org/download.html), qui inclut Apache, PHP
## Auteurs
BRONGNIART Kentin<br/>
BEAULATON Léni<br/>
ROCHER Maxime<br/>
MONDEJAR Kevin<br/>
GUICHARD-MONTGUERS Louis<br/>
NGUYEN Tommy<br/>

@ -13,10 +13,11 @@ $login = '';
$mdp = ''; $mdp = '';
//$racine='/~kemondejar/WF-Website'; // /~kekentin/WF/WF-Website /~lebeaulato/WF-Website /~kemondejar/WF-Website
$racine='/~marocher8/WF-Website';
$racine='/~lebeaulato/WF-Website'; // /~kekentin/WF/WF-Website /~lebeaulato/WF-Website /~kemondejar/WF-Website //$repImg='/home/UCA/kemondejar/public_html/WF-Website/public/images/';
//$racine='/WF-Website'; $repImg='/';
@ -33,6 +34,11 @@ $vues['create'] = 'vue/create.php';
$vues['quiz'] = 'vue/quiz.php'; $vues['quiz'] = 'vue/quiz.php';
$vues['endQuiz'] = 'vue/endQuiz.php'; $vues['endQuiz'] = 'vue/endQuiz.php';
$vues['submitQuote'] = 'vue/submitQuote.php'; $vues['submitQuote'] = 'vue/submitQuote.php';
$vues['recap'] = 'vue/recap.php';
$vues['accueilQuiz'] = 'vue/accueilQuiz.php';
$vues['quizRandom'] = 'vue/quizRandom.php';
$vues['endQuizRandom'] = 'vue/endQuizRandom.php';
//Style css //Style css

@ -0,0 +1,3 @@
<svg width="87" height="87" viewBox="0 0 87 87" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M74.6088 3.04338L75.4246 2.22758C76.0386 1.6139 76.7675 1.12717 77.5696 0.795191C78.3717 0.463209 79.2314 0.292471 80.0995 0.292725C80.9676 0.292979 81.8271 0.464221 82.629 0.796673C83.431 1.12912 84.1596 1.61628 84.7732 2.23031C85.3869 2.84435 85.8736 3.57325 86.2056 4.37539C86.5375 5.17753 86.7083 6.0372 86.708 6.90533C86.7078 7.77345 86.5365 8.63303 86.2041 9.43497C85.8716 10.2369 85.3845 10.9655 84.7705 11.5792L83.9547 12.3895C85.3502 13.9547 86.0942 15.9944 86.0341 18.0905C85.9741 20.1866 85.1145 22.1803 83.6317 23.663L27.2828 80.0192C26.9305 80.3696 26.4895 80.6175 26.0071 80.7364L4.10699 86.2116C3.64869 86.3257 3.16866 86.3193 2.71356 86.1931C2.25846 86.0668 1.84377 85.8249 1.50981 85.4909C1.17584 85.1569 0.933963 84.7422 0.807679 84.2871C0.681396 83.832 0.675004 83.352 0.789126 82.8936L6.26415 60.9929C6.38394 60.5124 6.63182 60.0734 6.98138 59.7226L59.7715 6.93077C59.2436 6.55917 58.6012 6.38613 57.9581 6.44224C57.3149 6.49834 56.7122 6.77997 56.2566 7.23738L38.2328 25.2672C37.9783 25.5217 37.6761 25.7236 37.3436 25.8614C37.011 25.9991 36.6546 26.07 36.2946 26.07C35.9347 26.07 35.5783 25.9991 35.2457 25.8614C34.9132 25.7236 34.611 25.5217 34.3565 25.2672C34.102 25.0127 33.9001 24.7105 33.7623 24.3779C33.6246 24.0454 33.5537 23.6889 33.5537 23.329C33.5537 22.969 33.6246 22.6126 33.7623 22.28C33.9001 21.9475 34.102 21.6453 34.3565 21.3908L52.3912 3.36642C53.8748 1.88272 55.87 1.02315 57.9673 0.964094C60.0646 0.905041 62.105 1.65099 63.6697 3.04886C65.1741 1.70436 67.1207 0.960681 69.1382 0.959672C71.1558 0.958662 73.1032 1.70039 74.6088 3.04338Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 28 KiB

@ -15,7 +15,7 @@ if(!isset($_SESSION['theme'])){
require_once __DIR__ . '/config/config.php'; require_once __DIR__ . '/config/config.php';
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
//$co = new \Gateway\Connection('pgsql:host=localhost;dbname=wikifantasy3;', 'postgres', 'postgres'); //$co = new \Gateway\Connection('pgsql:host=localhost;dbname=wikifantasy3;', 'postgres', 'sucepute');
$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd'); $co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd');
//twig //twig

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 28 KiB

@ -1,25 +1,31 @@
/* @import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap'); */ /* @import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap'); */
@import url(./styleScroll.css); @import url(./styleScroll.css);
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
:root { :root {
--main-dark-background-color: #120B1D; --main-dark-background-color: #120B1D;
--main-dark-text-color : #ffffff; --main-dark-text-color : #ffffff;
--main-dark-gradient : linear-gradient(45deg, #4a148c, #7b1fa2); --main-dark-gradient : linear-gradient(45deg, #4a148c, #7b1fa2);
--main-dark-other-color : #000000; --main-dark-other-color : #000000;
--main-light-background-color: #cccccc; --main-light-background-color: #ffffff;
/*--main-light-background-color: #ffffff;*/ --main-light-text-color : #000000;
--main-light-text-color : #000; /*--main-light-gradient : linear-gradient(90deg, #46BE73, #BAEBF6);*/
--main-light-gradient : linear-gradient(90deg, #46BE73, #BAEBF6); /*--main-light-gradient : linear-gradient(90deg, #AAB9CF, #BDD4E7);*/
/*--main-light-gradient : linear-gradient(-90deg, #f3e0f7, #dd9aff);*/ --main-light-gradient : #84e4a9;
/*--main-light-gradient : linear-gradient(45deg, #73CFF6, #DE95CA);*/
--main-light-other-color : #46BE73; --main-light-other-color : #46BE73;
/*--main-light-other-color : #f8eaff;*/ /* --main-light-gradient : #94d3ac;
/*--main-light-other-color : #d2d2d8;*/ --main-light-other-color : #75b48d; */
} }
*{
font-family: "roboto condensed", sans-serif;
font-weight: 600;
}
/* Général */ /* Général */
body{ body{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
margin : 0%; margin : 0%;
} }
@ -62,7 +68,7 @@ body.dark-mode .header{
/* Light mode */ /* Light mode */
body.light-mode{ body.light-mode{
background-color: var(--main-light-background-color); background-image: url("../../images/chaos.png");
color: var(--main-light-text-color); color: var(--main-light-text-color);
} }
@ -96,7 +102,7 @@ body.light-mode .header img{
} }
.light-mode .theme-icon:hover, .light-mode .nav a:hover { .light-mode .theme-icon:hover, .light-mode .nav a:hover {
filter: brightness(0) saturate(100%) invert(84%) sepia(88%) saturate(6613%) hue-rotate(276deg) brightness(89%) contrast(95%); filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(271deg) brightness(103%) contrast(101%);
} }
/* écran par défaut */ /* écran par défaut */
@ -171,6 +177,18 @@ body{
height : 7vh; height : 7vh;
} }
.error{
display:block;
margin-top: 30vh;
text-align: center;
font-size: 5em;
}
.explanation{
text-align: center;
font-size: 3em;
}
/* écran tablette*/ /* écran tablette*/
@media (max-width: 834px) or (max-aspect-ratio : 1/1){ @media (max-width: 834px) or (max-aspect-ratio : 1/1){

@ -30,4 +30,69 @@ body.light-mode .citation-du-jour {
transform: scale(1.02); transform: scale(1.02);
z-index: 5; z-index: 5;
position: relative; position: relative;
} }
/* ====== PAGINATION STYLES ====== */
.pagination-container {
display: flex;
justify-content: center;
align-items: center;
margin: 20px 0;
}
.pagination-container select {
display: flex;
justify-content: center;
align-items: center;
margin: 0 10px;
padding: 5px;
font-size: 16px;
border-radius: 5px;
border: 1px solid #ccc;
}
.pagination-container button {
display: flex;
justify-content: center;
align-items: center;
background: var(--main-light-gradient);
border: none;
border-radius: 5px;
padding: 5px 10px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s ease;
}
.pagination-container button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Spinner style */
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
border-left-color: #000;
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
margin-left: 10px;
display: none;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Adaptation pour dark mode */
body.dark-mode .pagination-container button {
background: var(--main-dark-gradient);
color: #fff;
}
body.dark-mode .pagination-container select {
border: 1px solid #555;
background: #333;
color: #fff;
}

@ -0,0 +1,76 @@
@import url(./style.css); /* Import de style.css */
h2{
text-align: center;
font-size: 2em;
padding-top: 15px;
font-weight: bolder;
}
h3{
text-align: center;
margin-left: 15px;
margin-right: 15px;
margin-top: -5px;
text-decoration: none;
}
a{
text-decoration: none;
}
.linkQuiz img{
width: 14vw;
height: 22vh;
object-fit: cover;
border-radius: 10px 10px 0px 0px;
margin : 10px;
}
.quizCard{
text-align: center;
border-radius: 15px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
}
.quiz-container{
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: start;
align-items: self-start;
gap: 2vw;
margin-top: 2em;
min-height: 68vh;
width: 95vw;
padding: 15px;
border-radius: 15px;
}
/* Dark mode */
.dark-mode h3 {
color: white;
}
.dark-mode .quizCard {
background: var(--main-dark-gradient);
}
.dark-mode .quiz-container {
background: black;
}
/* Light mode */
.light-mode h3 {
color: black;
}
.light-mode .quizCard {
background: var(--main-light-gradient);
}
.light-mode .quiz-container {
background: #46BE73;
}

@ -1 +1,70 @@
@import url(./style.css); /* Import de style.css */ @import url(./style.css);
body.dark-mode .creation form.add {
background-color: var(--main-dark-other-color);
border-radius: 25px;
padding: 20px;
max-width: 600px;
margin: 40px auto;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
color: var(--main-dark-text-color);
}
body.light-mode .creation form.add {
background-color: var(--main-light-other-color);
border-radius: 25px;
padding: 20px;
max-width: 600px;
margin: 40px auto;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
color: var(--main-light-text-color);
}
.creation form.add input[type="text"],
.creation form.add input[type="number"],
.creation form.add textarea {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
}
.creation form.add input[type="file"] {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border-radius: 5px;
box-sizing: border-box;
}
.creation form.add input[type="radio"] {
width: auto;
margin-right: 5px;
vertical-align: middle;
}
.creation form.add label {
display: block;
margin-bottom: 5px;
}
.creation form.add input[type="submit"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #ffffff;
cursor: pointer;
transition: background-color 0.3s ease;
}
.creation form.add input[type="submit"]:hover {
background-color: #f9f9f9;
}
.creation form.add h1 {
text-align: center;
margin-bottom: 20px;
}

@ -27,7 +27,7 @@ body.light-mode .resultat {
/* ====== ECRAN DEFAUT ====== */ /* ====== ECRAN DEFAUT ====== */
h1 { h1 {
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
text-align: center; text-align: center;
} }

@ -61,7 +61,7 @@ body.light-mode a{
} }
h1{ h1{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
text-align: center; text-align: center;
font-size: 32px; font-size: 32px;
margin-top: 10%; margin-top: 10%;
@ -71,7 +71,7 @@ p{
margin-top: 6%; margin-top: 6%;
margin-bottom: 2%; margin-bottom: 2%;
font-size: 20px; font-size: 20px;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
.login{ .login{
@ -88,11 +88,11 @@ p{
font-size: 1em; font-size: 1em;
text-align: center; text-align: center;
padding-top: 1%; padding-top: 1%;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
.buttonSudmite{ .buttonSudmite{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
border: none; border: none;
padding: 2%; padding: 2%;
border-radius: 25px; border-radius: 25px;

@ -34,7 +34,7 @@ body.dark-mode .imgModify{
body.light-mode .inputPasswd{ body.light-mode .inputPasswd{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
margin-top: 2%; margin-top: 2%;
color: black; color: black;
} }
@ -77,7 +77,7 @@ body.light-mode .login{
body.light-mode .inputPasswd{ body.light-mode .inputPasswd{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
margin-top: 2%; margin-top: 2%;
color: black; color: black;
} }
@ -90,7 +90,7 @@ body.light-mode .saveButtonPasswd {
/* ====== ECRAN DEFAUT ====== */ /* ====== ECRAN DEFAUT ====== */
h1{ h1{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
text-align: center; text-align: center;
font-size: 35px; font-size: 35px;
} }
@ -99,7 +99,7 @@ p{
margin-top: 4%; margin-top: 4%;
margin-bottom: 2%; margin-bottom: 2%;
font-size: 20px; font-size: 20px;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
::backdrop { ::backdrop {
@ -110,10 +110,15 @@ p{
height: 60%; height: 60%;
font-size: 15px; font-size: 15px;
text-align: center; text-align: center;
<<<<<<< HEAD
justify-content: start;
align-items: flex-start;
font-family: "Lemon", serif; font-family: "Lemon", serif;
=======
font-family: "roboto condensed", sans-serif;
>>>>>>> 3403a5592cdba73a03915da872f39aba764534a6
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
border: 15px solid; border: 15px solid;
border-radius: 20px; border-radius: 20px;
} }
@ -132,7 +137,7 @@ p{
} }
.buttonSudmite{ .buttonSudmite{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
border: none; border: none;
padding: 2%; padding: 2%;
border-radius: 25px; border-radius: 25px;
@ -146,7 +151,7 @@ p{
font-size: 15px; font-size: 15px;
text-align: center; text-align: center;
padding-top: 1%; padding-top: 1%;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
.login{ .login{
@ -172,7 +177,7 @@ p{
border-radius: 25px; border-radius: 25px;
border: none; border: none;
font-size: 15px; font-size: 15px;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }

@ -22,7 +22,7 @@ body.dark-mode .submit-button {
body.dark-mode .buttonSudmite { body.dark-mode .buttonSudmite {
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%); background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
border: none; border: none;
color: white; color: white;
padding: 10px 20px; padding: 10px 20px;
@ -50,7 +50,7 @@ body.light-mode .answer {
/* ====== ECRAN DEFAUT ====== */ /* ====== ECRAN DEFAUT ====== */
h1, h2, p { h1, h2, p {
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
text-align: center; text-align: center;
} }

@ -160,7 +160,7 @@ body.light-mode .like-icon-none img {
background-color: #fff; background-color: #fff;
color: black; color: black;
display: flex; display: flex;
font-family: "Lemon", sans-serif; font-family: "roboto condensed", sans-serif;
flex-direction: column; flex-direction: column;
margin-bottom: 1vh; margin-bottom: 1vh;
border-radius: 20px; border-radius: 20px;

@ -37,6 +37,7 @@ a.link-citation:hover {
justify-content: space-around; justify-content: space-around;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
font-size: medium;
} }
a.link-citation { a.link-citation {

@ -1,120 +0,0 @@
/* Conteneur pour les suggestions en deux colonnes */
.suggestions-container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
width: 100%;
margin: 0 auto;
}
a.link-citation {
text-decoration: none;
color: white;
width: 47.5%;
height: 100%;
}
/* Citations */
.citation-container {
background: linear-gradient(to right, #4a148c, #7b1fa2);
border-radius: 12px;
color: white;
display: flex;
width: 100%;
align-items: flex-start;
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;
}
.quote {
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;
}
.quoteContent {
font-size: 1.2em;
margin-bottom: 10px;
font-style: italic;
}
.citation .movie, .character, .year {
margin-bottom: 5px;
}
/* Mode sombre */
body.dark-mode .quote {
background: linear-gradient(45deg, #4a148c, #7b1fa2);
color:white;
}
/* Mode clair */
body.light-mode .quote {
background-image: linear-gradient(-28deg, #f3e7e9 0%, #e3eeff 99%, #e3eeff 100%);
color:black; /* Changer le texte en noir pour le mode clair */
}
body.light-mode .citation,
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;
}
}

@ -117,6 +117,13 @@ body.dark-mode .filtre label {
body.light-mode .search-container { body.light-mode .search-container {
background: #ccc; background: #ccc;
} }
.light-mode form {
background-color: #fff;
margin-top: -30px;
padding-top: 35px;
}
body.light-mode .search-container input[type="search"] { body.light-mode .search-container input[type="search"] {
color: #000; color: #000;
} }
@ -141,4 +148,63 @@ body.light-mode .filtre label {
color: #000000; color: #000000;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
} }
/* ====== PAGINATION STYLES ====== */
.pagination-container {
display: flex;
justify-content: center;
align-items: center;
margin: 20px 0;
}
.pagination-container select {
margin: 0 10px;
padding: 5px;
font-size: 16px;
border-radius: 5px;
border: 1px solid #ccc;
}
.pagination-container button {
background: var(--main-light-gradient);
border: none;
border-radius: 5px;
padding: 5px 10px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s ease;
}
.pagination-container button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Spinner style */
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
border-left-color: #000;
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
margin-left: 10px;
display: none;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Adaptation pour dark mode */
body.dark-mode .pagination-container button {
background: var(--main-dark-gradient);
color: #fff;
}
body.dark-mode .pagination-container select {
border: 1px solid #555;
background: #333;
color: #fff;
}

@ -50,7 +50,7 @@ body.light-mode a{
/* ====== ECRAN DEFAULT ====== */ /* ====== ECRAN DEFAULT ====== */
h1{ h1{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
text-align: center; text-align: center;
font-size: 32px; font-size: 32px;
margin-top: 10%; margin-top: 10%;
@ -68,7 +68,7 @@ p{
margin-top: 4%; margin-top: 4%;
margin-bottom: 2%; margin-bottom: 2%;
font-size: 20px; font-size: 20px;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
.confirmer{ .confirmer{
@ -87,7 +87,7 @@ p{
} }
.btn{ .btn{
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
border: none; border: none;
padding: 2%; padding: 2%;
border-radius: 25px; border-radius: 25px;
@ -101,7 +101,7 @@ p{
font-size: 1em; font-size: 1em;
text-align: center; text-align: center;
padding-top: 1%; padding-top: 1%;
font-family: "Lemon", serif; font-family: "roboto condensed", sans-serif;
} }
.createAccount{ .createAccount{

@ -1,31 +1,30 @@
@import url(./style.css); @import url(./style.css);
/* ====== DARK MODE ====== */ /* ====== DARK MODE ====== */
body.dark-mode h1,
body.dark-mode h1, body.dark-mode h2, body.dark-mode p { body.dark-mode h2,
body.dark-mode p {
color: var(--main-dark-text-color); color: var(--main-dark-text-color);
} }
body.dark-mode #box{ body.dark-mode #box {
background: var(--main-dark-other-color); background: var(--main-dark-other-color);
} }
/* ====== LIGHT MODE ====== */ /* ====== LIGHT MODE ====== */
body.light-mode h1,
body.light-mode h1, body.light-mode h2, body.light-mode p { body.light-mode h2,
body.light-mode p {
color: var(--main-light-text-color); color: var(--main-light-text-color);
} }
body.light-mode #box{ body.light-mode #box {
background: var(--main-light-other-color); background: var(--main-light-other-color);
} }
/* ====== ECRAN DEFAULT ====== */ /* ====== ECRAN DEFAULT ====== */
h1, h2 {
h1, h2{ font-family: "roboto condensed", sans-serif;
font-family: "Lemon", serif;
text-align: center; text-align: center;
} }
@ -39,13 +38,75 @@ h1, h2{
border-radius: 25px; border-radius: 25px;
} }
/* ====== STYLE SPÉCIFIQUE AU FORMULAIRE ====== */
#form select,
#form textarea {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 15px;
box-sizing: border-box;
}
#form input[type="submit"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #ffffff;
cursor: pointer;
transition: background-color 0.3s ease;
}
#form input[type="submit"]:hover {
background-color: #f9f9f9;
}
/* ====== STYLE SPÉCIFIQUE À LA PAGE DE CONFIRMATION ====== */
/* Espacement entre les blocs internes */
#box > div {
margin-bottom: 15px;
}
/* Style pour les libellés */
#box p {
margin: 0;
font-weight: bold;
}
/* Style pour les valeurs affichées */
#box h2 {
margin: 5px 0 0 0;
font-weight: normal;
}
/* ====== DIVERS ====== */ /* Style du bouton de retour */
#contentField, #characterField, #sourceField, #imageField { #box button {
align-self: center;
width: 60%;
padding: 20px;
margin : 20px 20% ;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
font-size: 1rem;
} }
#contentField p, #characterField p, #sourceField p, #imageField p { /* Bouton en dark mode */
body.dark-mode #box button {
background-color: #ffffff;
color: black;
} }
#confirm { /* Bouton en light mode */
} body.light-mode #box button {
background-color: #ffffff;
color: black;
}
#box button:hover {
background-color: #f9f9f9;
}

@ -1,108 +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%;
}
.search {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
vertical-align: center;
margin: 10px;
width: 70px;
height: 70px;
border-radius: 50%;
}
/* 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%);
}
body.dark-mode .search {
background: white;
}
/* Mode clair */
body.light-mode {
background-color: #ffffff;
color: #000000;
}
body.light-mode .header {
background-color: #F4F1DE;
}
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%);
}
body.light-mode .search {
background: black;
}

@ -16,7 +16,7 @@ Class FrontControler{
global $twig,$racine; global $twig,$racine;
$this->listAction = ['visitor' => array('accueil','search','quote','login','signin','validlogin','validsignin'), $this->listAction = ['visitor' => array('accueil','search','quote','login','signin','validlogin','validsignin'),
'user' => array('quiz','commentary','logout','addComment','favorite','profil','addFav','supFav','changedata', 'submit', 'validsubmit', 'add','deleteAccount'), 'user' => array('quiz','randomQuiz','commentary','logout','addComment','favorite','profil','addFav','supFav','changedata', 'submit', 'validsubmit', 'add', 'accueilQuiz', 'deleteAccount'),
'admin' => array('null')]; 'admin' => array('null')];
$dVueEreur = []; $dVueEreur = [];
@ -52,16 +52,20 @@ Class FrontControler{
$router->map('GET|POST', '/supFav/[i:id]', 'UserControler','supFav'); $router->map('GET|POST', '/supFav/[i:id]', 'UserControler','supFav');
$router->map('GET|POST', '/changedata', 'UserControler','changedata'); $router->map('GET|POST', '/changedata', 'UserControler','changedata');
$router->map('GET|POST', '/submit', 'UserControler', 'submit'); $router->map('GET|POST', '/submit', 'UserControler', 'submit');
$router->map('GET|POST', '/validsubmit', 'UserControler', 'validsubmit'); $router->map('GET|POST', '/validsubmit', 'UserControler','validsubmit');
$router->map('GET|POST', '/add', 'UserControler', 'add'); $router->map('GET|POST', '/add', 'UserControler', 'add');
$router->map('GET|POST', '/accueilQuiz', 'UserControler', 'accueilQuiz');
$router->map('GET|POST', '/error', 'VisitorControler','error');
$router->map('GET|POST', '/randomQuiz', 'UserControler','randomQuiz');
$router->map('GET|POST', '/deleteAccount', 'UserControler', 'deleteAccount'); $router->map('GET|POST', '/deleteAccount', 'UserControler', 'deleteAccount');
$match = $router->match(); $match = $router->match();
$action = NULL; $action = NULL;
if(!$match){ if(!$match){
$dVueEreur[] = "Requête introuvable"; $dVueEreur = [404,"Page non trouvée"];
$this->vueErreur($dVueEreur); $this->vueErreur($dVueEreur);
} }
else{ else{
@ -71,7 +75,7 @@ Class FrontControler{
//Si existe, on lappelle //Si existe, on lappelle
if(!$this->ifExisteAction($action)){ if(!$this->ifExisteAction($action)){
$dVueEreur[] = "Action introuvable"; $dVueEreur = [404,"Action non trouvée"];
$this->vueErreur($dVueEreur); $this->vueErreur($dVueEreur);
} }
@ -112,9 +116,8 @@ Class FrontControler{
return false; return false;
} }
private function vueErreur(array $dVueErreur){ private function vueErreur(array $erreur){
global $vues; global $vues;
echo "{$dVueErreur[0]}";
require_once $vues['erreur']; require_once $vues['erreur'];
} }

@ -29,20 +29,113 @@ class UserControler {
private CommentaryModel $cMod; private CommentaryModel $cMod;
private UserModel $uMod; private UserModel $uMod;
private QuoteModel $qMod; private QuoteModel $qMod;
private QuestionModel $mdl;
private CharacterModel $caMod; private CharacterModel $caMod;
private SourceModel $srcMod; private SourceModel $srcMod;
private QuestionModel $questMod;
private ImageModel $iMod; private ImageModel $iMod;
private QuizModel $quizModel;
public function __construct() { public function __construct() {
global $co; global $co;
$this->cMod = new CommentaryModel(new CommentaryGateway($co)); $this->cMod = new CommentaryModel(new CommentaryGateway($co));
$this->uMod = new UserModel(new UserGateway($co)); $this->uMod = new UserModel(new UserGateway($co));
$this->qMod = new QuoteModel(new QuoteGateway($co)); $this->qMod = new QuoteModel(new QuoteGateway($co));
$this -> mdl = new QuestionModel(new QuestionGateway($co)); $this -> questMod = new QuestionModel(new QuestionGateway($co));
$this -> caMod = new CharacterModel(new CharacterGateway($co)); $this -> caMod = new CharacterModel(new CharacterGateway($co));
$this->srcMod = new SourceModel(new SourceGateway($co)); $this->srcMod = new SourceModel(new SourceGateway($co));
$this->iMod = new ImageModel(new ImageGateway($co)); $this->iMod = new ImageModel(new ImageGateway($co));
$this->quizModel = new QuizModel(new QuizGateway($co));
}
public function accueilQuiz() {
global $vues;
$quizs = $this->quizModel->listQuiz();
require_once $vues['accueilQuiz'];
}
public function randomQuiz() {
global $vues;
$canswer = Verification::verifChar($_POST['canswer'] ?? null);
/*---------------------------------------------*/
if(!isset($_SESSION["no_question"])){
$no_question = 0;
}
else{
$no_question = Verification::verifChar($_SESSION["no_question"]);
if($canswer!=null){
$no_question=$no_question+1;
}
if($no_question < 1 ){
$no_question = 0;
}
}
$_SESSION["no_question"]=$no_question;
/*---------------------------------------------*/
if(!isset($_SESSION["nbVie"])){
$vie = 3;
}
else{
$vie = Verification::verifChar($_SESSION["nbVie"]) ;
if($vie > 3 ){
$vie = 3;
}
elseif($vie < 1){
$vie = 0;
}
}
/*---------------------------------------------*/
$answera = Verification::verifChar($_POST['answera'] ?? null);
$answerb = Verification::verifChar($_POST['answerb'] ?? null);
$answerc = Verification::verifChar($_POST['answerc'] ?? null);
$answerd = Verification::verifChar($_POST['answerd'] ?? null);
$answer = null;
if ($answera) {
$answer = $answera;
} elseif ($answerb) {
$answer = $answerb;
} elseif ($answerc) {
$answer = $answerc;
} elseif ($answerd) {
$answer = $answerd;
}
if($answer != $canswer){
$vie=$vie-1;
}
/*---------------------------------------------*/
$_SESSION["nbVie"]=$vie;
if($vie<=0){
$score=($no_question - 3);
$next=false;
$nbQuestion=$no_question;
unset($_SESSION["no_question"]);
unset($_SESSION["nbVie"]);
require_once $vues['endQuizRandom'];
}
else{
/*---------------------------------------------*/
$question = $this->questMod->QuestionForQuoteToCarac('fr');
require_once $vues['quizRandom'];
}
} }
public function profil() { public function profil() {
@ -145,10 +238,12 @@ class UserControler {
$gw = new QuizGateway($co); $gw = new QuizGateway($co);
$mdl = new QuizModel($gw); $mdl = new QuizModel($gw);
$nbQuestion = $this->getNumberOfQuestion($id_quiz);
if ($mdl->getQuiz($id_quiz + 1)){ if ($mdl->getQuiz($id_quiz + 1)){
$next = true;
require_once $vues['endQuiz']; require_once $vues['endQuiz'];
} }
$next = false;
require_once $vues['endQuiz']; require_once $vues['endQuiz'];
} }
@ -174,7 +269,7 @@ class UserControler {
$answer = explode('-', $answerd)[0]; $answer = explode('-', $answerd)[0];
$id = (int) explode('-', $answerd)[1]; $id = (int) explode('-', $answerd)[1];
} }
$res = $this->mdl->getQuestion($id); $res = $this->questMod->getQuestion($id);
return $answer == $res->getCanswer(); return $answer == $res->getCanswer();
} }
@ -195,11 +290,20 @@ class UserControler {
$q = $this->GetQuestion($id); $q = $this->GetQuestion($id);
$question = $q[$num] ?? $q[0]; $question = $q[$num] ?? $q[0];
$idquestion = $question->getIdQuestion(); $idquestion = $question->getIdQuestion();
$nbQuestion = $this->getNumberOfQuestion($id);
require_once $vues['quiz']; require_once $vues['quiz'];
//echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]); //echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]);
} }
public function getQuiz(int $id) : QuizModel
{
global $co;
$gw = new QuizGateway($co);
$mdl = new QuizModel($gw);
return $mdl->getQuiz($id);
}
public function getNumberOfQuestion(int $id) : int{ public function getNumberOfQuestion(int $id) : int{
global $co; global $co;
@ -333,46 +437,24 @@ class UserControler {
* @throws RuntimeError * @throws RuntimeError
* @throws LoaderError * @throws LoaderError
*/ */
public function toSubmit() : ?array{
public function toSubmit(string $content,string $character, string $source)
{
global $co; global $co;
if ($_POST) if ($_POST)
{ {
$content = $_POST['content'] ?? null;
$character = $_POST['character'] ?? null;
$source = $_POST['src'] ?? null;
//$img = $_POST['img'] ?? null;
$errors = [null, null]; $errors = [null, null];
$gw = new CharacterGateway($co); $nameSrc = $this->srcMod->getSourceById($source)->getTitle();
$mdl = new CharacterModel($gw); $nameChar = $this->caMod->getCharacterById($character)->getName();
$character = $mdl -> getCharacterById($character);
$gw = new SourceGateway($co);
$mdl = new SourceModel($gw);
$source = $mdl -> getSourceById($source);
if (!$character) if (!$character)
$errors[0] = "Personnage inexistant"; $errors[0] = "Personnage inexistant";
if (!$source) if (!$source)
$errors[1] = "Source inexistante"; $errors[1] = "Source inexistante";
if ($errors[0] || $errors[1]) $this -> qMod -> addQuote($content,'fr',$character,$source,$this->uMod->getIdByUsername(Verification::VerifChar($_SESSION['user'])));
{ $this -> recapSubmitQuote(array('content' => $content, 'src' => $nameSrc, 'character' => $nameChar));
global $twig;
$this->submit();
exit();
}
$gw = new QuoteGateway($co);
$mdl = new QuoteModel($gw);
//$mdl -> insert4User($content, '/imgPath', 'fr', $this -> getIdOfUser(), $source->getIdSource(), $character->getIdCharacter());
return [$content, $_POST['character'], $_POST['src']];
} }
return null;
} }
/** /**
@ -386,6 +468,8 @@ class UserControler {
global $vues; global $vues;
$src = true; $src = true;
$char = true; $char = true;
$srcId = null;
$charId = null;
require_once $vues['create']; require_once $vues['create'];
exit(); exit();
} }
@ -393,6 +477,8 @@ class UserControler {
global $vues; global $vues;
$src = true; $src = true;
$char = false; $char = false;
$srcId = null;
$charId = $_POST['character'];
require_once $vues['create']; require_once $vues['create'];
exit(); exit();
} }
@ -400,32 +486,25 @@ class UserControler {
global $vues; global $vues;
$src = false; $src = false;
$char = true; $char = true;
$srcId = $_POST['src'];
$charId = null;
require_once $vues['create']; require_once $vues['create'];
exit(); exit();
} }
if($_POST) $recap = $this -> toSubmit($_POST['content'],$_POST['character'],$_POST['src']);
$recap = $this -> toSubmit(); }
if ($recap)
{ public function recapSubmitQuote(array $recap){
$this -> recapSubmitQuote($recap); global $vues;
} require_once($vues["recap"]);
} }
// ===================== SUBMIT QUOTE FUNCTION ===================== // ===================== SUBMIT QUOTE FUNCTION =====================
/** public function getIdOfUser() : ?int
* @throws RuntimeError {
* @throws SyntaxError
* @throws LoaderError
*/
public function recapSubmitQuote(?array $recap) : void{
global $twig;
echo $twig -> render("recapSubmitQuote.html.twig", ['content' => $recap[0], 'character' => $recap[1], 'source' => $recap[2]]);
}
public function getIdOfUser() : ?int{
if (isset($_SESSION['user'])) if (isset($_SESSION['user']))
{ {
global $co; global $co;
@ -439,17 +518,18 @@ class UserControler {
public function add(){ public function add(){
global $vues; global $vues, $repImg;
var_dump($_POST);
$error = []; $error = [];
$src = false;
$char = false;
var_dump($_FILES);
if($_POST['req'] == "both"){ if($_POST['req'] == "both"){
$src = true; $src = true;
$char = true; $char = true;
} }
elseif($_POST['req'] == "src"){
$src = true; if($_POST['req'] == "src" or $src == true){
$char = false; $type = array("movie","serie","video-game","anime");
$type = array("Movie","Serie","VideoGame","Anime");
if(Verification::verifNotNull($_POST["titre"])){ if(Verification::verifNotNull($_POST["titre"])){
$_POST["titre"] = Verification::verifChar($_POST["titre"]); $_POST["titre"] = Verification::verifChar($_POST["titre"]);
if($this->srcMod->existSource($_POST["titre"],$_POST["type"])){ if($this->srcMod->existSource($_POST["titre"],$_POST["type"])){
@ -460,8 +540,6 @@ class UserControler {
$error[] = "Le titre doit être définit"; $error[] = "Le titre doit être définit";
} }
if(Verification::verifNotNull($_POST["date"])){ if(Verification::verifNotNull($_POST["date"])){
$src = true;
$char = false;
$_POST["date"] = Verification::verifChar($_POST["date"]); $_POST["date"] = Verification::verifChar($_POST["date"]);
if(intval($_POST["date"],10) < 1850 or intval($_POST["date"],10) > date( "Y", time() )){ if(intval($_POST["date"],10) < 1850 or intval($_POST["date"],10) > date( "Y", time() )){
$error[] = "La date est invalide"; $error[] = "La date est invalide";
@ -480,30 +558,66 @@ class UserControler {
$error[] = "Le type doit être définit"; $error[] = "Le type doit être définit";
} }
} }
elseif($_POST['req'] == "char"){
$src = false; if($_POST['req'] == "char" or $char == true){
$char = true; if(Verification::verifNotNull($_POST["name"])){
if(Verification::verifNotNull($_POST[""])){ $_POST["name"] = Verification::verifChar($_POST["name"]);
}
else{
$error[] = "Le nom doit être définit";
}
// upload de la photo
if (isset($_FILES['avatar'])) {
$tabExtension = explode('.', $_FILES['avatar']['name']);
$extension = strtolower(end($tabExtension));
$extensions = ['jpg', 'png', 'jpeg'];
if(in_array($extension, $extensions)){
move_uploaded_file($_FILES['avatar']['tmp_name'], $repImg.$_FILES['avatar']['name']);
$filePath = $repImg.$_FILES['avatar']['name'];
}
else{
$error[] = "Mauvaise extension";
exit();
}
}
else{
$error[] = "Aucune photo";
} }
} }
if($error == []){ if($error == []){
$recap['content'] = $_POST['content'];
if($_POST['req'] == "both"){ if($_POST['req'] == "both"){
$this->srcMod->createSource($_POST["titre"], $_POST["date"], TypeSourceEnum::from($_POST["type"]));
$idImg = $this->iMod->createImgModelWithoutId($filePath);
$this->caMod->createCharacterWithoutId($_POST["name"], $idImg);
$idC = $this-> caMod -> getCharacterByName($_POST["name"])->getIdCharacter();
$idS = $this -> srcMod -> getSourceByTitle($_POST["titre"])->getIdSource();
} }
elseif($_POST['req'] == "src"){ elseif($_POST['req'] == "src"){
$this->srcMod->createSource($_POST["titre"], $_POST["date"], $_POST["type"]); $this->srcMod->createSource($_POST["titre"], $_POST["date"], TypeSourceEnum::from($_POST["type"]));
$idC = Verification::VerifChar($_POST["character"]);
$idS = $this -> srcMod -> getSourceByTitle($_POST["titre"])->getIdSource();
} }
elseif($_POST['req'] == "char"){ elseif($_POST['req'] == "char"){
$idImg = $this->iMod->createImgModelWithoutId($filePath);
$this->caMod->createCharacterWithoutId($_POST["name"], $idImg);
$idC = $this-> caMod -> getCharacterByName($_POST["name"])->getIdCharacter();
$idS = Verification::VerifChar($_POST["src"]);
} }
$this -> toSubmit(Verification::VerifChar($_POST["content"]),$idC,$idS);
} }
else{ else{
require_once($vues["create"]); require_once($vues["create"]);
var_dump($error);
} }
} }
public function questionSuivantAleatoire(){
}
// ===================== DELETE ACCOUNT FUNCTION ===================== // ===================== DELETE ACCOUNT FUNCTION =====================

@ -56,10 +56,21 @@ Class VisitorControler {
public function quote(array $arg){ public function quote(array $arg){
global $vues; global $vues;
$id= $arg['idQuote'] ?? 1; $id= $arg['idQuote'] ?? 1;
if($id > 999999999){
$erreur = [404,"Citation inexistante pour le moment",'../'];
require_once($vues['erreur']);
exit();
}
$f = $this->uMod->isFavorite($_SESSION["user"],$id); $f = $this->uMod->isFavorite($_SESSION["user"],$id);
$q = $this->qMod->searchId($id); $q = $this->qMod->searchId($id);
$c = $this->cMod->getComment($id); $c = $this->cMod->getComment($id);
require_once $vues['quote']; if($q->getContent() != 'NULL'){
require_once $vues['quote'];
}
else{
$erreur = [404,"Citation inexistante pour le moment","../"];
require_once($vues['erreur']);
}
} }
public function favorite() { public function favorite() {

@ -4,18 +4,26 @@ namespace Entity;
class QuizEntity class QuizEntity
{ {
private int $id_quiz; public int $id_quiz;
private int $nb_questions; public int $nb_quest;
public string $imgPath;
public string $title;
/** /**
* @param int $id_quiz * @param int $id_quiz
* @param int $nb_questions * @param int $nb_quest
* @param string $imgPath
* @param string $title
*/ */
public function __construct(int $id_quiz, int $nb_questions) public function __construct(int $id_quiz, int $nb_quest, string $imgPath, string $title)
{ {
$this->id_quiz = $id_quiz; $this->id_quiz = $id_quiz;
$this->nb_questions = $nb_questions; $this->nb_quest = $nb_quest;
$this->imgPath = $imgPath;
$this->title = $title;
} }
/** /**
@ -39,18 +47,46 @@ class QuizEntity
*/ */
public function getNbQuestions(): int public function getNbQuestions(): int
{ {
return $this->nb_questions; return $this->nb_quest;
} }
/** /**
* @param int $nb_questions * @param int $nb_quest
*/ */
public function setNbQuestions(int $nb_questions): void public function setNbQuestions(int $nb_quest): void
{ {
$this->nb_questions = $nb_questions; $this->nb_quest = $nb_quest;
} }
/**
* @return string
*/
public function getIdImg(): string
{
return $this->imgPath;
}
/**
* @param string $imgPath
*/
public function setIdImg(string $imgPath): void
{
$this->imgPath = $imgPath;
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @param string $title
*/
public function setTitle(string $title): void
{
$this->title = $title;
}
} }

@ -1,6 +1,8 @@
<?php <?php
namespace Entity; namespace Entity;
use Enum\TypeSourceEnum;
class Quote{ class Quote{
private int $id; private int $id;
@ -11,6 +13,7 @@
private string $dateSrc; private string $dateSrc;
private int $like; private int $like;
private string $langue; private string $langue;
private TypeSourceEnum $type;
/** /**
* @param int $id * @param int $id
@ -22,7 +25,7 @@
* @param int $like * @param int $like
* @param string $langue * @param string $langue
*/ */
public function __construct(int $id, string $content, string $carac, string $imgPath, string $titleSrc, string $dateSrc, int $like, string $langue) public function __construct(int $id, string $content, string $carac, string $imgPath, string $titleSrc, string $dateSrc, int $like, string $langue, TypeSourceEnum $type)
{ {
$this->id = $id; $this->id = $id;
$this->content = $content; $this->content = $content;
@ -32,6 +35,7 @@
$this->dateSrc = $dateSrc; $this->dateSrc = $dateSrc;
$this->like = $like; $this->like = $like;
$this->langue = $langue; $this->langue = $langue;
$this->type = $type;
} }
/** /**
@ -162,7 +166,13 @@
$this->langue = $langue; $this->langue = $langue;
} }
public function getType(): TypeSourceEnum{
return $this->type;
}
public function setType(TypeSourceEnum $type){
$this->type = $type;
}
} }
?> ?>

@ -6,4 +6,14 @@ enum TypeSourceEnum : string {
case VideoGame = 'video-game'; case VideoGame = 'video-game';
case Anime = 'anime'; case Anime = 'anime';
case Serie = 'serie'; case Serie = 'serie';
public static function fromName(string $name): string
{
foreach (self::cases() as $status) {
if( $name === $status->name ){
return $status->value;
}
}
throw new \ValueError("$name is not a valid backing value for enum " . self::class );
}
} }

@ -18,7 +18,7 @@ class CharacterGateway extends Gateway
return $this -> co -> executeQuery($query, [ return $this -> co -> executeQuery($query, [
'id_caracter' => array($id_character, PDO::PARAM_INT), 'id_caracter' => array($id_character, PDO::PARAM_INT),
'caracter' => array($name, PDO::PARAM_STR), 'caracter' => array($name, PDO::PARAM_STR),
'id_img' => array($img_char, PDO::PARAM_STR) 'id_img' => array($img_char, PDO::PARAM_INT)
]); ]);
} }
@ -61,8 +61,24 @@ class CharacterGateway extends Gateway
return $this -> co -> executeQuery($query, [ return $this -> co -> executeQuery($query, [
"id_c" => array($id_char, PDO::PARAM_INT), "id_c" => array($id_char, PDO::PARAM_INT),
"caracter" => array($name, PDO::PARAM_STR), "caracter" => array($name, PDO::PARAM_STR),
"i" => array($img_char, PDO::PARAM_STR) "i" => array($img_char, PDO::PARAM_INT)
]); ]);
} }
public function getLastId():int{
$query = "SELECT id_caracter FROM Caracter;";
$this -> co -> executeQuery($query);
$res = $this -> co -> getResults();
foreach($res as $r){
$tab[] = $r["id_caracter"];
}
$id = 1;
while(in_array($id,$tab))
{
$id=$id+1;
}
return $id;
}
} }

@ -65,4 +65,19 @@ class ImageGateway extends Gateway
'img_path' => array($imgPath, PDO::PARAM_STR) 'img_path' => array($imgPath, PDO::PARAM_STR)
]); ]);
} }
public function getLastId():int{
$query = "SELECT id_img FROM Image;";
$this -> co -> executeQuery($query);
$res = $this -> co -> getResults();
foreach($res as $r){
$tab[] = $r["id_img"];
}
$id = 1;
while(in_array($id,$tab))
{
$id=$id+1;
}
return $id;
}
} }

@ -98,4 +98,75 @@ class QuestionGateway extends Gateway
return $this -> co -> getResults(); return $this -> co -> getResults();
} }
public function getQuestionQuoteSrc(string $l) : array{
}
/*--------------------------------------- Quiz Aléatoire ---------------------------------------*/
/*----------------------- Question + Reponce Corecte -----------------------*/
public function QuestionToReponceForQuoteToCarac(string $lang) : array
{
$query = "Select q.content as Question ,c.caracter as Reponce
from Quote Q
join Caracter c on c.id_caracter=q.id_caracter
where q.langue=:lang and q.isValide = 'true'
ORDER BY RANDOM()
LIMIT 1;";
$this -> co -> executeQuery($query, [':lang' => array($lang, PDO::PARAM_STR)]);
return $this -> co -> getResults();
}
public function QuestionToReponceForQuoteToTitle(string $lang) : array
{
$query = "Select q.content as Question ,s.title as Reponce
from Quote Q
join Source s on s.id_source=q.id_source
where q.langue=:lang and q.isValide = 'true'
ORDER BY RANDOM()
LIMIT 1;";
$this -> co -> executeQuery($query, [':lang' => array($lang, PDO::PARAM_STR)]);
return $this -> co -> getResults();
}
/*----------------------- Reponce Fausse -----------------------*/
public function FakeReponceForQuoteToCarac(string $lang,string $corecteReponce) : array
{
$query = "Select c.caracter as Reponce
from Quote Q
join Caracter c on c.id_caracter=q.id_caracter
where q.langue = :lang And c.caracter != :corecteReponce and q.isValide = 'true'
ORDER BY RANDOM()
LIMIT 3;";
$this -> co -> executeQuery($query, [
':lang' => array($lang, PDO::PARAM_STR),
':corecteReponce' => array($lang, PDO::PARAM_STR)
]);
return $this -> co -> getResults();
}
public function FakeReponceForQuoteToTitle(string $lang,string $corecteReponce) : array
{
$query = "Select s.title as Reponce
from Quote Q
join Source s on s.id_source=q.id_source
where q.langue = :lang And s.title != :corecteReponce and q.isValide = 'true'
ORDER BY RANDOM()
LIMIT 3;";
$this -> co -> executeQuery($query, [
':lang' => array($lang, PDO::PARAM_STR),
':corecteReponce' => array($lang, PDO::PARAM_STR)
]);
return $this -> co -> getResults();
}
} }

@ -8,22 +8,24 @@ use PDO;
class QuizGateway extends Gateway class QuizGateway extends Gateway
{ {
public function create(int $id_quiz, int $nb_questions) : bool public function create(int $id_quiz, int $nb_questions, string $id_img, string $title) : bool
{ {
$query = " $query = "
INSERT INTO Quiz INSERT INTO Quiz
VALUES (:id_q, :nb_q) VALUES (:id_q, :nb_q, :id_img, :title)
"; ";
return $this -> co -> executeQuery($query, [ return $this -> co -> executeQuery($query, [
':id_q' => array($id_quiz, PDO::PARAM_INT), ':id_q' => array($id_quiz, PDO::PARAM_INT),
':nb_q' => array($nb_questions, PDO::PARAM_INT) ':nb_q' => array($nb_questions, PDO::PARAM_INT),
':id_img' => array($id_img, PDO::PARAM_STR),
':title' => array($title, PDO::PARAM_STR)
]); ]);
} }
public function findQuizById(int $id) : array public function findQuizById(int $id) : array
{ {
$query = "SELECT * FROM Quiz WHERE id_quiz = :id_q"; $query = "SELECT id_quiz, title, imgPath, nb_quest FROM Quiz q JOIN Image i on q.img = i.id_img WHERE id_quiz = :id_q";
$this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]); $this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
return $this -> co -> getResults(); return $this -> co -> getResults();
} }
@ -36,9 +38,15 @@ class QuizGateway extends Gateway
public function findAll() : array public function findAll() : array
{ {
$query = "SELECT * FROM Quiz"; $query = "SELECT id_quiz, title, imgPath, nb_quest FROM Quiz q JOIN Image i on q.img = i.id_img";
$this -> co -> executeQuery($query); $this -> co -> executeQuery($query);
return $this -> co -> getResults(); return $this -> co -> getResults();
} }
public function getNumberOfQuestion(int $id) : intdiv{
$query = "SELECT nb_quest FROM quiz WHERE id_quiz = :id_q";
$this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
return $this -> co -> getResults();
}
} }

@ -151,23 +151,38 @@ Class QuoteGateway extends Gateway{
return ($this -> co ->getResults())[0]['id']; return ($this -> co ->getResults())[0]['id'];
} }
public function insert4User(string $content, string $img_path, string $langage, int $user, int $source, int $character) : bool public function addQuote(string $content, string $lang, int $idChar, int $idSrc, int $idUsr){
{ $id = $this->getLastId();
$query = " $query = "INSERT INTO Quote Values (:id,:content,0,:lang,false,'',:charac,:src,:user);";
INSERT INTO Quote (id_quote, content, langue, reason, id_source, id_caracter, id_user_verif, img_path) try {
VALUES (:id, :content, :langage, :reason, :source, :character, :user, :img_path) $this->co->executeQuery($query,[
"; ':id' => [$id,PDO::PARAM_INT],
':content' => [$content,PDO::PARAM_STR],
return $this->co->executeQuery($query, [ ':lang' => [$lang,PDO::PARAM_STR],
':id' => array($this->autoincrement(), PDO::PARAM_INT), ':charac' => [$idChar,PDO::PARAM_INT],
':content' => array($content, PDO::PARAM_STR), ':src' => [$idSrc,PDO::PARAM_INT],
':img_path' => array($img_path, PDO::PARAM_STR), ':user' => [$idUsr,PDO::PARAM_INT],
':langage' => array($langage, PDO::PARAM_STR), ]);
':user' => array($user, PDO::PARAM_INT), }
':reason' => array('À vérifier', PDO::PARAM_STR), catch (PDOException $e){
':source' => array($source, PDO::PARAM_STR), $error['501'] = 'Erreur lors de la création de la citation';
':character' => array($character, PDO::PARAM_STR) return error;
]); }
}
public function getLastId():int{
$query = "SELECT id_quote FROM Quote;";
$this -> co -> executeQuery($query);
$res = $this -> co -> getResults();
foreach($res as $r){
$tab[] = $r["id_quote"];
}
$id = 1;
while(in_array($id,$tab))
{
$id=$id+1;
}
return $id;
} }
//======================== PARTI ADMIN ======================== //======================== PARTI ADMIN ========================

@ -10,10 +10,11 @@ class SourceGateway extends Gateway{
{ {
$query = " $query = "
INSERT INTO Source INSERT INTO Source
VALUES( :title, :date) VALUES(:id, :title, :date)
"; ";
return $this -> co -> executeQuery($query, [ return $this -> co -> executeQuery($query, [
"id" => array($s->getIdSource(), PDO::PARAM_INT),
"title" => array($s->getTitle(), PDO::PARAM_STR), "title" => array($s->getTitle(), PDO::PARAM_STR),
"date" => array($s->getDate(), PDO::PARAM_STR), "date" => array($s->getDate(), PDO::PARAM_STR),
#"type" => array($s->getType(), PDO::PARAM_STR) #"type" => array($s->getType(), PDO::PARAM_STR)
@ -81,4 +82,19 @@ class SourceGateway extends Gateway{
]); ]);
} }
public function getLastId():int{
$query = "SELECT id_source FROM Source;";
$this -> co -> executeQuery($query);
$res = $this -> co -> getResults();
foreach($res as $r){
$tab[] = $r["id_source"];
}
$id = 1;
while(in_array($id,$tab))
{
$id=$id+1;
}
return $id;
}
} }

@ -9,11 +9,17 @@ use Gateway\Gateway;
class CharacterModel extends Model class CharacterModel extends Model
{ {
public function createCharacter(int $id_character, string $name , string $img_char) : bool public function createCharacter(int $id_character, string $name , int $img_char) : bool
{ {
return $this -> gateway -> create($id_character, $name, $img_char); return $this -> gateway -> create($id_character, $name, $img_char);
} }
public function createCharacterWithoutId(string $name , int $img_char) : bool
{
$id_character = $this -> gateway -> getLastId();
return $this -> gateway -> create($id_character, $name, $img_char);
}
public function getCharacterById(int $id_character) : ?CharacterEntity public function getCharacterById(int $id_character) : ?CharacterEntity
{ {
$c = $this -> gateway -> findById($id_character); $c = $this -> gateway -> findById($id_character);
@ -72,7 +78,7 @@ class CharacterModel extends Model
return $this -> gateway -> delete($id_character); return $this -> gateway -> delete($id_character);
} }
public function updateCharacter(int $id_character, string $name, string $img_char) : bool public function updateCharacter(int $id_character, string $name, int $img_char) : bool
{ {
return $this -> gateway -> update($id_character, $name, $img_char); return $this -> gateway -> update($id_character, $name, $img_char);
} }

@ -13,6 +13,13 @@ class ImageModel extends Model
return $this -> gateway -> createImgGateway($idImg, $imgPath); return $this -> gateway -> createImgGateway($idImg, $imgPath);
} }
public function createImgModelWithoutId (string $imgPath) : int
{
$idImg = $this->gateway ->getLastId() ;
$this -> gateway -> createImgGateway($idImg, $imgPath, false);
return $idImg;
}
public function getImgById(int $idImg) : ?ImageEntity public function getImgById(int $idImg) : ?ImageEntity
{ {
$res = $this -> gateway -> findImgById($idImg); $res = $this -> gateway -> findImgById($idImg);

@ -79,4 +79,82 @@ class QuestionModel extends Model
); );
return null; return null;
} }
public function getRandomQuestion(string $quesType, string $repType, string $langue) : ?QuestionEntity{
switch([$questType,$repType]){
case ["Quote","Src"]:
$q = $this -> gateway -> getQuestionQuoteSrc($langue);
return new QuestionEntity(
$q[], //idQuote
$q[], //Quote
$q[], //SrcJuste
$q[], //rndSrc 1
$q[], //rndSrc 2
$q[], //rndSrc 3
$q[], //SrcJuste
);
case ["Quote","Charac"]:
$q = $this -> gateway -> getQuestionQuoteCharac($langue);
case ["Charac","Src"]:
$q = $this -> gateway -> getQuestionCharacSrc($langue);
case ["Charac","Quote"]:
$q = $this -> gateway -> getQuestionCharacQuote($langue);
case ["Src","Quote"]:
$q = $this -> gateway -> getQuestionSrcQuote($langue);
case ["Src","Charac"]:
$q = $this -> gateway -> getQuestionSrcCharac($langue);
case ["Test","Test"]:
return new QuestionEntity(-1,"1","1","2","3","4","1");
default :
return null;
}
}
/*--------------------------------------- Quiz Aléatoire ---------------------------------------*/
/*----------------------- Question compléte -----------------------*/
public function QuestionForQuoteToCarac(string $lang) : QuestionEntity
{
$questRep = $this->gateway->QuestionToReponceForQuoteToCarac($lang);
$quest = $questRep[0]['question'];
$cAnswer = $questRep[0]['reponce'];
$fake = $this->gateway->FakeReponceForQuoteToCarac($lang,$cAnswer);
$fakeRep = [$cAnswer];
foreach ($fake as $rep){
$fakeRep[]=$rep['reponce'];
}
shuffle($fakeRep);
return new QuestionEntity(-1,$quest,$fakeRep[0],$fakeRep[1],$fakeRep[2],$fakeRep[3],$cAnswer);
}
public function QuestionForQuoteToTitle(string $lang) : QuestionEntity
{
$questRep = $this->gateway->QuestionToReponceForQuoteToTitle($lang);
$quest = $questRep['question'];
$cAnswer = $questRep['reponce'];
$fake = $this->gateway->FakeReponceForQuoteToTitle($lang,$cAnswer);
$fakeRep = [$cAnswer];
foreach ($fake as $rep){
$fakeRep[]=$rep['reponce'];
}
$fakeRep=array_rand($fakeRep);
return new QuestionEntity(-1,$quest,$fakeRep[0],$fakeRep[1],$fakeRep[2],$fakeRep[3],$cAnswer);
}
} }

@ -2,24 +2,26 @@
namespace Model; namespace Model;
use Entity\quizEntity; use Entity\QuizEntity;
use Gateway\QuizGateway; use Gateway\QuizGateway;
use Gateway\Gateway; use Gateway\Gateway;
class QuizModel extends Model{ class QuizModel extends Model{
public function createQuiz(int $id_quiz, int $nb_questions) : bool public function createQuiz(int $id_quiz, int $nb_questions, String $id_img, string $title) : bool
{ {
return $this -> gateway -> create($id_quiz, $nb_questions); return $this -> gateway -> create($id_quiz, $nb_questions, $id_img, $title);
} }
public function getQuiz(int $id_quiz): ?quizEntity public function getQuiz(int $id_quiz): ?QuizEntity
{ {
$q = $this -> gateway -> findQuizById($id_quiz); $q = $this -> gateway -> findQuizById($id_quiz);
if ($q) { if ($q) {
return new quizEntity( return new QuizEntity(
$q[0]['id_quiz'], $q[0]['id_quiz'],
$q[0]['nb_quest'] $q[0]['nb_quest'],
$q[0]['imgpath'],
$q[0]['title']
); );
} }
return null; return null;
@ -30,20 +32,22 @@ class QuizModel extends Model{
return $this -> gateway -> delete($id_quiz); return $this -> gateway -> delete($id_quiz);
} }
public function getAllQuiz() : array public function listQuiz() : array
{ {
$q = $this -> gateway -> findAll(); $res = $this -> gateway -> findAll();
$quizzes = []; $quizs = [];
foreach ($q as $quiz) { foreach ($res as $quiz)
$quizzes[] = new quizEntity( {
$quizs[] = new QuizEntity(
$quiz['id_quiz'], $quiz['id_quiz'],
$quiz['nb_questions'] $quiz['nb_quest'],
$quiz['imgpath'],
$quiz['title']
); );
} }
return $quizzes;
return $quizs;
} }
} }

@ -3,6 +3,7 @@
use Entity\Quote; use Entity\Quote;
use Gateway\QuoteGateway; use Gateway\QuoteGateway;
use Gateway\Gateway; use Gateway\Gateway;
use Enum\TypeSourceEnum;
class QuoteModel extends Model class QuoteModel extends Model
{ {
@ -12,7 +13,7 @@
if( count($res) == 0) if( count($res) == 0)
return new Quote(-1,"NULL","NULL","NULL","NULL","NULL",0,"Default"); return new Quote(-1,"NULL","NULL","NULL","NULL","NULL",0,"Default");
else else
return new Quote($res[0]["id_quote"],$res[0]["content"],$res[0]["caracter"],$res[0]["imgpath"],$res[0]["title"],$res[0]["dates"],$res[0]["likes"],$res[0]["langue"]); return new Quote($res[0]["id_quote"],$res[0]["content"],$res[0]["caracter"],$res[0]["imgpath"],$res[0]["title"],$res[0]["dates"],$res[0]["likes"],$res[0]["langue"],TypeSourceEnum::Movie);
} }
public function getSuggest(int $numpage, string $language):array{ public function getSuggest(int $numpage, string $language):array{
@ -21,7 +22,7 @@
foreach($res as $q ){ foreach($res as $q ){
$q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"]; $q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"];
$tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"]) ; $tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"],TypeSourceEnum::Movie) ;
} }
return $tabQ; return $tabQ;
} }
@ -29,10 +30,10 @@
public function getQuoteOfTheDay(string $language):Quote{ public function getQuoteOfTheDay(string $language):Quote{
$res = $this->gateway->getQuoteOfTheDay($language); $res = $this->gateway->getQuoteOfTheDay($language);
if( count($res) == 0) if( count($res) == 0)
return new Quote(-1,"NULL","NULL","NULL","NULL","NULL",0,"Default"); return new Quote(-1,"NULL","NULL","NULL","NULL","NULL",0,"Default",TypeSourceEnum::Movie);
else else
$res["content"] = (strlen($res["content"]) > 153) ? substr($res["content"],0,150).'...' : $res["content"]; $res["content"] = (strlen($res["content"]) > 153) ? substr($res["content"],0,150).'...' : $res["content"];
return new Quote($res["id_quote"],$res["content"],$res["caracter"],$res["imgpath"],$res["title"],$res["dates"],$res["likes"],$res["langue"]) ; return new Quote($res["id_quote"],$res["content"],$res["caracter"],$res["imgpath"],$res["title"],$res["dates"],$res["likes"],$res["langue"],TypeSourceEnum::Movie) ;
} }
public function getFavorites(string $userId): array { public function getFavorites(string $userId): array {
@ -41,16 +42,14 @@
foreach($res as $q ){ foreach($res as $q ){
$q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"]; $q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"];
$tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"]) ; $tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"],TypeSourceEnum::Movie) ;
} }
return $tabQ; return $tabQ;
} }
public function insert4User(string $content, string $img_path, string $langage, int $user, int $source, int $character) : bool public function addQuote(string $content, string $lang, int $idChar, int $idSrc, int $idUsr){
{ $this -> gateway -> addQuote($content,$lang,$idChar,$idSrc,$idUsr);
return $this->gateway->insert4User($content, $img_path, $langage, $user, $source, $character);
} }
} }
?> ?>

@ -3,6 +3,7 @@
use Entity\Quote; use Entity\Quote;
use Gateway\QuoteGateway; use Gateway\QuoteGateway;
use Gateway\Gateway; use Gateway\Gateway;
use Enum\TypeSourceEnum;
class SearchModel extends Model class SearchModel extends Model
{ {
@ -14,7 +15,7 @@
foreach($res as $q ){ foreach($res as $q ){
$q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"]; $q["content"] = (strlen($q["content"]) > 153) ? substr($q["content"],0,150).'...' : $q["content"];
$tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"]) ; $tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"],TypeSourceEnum::Movie) ;
} }
return $tabQ; return $tabQ;
} }

@ -8,8 +8,8 @@ class SourceModel extends Model
public function createSource(string $title, string $date, TypeSourceEnum $type) : bool public function createSource(string $title, string $date, TypeSourceEnum $type) : bool
{ {
$q = new SourceEntity(-1,$title, $date, TypeSourceEnum::Movie/*$type*/); $id = $this -> gateway -> getLastId();
$q = new SourceEntity($id,$title, $date, $type);
return $this -> gateway -> create($q); return $this -> gateway -> create($q);
} }
@ -106,7 +106,7 @@ class SourceModel extends Model
public function existSource(string $name, string $type) : bool{ public function existSource(string $name, string $type) : bool{
$q = $this -> getSourceByTitle($name); $q = $this -> getSourceByTitle($name);
return isset($q[0]); return isset($q);
} }
} }

@ -7,8 +7,8 @@ namespace Verification;
if($text==NULL){ if($text==NULL){
return NULL; return NULL;
} }
$charInterdi=['|','/','\\','%','$','=','<','>','(',')']; $charInterdi=['|','/','\\','%','$','=','<','>','(',')',';'];
$chaineInterdi=["AND","OR","WHERE","FROM","SELECT"]; $chaineInterdi=["AND","OR","WHERE","FROM","SELECT","DROP","DELETE","TABLE","Users"];
$textVerif=""; $textVerif="";
foreach( str_split($text,1) as $char){ foreach( str_split($text,1) as $char){

@ -0,0 +1,16 @@
<?php
global $twig;
echo $twig->render('head.html.twig', [
'title' => "Quiz",
'style' => "public/styles/styleAccueilQuiz.css",
'scripts' => array("public/script/theme-toggle.js")
]);
echo $twig->render('bandeau.html.twig');
echo $twig->render('accueilQuiz.html.twig', [
'quizs' => $quizs
]);
?>

@ -14,6 +14,9 @@ echo $twig->render('bandeau.html.twig');
echo $twig->render('create.html.twig', [ echo $twig->render('create.html.twig', [
'src' => $src, 'src' => $src,
'char' => $char 'char' => $char,
'content' => $_POST['content'],
'charId' => $charId,
'srcId' => $srcId
]); ]);
?> ?>

@ -8,11 +8,13 @@ echo $twig->render('head.html.twig', [
'scripts' => array("../public/script/theme-toggle-double-param.js") 'scripts' => array("../public/script/theme-toggle-double-param.js")
]); ]);
// Rendu du bandeau // Rendu du bandeau
echo $twig->render('bandeau.html.twig'); echo $twig->render('bandeau.html.twig');
echo $twig->render('endQuiz.html.twig', ['score' => $score, 'nextquiz' => $id_quiz + 1]) echo $twig->render('endQuiz.html.twig',
['score' => $score,
'isNextQuiz' => $next,
'nb' => $nbQuestion]);
?> ?>

@ -0,0 +1,17 @@
<?php
global $twig;
echo $twig->render('head.html.twig', [
'title' => "Quiz",
'style' => "public/styles/styleEndQuiz.css",
'scripts' => array("public/script/theme-toggle.js")
]);
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
echo $twig->render('endQuizRandom.html.twig',
['score' => $score
]);
?>

@ -1,5 +1,25 @@
<h1>
<?php <?php
echo "ERREUR"; global $twig;
?>
</h1> if(!isset($erreur[2])){
echo $twig->render('head.html.twig', [
'title' => "Accueil",
'style' => "public/styles/style.css",
'scripts' => array("public/script/theme-toggle.js")
]);
}
else{
echo $twig->render('head.html.twig', array(
'title' => "Quote",
'style' => "../public/styles/styleQuote.css",
'scripts' => array("../public/script/theme-toggle-double-param.js", "../public/script/copy.js")
));
}
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
echo $twig->render('erreur.html.twig',[
'numero' => $erreur[0],
'context' => $erreur[1],
]);

@ -1,16 +1,64 @@
<?php <?php
global $twig; global $twig;
// Paramètres de la pagination
$perPage = 30;
$currentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1;
if ($currentPage < 1) {
$currentPage = 1;
}
$totalItems = count($favorites);
$totalPages = ceil($totalItems / $perPage);
$offset = ($currentPage - 1) * $perPage;
$favoritesPaginated = array_slice($favorites, $offset, $perPage);
echo $twig->render('head.html.twig', [ echo $twig->render('head.html.twig', [
'title' => "Favoris", 'title' => "Favoris",
'style' => "public/styles/styleAccueil.css", 'style' => "public/styles/styleAccueil.css",
'scripts' => array("public/script/theme-toggle.js") 'scripts' => array("public/script/theme-toggle.js")
]); ]);
echo $twig->render('bandeau.html.twig'); echo $twig->render('bandeau.html.twig');
echo $twig->render('quoteLittle.html.twig', [ echo $twig->render('quoteLittle.html.twig', [
'quotes' => $favorites, 'quotes' => $favoritesPaginated,
'titre' => "Favoris" 'titre' => "Favoris"
]); ]);
?> ?>
<div class="pagination-container">
<button id="prev-page" <?php if($currentPage <= 1) echo "disabled"; ?>>Page précédente</button>
<select id="page-selector">
<?php for($page = 1; $page <= $totalPages; $page++): ?>
<option value="<?php echo $page; ?>" <?php if($page == $currentPage) echo "selected"; ?>>Page <?php echo $page; ?></option>
<?php endfor; ?>
</select>
<button id="next-page" <?php if($currentPage >= $totalPages) echo "disabled"; ?>>Page suivante</button>
<div class="spinner" id="spinner"></div>
</div>
<script>
document.getElementById('page-selector').addEventListener('change', function() {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + this.value;
});
document.getElementById('prev-page').addEventListener('click', function() {
var selector = document.getElementById('page-selector');
var newPage = parseInt(selector.value) - 1;
if(newPage >= 1) {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + newPage;
}
});
document.getElementById('next-page').addEventListener('click', function() {
var selector = document.getElementById('page-selector');
var newPage = parseInt(selector.value) + 1;
if(newPage <= <?php echo $totalPages; ?>) {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + newPage;
}
});
</script>

@ -1,17 +1,18 @@
<?php <?php
global $twig; global $twig;
echo $twig->render('head.html.twig', [ echo $twig->render('head.html.twig', [
'title' => "Quiz", 'title' => "Quiz",
'style' => "../public/styles/styleQuiz.css", 'style' => "../public/styles/styleQuiz.css",
'scripts' => array("../public/script/theme-toggle-double-param.js") 'scripts' => array("../public/script/theme-toggle-double-param.js")
]); ]);
// Rendu du bandeau // Rendu du bandeau
echo $twig->render('bandeau.html.twig'); echo $twig->render('bandeau.html.twig');
echo $twig->render('quiz.html.twig', ['idQuiz'=>$id , 'question' => $question,'id'=>$idquestion]); echo $twig->render('quiz.html.twig', [
?> 'question' => $question,
'id'=>$idquestion,
'nb' => $num + 1,
'nbFinal' => $nbQuestion
]);

@ -0,0 +1,20 @@
<?php
global $twig;
echo $twig->render('head.html.twig', [
'title' => "Random Quiz",
'style' => "public/styles/styleQuiz.css",
'scripts' => array("public/script/theme-toggle.js")
]);
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
echo $twig->render('quizRandom.html.twig', [
'vie' => $vie,
'question' => $question,
'nb' => $no_question + 1
]);

@ -1,4 +1,5 @@
<?php <?php
use Enum\TypeSourceEnum;
global $twig; global $twig;
@ -17,5 +18,6 @@
'nbLike' => $q->getLike(), 'nbLike' => $q->getLike(),
'idQuote' => $q->getId(), 'idQuote' => $q->getId(),
'com' => $c, 'com' => $c,
'type' => $q->getType()->name,
'fav' => $f)); 'fav' => $f));
?> ?>

@ -0,0 +1,16 @@
<?php
global $twig;
echo $twig->render('head.html.twig', array(
'title' => "Recap Quote",
'style' => "public/styles/styleSubmitQuote.css",
'scripts' => array("public/script/theme-toggle.js")
));
echo $twig->render('bandeau.html.twig');
echo $twig -> render("recapSubmitQuote.html.twig", [
'content' => $recap["content"],
'character' => $recap["character"],
'source' => $recap["src"]
]);
?>

@ -2,25 +2,76 @@
global $twig; global $twig;
// Paramètres de la pagination
$perPage = 30;
$currentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1;
if ($currentPage < 1) {
$currentPage = 1;
}
// Calcul du nombre total d'éléments et de pages
$totalItems = count($tq);
$totalPages = ceil($totalItems / $perPage);
// Découpage du tableau pour ne garder que les éléments de la page courante
$offset = ($currentPage - 1) * $perPage;
$quotesPaginated = array_slice($tq, $offset, $perPage);
echo $twig->render('head.html.twig', array( echo $twig->render('head.html.twig', array(
'title' => "Quote", 'title' => "Search",
'style' => "public/styles/styleSearch.css", 'style' => "public/styles/styleSearch.css",
'scripts' => array("public/script/theme-toggle.js") 'scripts' => array("public/script/theme-toggle.js")
)); ));
echo $twig->render('bandeau.html.twig'); echo $twig->render('bandeau.html.twig');
echo $twig->render('filtre.html.twig',array( echo $twig->render('filtre.html.twig', array(
'search'=>$search, 'search' => $search,
'type'=>$type, 'type' => $type,
)); ));
echo $twig->render('quoteLittle.html.twig', [ echo $twig->render('quoteLittle.html.twig', [
'quotes' => $tq, 'quotes' => $quotesPaginated,
'titre' => "Résultats" 'titre' => "Résultats"
]); ]);
?>
<div class="pagination-container">
<button id="prev-page" <?php if($currentPage <= 1) echo "disabled"; ?>>Page précédente</button>
<select id="page-selector">
<?php for($page = 1; $page <= $totalPages; $page++): ?>
<option value="<?php echo $page; ?>" <?php if($page == $currentPage) echo "selected"; ?>>Page <?php echo $page; ?></option>
<?php endfor; ?>
</select>
<button id="next-page" <?php if($currentPage >= $totalPages) echo "disabled"; ?>>Page suivante</button>
<div class="spinner" id="spinner"></div>
</div>
<script>
document.getElementById('page-selector').addEventListener('change', function() {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + this.value;
});
document.getElementById('prev-page').addEventListener('click', function() {
var selector = document.getElementById('page-selector');
var newPage = parseInt(selector.value) - 1;
if(newPage >= 1) {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + newPage;
}
});
document.getElementById('next-page').addEventListener('click', function() {
var selector = document.getElementById('page-selector');
var newPage = parseInt(selector.value) + 1;
if(newPage <= <?php echo $totalPages; ?>) {
document.getElementById('spinner').style.display = 'inline-block';
window.location.href = "?page=" + newPage;
}
});
</script>
<?php
echo "</div>"; echo "</div>";
//echo $twig->render('resultat.html.twig'); //echo $twig->render('resultat.html.twig');
?>
?>

@ -0,0 +1,26 @@
<h2>Liste des Quiz</h2>
<div class="quiz-container">
<div class="quizCard">
<a href="{{ racine }}/randomQuiz" class="linkQuiz">
<img src="{{ racine }}/images/quizz.svg" alt="Image du quiz random">
<h3>Quiz random </h3>
</a>
</div>
{% for quiz in quizs %}
<div class="quizCard">
<a href="{{ racine }}/quiz/{{ quiz.id_quiz }}" class="linkQuiz">
<img src="{{ quiz.imgPath }}" alt="Image du quiz {{ quiz.title }}">
<h3>{{ quiz.title }} ({{ quiz.nb_quest }} questions)</h3>
</a>
</div>
{% else %}
<h3>Aucun quiz disponible pour le moment.</h3>
{% endfor %}
</div>
</body>
</html>

@ -1,8 +1,9 @@
<div class="header"> <div class="header">
<div class="nav"> <div class="nav">
<a href="{{ racine }}/favorite"><img src="{{ racine }}/images/coeur.svg" alt="coeur" onmousedown="return false"></a> <a href="{{ racine }}/favorite"><img src="{{ racine }}/images/coeur.svg" alt="coeur" onmousedown="return false"></a>
<img class='theme-icon' id="theme-icon" src="{{ racine }}/images/dark.svg" alt="toggle theme" onmousedown="return false" onclick="toggleTheme()"> <a href="{{ racine }}/accueilQuiz"><img src="{{ racine }}/images/quizz.svg" alt="quizz" onmousedown="return false"></a>
<a href="{{ racine }}/quiz/1"><img src="{{ racine }}/images/quizz.svg" alt="quizz" onmousedown="return false"></a> <a href="{{racine}}/submit" class="createQuote"><img src="{{ racine }}/images/Vector.svg" onmousedown="return false"></img></a>
</div> </div>
<div class="logo"> <div class="logo">
@ -10,6 +11,7 @@
</div> </div>
<div class="user"> <div class="user">
<img class='theme-icon' id="theme-icon" src="{{ racine }}/images/dark.svg" alt="toggle theme" onmousedown="return false" onclick="toggleTheme()">
<a href="{{ racine }}/search"><img src="{{ racine }}/images/loupe.svg" alt="search" onmousedown="return false"></a> <a href="{{ racine }}/search"><img src="{{ racine }}/images/loupe.svg" alt="search" onmousedown="return false"></a>
<a class="iconUser" href="{{ racine }}/profil"><img src="{{ racine }}/images/user_dark.png" alt="user" onmousedown="return false"></a> <a class="iconUser" href="{{ racine }}/profil"><img src="{{ racine }}/images/user_dark.png" alt="user" onmousedown="return false"></a>
</div> </div>

@ -1,11 +1,22 @@
<div class="creation"> <div class="creation">
<form class="add" method="post" action="{{racine}}/add"> <form class="add" method="post" action="{{racine}}/add" enctype="multipart/form-data">
{% if src == true and char == true %} {% if src == true and char == true %}
<input type="hidden" id="req" name="req" value="both"/> <input type="hidden" id="req" name="req" value="both"/>
<input type="hidden" id="content" name="content" value="{{ content }}"/>
{% elseif src == true %} {% elseif src == true %}
<input type="hidden" id="req" name="req" value="src"/> <input type="hidden" id="req" name="req" value="src"/>
<input type="hidden" id="character" name="character" value="{{ charId }}"/>
<input type="hidden" id="content" name="content" value="{{ content }}"/>
{% elseif char == true %} {% elseif char == true %}
<input type="hidden" id="req" name="req" value="src"/>
<input type="hidden" id="req" name="req" value="char"/>
<input type="hidden" id="src" name="src" value="{{ srcId }}"/>
<input type="hidden" id="content" name="content" value="{{ content }}"/>
{% endif %} {% endif %}
{% if src == true %} {% if src == true %}
<h1>Source</h1> <h1>Source</h1>
@ -15,16 +26,16 @@
<input type="number" id="date" name="date" min="1850" max="{{ "now"|date("Y") }}" required> <input type="number" id="date" name="date" min="1850" max="{{ "now"|date("Y") }}" required>
<label for="type">Type de source *</label> <label for="type">Type de source *</label>
<input type="radio" id="movie" name="type" value="Movie" checked> <input type="radio" id="movie" name="type" value="movie" checked>
<label for="movie">Film</label><br> <label for="movie">Film</label><br>
<input type="radio" id="serie" name="type" value="Serie"> <input type="radio" id="serie" name="type" value="serie">
<label for="serie">Serie</label> <label for="serie">Serie</label>
<input type="radio" id="vg" name="type" value="VideoGame"> <input type="radio" id="vg" name="type" value="video-game">
<label for="vg">Jeu Vidéo</label><br> <label for="vg">Jeu Vidéo</label><br>
<input type="radio" id="anime" name="type" value="Anime"> <input type="radio" id="anime" name="type" value="anime">
<label for="anime">Anime</label> <label for="anime">Anime</label>
{% endif %} {% endif %}
@ -34,7 +45,7 @@
<input type="text" class="champ" id="name" name="name" placeholder="Nom du personnage" required/> <input type="text" class="champ" id="name" name="name" placeholder="Nom du personnage" required/>
<label for="name">Image du personnage *</label> <label for="name">Image du personnage *</label>
<input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg" required/> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg, imag/jpg" required/>
{% endif %} {% endif %}
<input type="submit" class="btn" value="Soumettre"/> <input type="submit" class="btn" value="Soumettre"/>

@ -1,10 +1,13 @@
<h1>Résultat</h1> <h1>Résultat</h1>
<div class="resultat"> <div class="resultat">
<p> nombre de réponse juste : {{ score }}</p> <p> nombre de réponse juste : {{ score }}</p>
<p> nombre de réponse fausse : {{ 10 - score }}</p> <p> nombre de réponse fausse : {{ nb - score }}</p>
<a class="suiv" href="{{racine}}/quiz/{{ nextquiz }}" alt="quiz suivant"> <p> pourcentage de réusite : {{ (100 * score) / nb }}%<p>
<a class="suiv" href="{{racine}}/accueilQuiz" alt="Retour selection quiz">
<img src="../images/suivant.png" /> <img src="../images/suivant.png" />
</a> </a>
</div> </div>
</body> </body>
</html> </html>

@ -0,0 +1,12 @@
<h1>Résultat</h1>
<div class="resultat">
<p> nombre de réponse juste : {{ score }}</p>
<a class="suiv" href="{{racine}}/accueilQuiz" alt="Retour selection quiz">
<img src="images/suivant.png" />
</a>
</div>
</body>
</html>

@ -0,0 +1,4 @@
<h1 class='error'>Erreur</h1>
<p class="explanation">Erreur {{numero}} : {{context}}</p>
<body>
<html>

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

@ -1,3 +1,4 @@
<div class="content">
<form action="{{racine}}/search" method="post"> <form action="{{racine}}/search" method="post">
<div class="search-container"> <div class="search-container">
<input type="search" placeholder="Recherche" id="filtre" name="search" value="{{ search }}"/> <input type="search" placeholder="Recherche" id="filtre" name="search" value="{{ search }}"/>
@ -43,4 +44,5 @@
</div> </div>
--> -->
</form> </form>
</div>

@ -44,10 +44,6 @@
<img class="languageImage" src="{{ racine }}/images/drapeauFrance.png" onmousedown="return false"/> <img class="languageImage" src="{{ racine }}/images/drapeauFrance.png" onmousedown="return false"/>
</form> </form>
<div class="createQuote">
<a {#href="{{racine}}/submit"#} class="createQuote">Ajouter une citation</a>
</div>
<div class="buttonSudmiteDiv"> <div class="buttonSudmiteDiv">

@ -1,25 +1,25 @@
<h1>Quiz</h1> <h1>Quiz</h1>
<div class="quiz"> <div class="quiz">
<h2> {{ question.question }} </h2> <h2> {{ question.question }} </h2>
{#<a id="timer"> 10 seconds left .. </a>#}
<form id="quizForm" method="POST" > <form id="quizForm" method="POST" >
<div class="answers"> <div class="answers">
<button class="answer" name="answera" value="A-{{ id }}"> <button class="answer" name="answera" value="{{ question.answera }}-{{ id }}">
{{ question.answera }} {{ question.answera }}
</button> </button>
<button class="answer" name="answerb" value="B-{{ id }}"> <button class="answer" name="answerb" value="{{ question.answerb }}-{{ id }}">
{{ question.answerb }} {{ question.answerb }}
</button> </button>
<button class="answer" name="answerc" value="C-{{ id }}"> <button class="answer" name="answerc" value="{{ question.answerc }}-{{ id }}">
{{ question.answerc }} {{ question.answerc }}
</button> </button>
<button class="answer" name="answerd" value="D-{{ id }}"> <button class="answer" name="answerd" value="{{ question.answerd }}-{{ id }}">
{{ question.answerd }} {{ question.answerd }}
</button> </button>
</div> </div>
<input type="hidden" name="action" value="canswer"> <input type="hidden" name="action" value="canswer">
</form> </form>
<a id="timer">{{ nb }}/{{ nbFinal }}</a>
</div> </div>
</body> </body>
</html> </html>

@ -0,0 +1,27 @@
<h1>Quiz Random</h1>
<div class="quiz">
<h2> {{ question.question }} </h2>
<h3>Vie restante : {{ vie }}</h3>
<form id="quizForm" method="POST" >
<div class="answers">
<button class="answer" name="answera" value="{{ question.answera }}">
{{ question.answera }}
</button>
<button class="answer" name="answerb" value="{{ question.answerb }}">
{{ question.answerb }}
</button>
<button class="answer" name="answerc" value="{{ question.answerc }}">
{{ question.answerc }}
</button>
<button class="answer" name="answerd" value="{{ question.answerd }}">
{{ question.answerd }}
</button>
</div>
<input type="hidden" name="canswer" value="{{ question.canswer }}">
</form>
<a id="timer">{{ nb }}/∞</a>
</div>
</body>
</html>

@ -19,7 +19,7 @@
<div class="part2"> <div class="part2">
<div class="info"> <div class="info">
<ul class="infoQuote"> <ul class="infoQuote">
<li>- {{sourceName}}</li> <li>- {{sourceName}} ({{type}})</li>
<li>- {{nameCarac}}</li> <li>- {{nameCarac}}</li>
<li>- {{dateSortie}}</li> <li>- {{dateSortie}}</li>
</ul> </ul>

@ -1,19 +1,4 @@
<!DOCTYPE html> <h1>Votre citation a corectement été envoyé</h1>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wiki Fantasy : Submit Quote</title>
<link id="favicon" rel="icon" href="../../images/iconeSombre.ico"> <!-- Par défaut sombre -->
<link rel="stylesheet" href="../../public/styles/styleSubmitQuote.css">
<script defer src="../../public/script/theme-toggle.js"></script>
</head>
<body>
{% include "bandeau.html.twig" %}
<h1>▶ Your quote has been submitted successfully ◀</h1>
<div> <div>
@ -41,7 +26,7 @@
</div> </div>
<div> <div>
<button onclick="window.location.href='/';"> Revenir à l'acceuil</button> <button onclick="window.location.href='{{racine}}/';"> Revenir à l'acceuil</button>
</div> </div>
</div> </div>

@ -43,8 +43,7 @@
<div id="contentField"> <div id="contentField">
<p>Contenu *</p> <p>Contenu *</p>
<textarea id="content" name="content" rows="5" cols="50" required>Ecrire une citation ... <textarea id="content" name="content" rows="5" cols="50" required placeholder="écrire la citation..."></textarea>
</textarea>
</div> </div>
</div> </div>

Loading…
Cancel
Save