Compare commits
94 Commits
correction
...
master
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/exception" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/gateways" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/mdl" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/metier" isTestSource="false" packagePrefix="model" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
|
||||
<serverData>
|
||||
<paths name="ProjetPHP">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ScienceQuest.iml" filepath="$PROJECT_DIR$/.idea/ScienceQuest.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCSFixerOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.4">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@ -1,4 +0,0 @@
|
||||
vendor/
|
||||
composer.lock
|
||||
js/bootstrap*.js*
|
||||
css/bootstrap*.css*
|
@ -1,3 +0,0 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule . index.php [L]
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"controller\\": "controller/",
|
||||
"config\\": "config/",
|
||||
"model\\": ["model/", "model/mdl/", "model/gateways/", "model/metier/", "model/exception/"]
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"altorouter/altorouter": "^2.0",
|
||||
"twig/twig": "^3.7",
|
||||
"twbs/bootstrap": "^5.3"
|
||||
},
|
||||
"scripts": {
|
||||
"post-update-cmd": [
|
||||
"rm -f ./js/bootstrap*.js*",
|
||||
"rm -f ./css/bootstrap*.css*",
|
||||
"cp ./vendor/twbs/bootstrap/dist/js/* ./js/",
|
||||
"cp ./vendor/twbs/bootstrap/dist/css/* ./css/"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,365 +0,0 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "8ac61264e1d011c0b663d8c3dbdfc99f",
|
||||
"packages": [
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dannyvankooten/AltoRouter.git",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"squizlabs/php_codesniffer": "3.4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"AltoRouter.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"description": "A lightning fast router for PHP",
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"keywords": [
|
||||
"lightweight",
|
||||
"router",
|
||||
"routing"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dannyvankooten/AltoRouter/issues",
|
||||
"source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.2"
|
||||
},
|
||||
"time": "2020-03-09T08:34:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.28.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
|
||||
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"provide": {
|
||||
"ext-ctype": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.28-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Ctype\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"ctype",
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-01-26T09:26:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.28.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "42292d99c55abe617799667f454222c54c60e229"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
|
||||
"reference": "42292d99c55abe617799667f454222c54c60e229",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.28-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-28T09:04:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twbs/bootstrap",
|
||||
"version": "v5.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twbs/bootstrap.git",
|
||||
"reference": "344e912d04b5b6a04482113eff20ab416ff01048"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/344e912d04b5b6a04482113eff20ab416ff01048",
|
||||
"reference": "344e912d04b5b6a04482113eff20ab416ff01048",
|
||||
"shasum": ""
|
||||
},
|
||||
"replace": {
|
||||
"twitter/bootstrap": "self.version"
|
||||
},
|
||||
"type": "library",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Otto",
|
||||
"email": "markdotto@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jacob Thornton",
|
||||
"email": "jacobthornton@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
|
||||
"homepage": "https://getbootstrap.com/",
|
||||
"keywords": [
|
||||
"JS",
|
||||
"css",
|
||||
"framework",
|
||||
"front-end",
|
||||
"mobile-first",
|
||||
"responsive",
|
||||
"sass",
|
||||
"web"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/twbs/bootstrap/issues",
|
||||
"source": "https://github.com/twbs/bootstrap/tree/v5.3.2"
|
||||
},
|
||||
"time": "2023-09-14T14:19:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v3.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554",
|
||||
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/polyfill-ctype": "^1.8",
|
||||
"symfony/polyfill-mbstring": "^1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0|^2.0",
|
||||
"symfony/phpunit-bridge": "^5.4.9|^6.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Twig\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"role": "Contributors"
|
||||
},
|
||||
{
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
"homepage": "https://twig.symfony.com",
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/twigphp/Twig/issues",
|
||||
"source": "https://github.com/twigphp/Twig/tree/v3.7.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-28T11:09:02+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
namespace config;
|
||||
|
||||
|
||||
use model\ValidationException;
|
||||
|
||||
class Validation
|
||||
{
|
||||
public static function val_action($action)
|
||||
{
|
||||
if (!isset($action)) {
|
||||
throw new ValidationException('pas d\'action');
|
||||
}
|
||||
}
|
||||
|
||||
public static function val_form(string &$jeu, string &$difficulty, &$dVueErreur)
|
||||
{
|
||||
if ($jeu == '' || !filter_var($jeu, FILTER_SANITIZE_STRING)) {
|
||||
$dVueErreur[] = 'Aucun jeu selectionné';
|
||||
$jeu = 0;
|
||||
throw new ValidationException("Erreur jeu");
|
||||
}
|
||||
|
||||
if ($difficulty == '' || !filter_var($difficulty, FILTER_VALIDATE_INT)) {
|
||||
$dVueErreur[] = "Aucune difficultée séléctionnée";
|
||||
$difficulty = 0;
|
||||
throw new ValidationException("Erreur difficulté");
|
||||
}
|
||||
}
|
||||
|
||||
public static function valUserLogin(string &$user, &$dVueErreur)
|
||||
{
|
||||
if ($user == '' || !filter_var($user, FILTER_SANITIZE_STRING)) {
|
||||
$dVueErreur[] = 'Identifiant invalide';
|
||||
$jeu = 0;
|
||||
throw new ValidationException("Erreur identifiant");
|
||||
}
|
||||
}
|
||||
|
||||
public static function valCodeInvitation(string &$codeInvitation, &$dVueErreur){
|
||||
if($codeInvitation == ''){
|
||||
$dVueErreur[] = 'Code d\'invitation invalide';
|
||||
throw new ValidationException("Code d'invitation invalide");
|
||||
}
|
||||
return htmlspecialchars($codeInvitation);
|
||||
}
|
||||
|
||||
public static function valPseudo(string &$pseudo, &$dVueErreur){
|
||||
$pseudo = trim($pseudo);
|
||||
$pseudo = htmlspecialchars($pseudo);
|
||||
$pseudo = filter_var($pseudo, FILTER_UNSAFE_RAW);
|
||||
if($pseudo == '' ){
|
||||
$dVueErreur[] = 'Pseudo invalide';
|
||||
throw new ValidationException("Pseudo invalide");
|
||||
}
|
||||
return $pseudo;
|
||||
}
|
||||
|
||||
public static function valRole(&$role, &$dVueErreur){
|
||||
if(! $role instanceof \model\Joueur){
|
||||
$role = NULL;
|
||||
$dVueErreur[] = 'Role invalide';
|
||||
throw new ValidationException('Role invalide');
|
||||
}
|
||||
return $role;
|
||||
}
|
||||
|
||||
public static function valConfigurationJeu(&$configurationJeu, &$dVueErreur){
|
||||
if(! $configurationJeu instanceof \model\ConfigurationJeu){
|
||||
$role = NULL;
|
||||
$dVueErreur[] = 'Configuration du jeu invalide';
|
||||
throw new ValidationException('Configuration du jeu');
|
||||
}
|
||||
return $configurationJeu;
|
||||
}
|
||||
|
||||
public static function valMdlPendu(&$pendu, &$dVueErreur){
|
||||
if(! $pendu instanceof \model\MdlPendu){
|
||||
$role = NULL;
|
||||
$dVueErreur[] = 'Erreur mauvais jeu en utilisation';
|
||||
throw new ValidationException('Erreur mauvais jeu en utilisation');
|
||||
}
|
||||
return $pendu;
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace config;
|
||||
|
||||
$config = [
|
||||
"rep" => __DIR__.'/../',
|
||||
|
||||
"db" => ["dsn" => 'pgsql:host=localhost;dbname=dbrebeuret',
|
||||
"login" => 'rebeuret',
|
||||
"mdp" => 'achanger']
|
||||
];
|
@ -1,59 +0,0 @@
|
||||
<?php
|
||||
namespace controller;
|
||||
use Exception;
|
||||
|
||||
//gerer la connexion des admins
|
||||
class AdminController {
|
||||
public function __construct(string $action){
|
||||
global $twig;
|
||||
//on initialise un tableau d'erreur pour etre utilisé par la vue erreur
|
||||
$dVueEreur = [];
|
||||
|
||||
//verifier si l'utilisateur est connecté et admin
|
||||
if(isset($_SESSION["isAdmin"])){
|
||||
if($_SESSION["isAdmin"]==true){
|
||||
//donner la page admin a l'admin
|
||||
try {
|
||||
switch($action) {
|
||||
case '':
|
||||
echo "accueil admin";exit;
|
||||
// echo $twig->render('admin/accueil.html');
|
||||
break;
|
||||
case 'stats':
|
||||
echo "stats admin";exit;
|
||||
// echo $twig->render('admin/stats.html');
|
||||
break;
|
||||
case 'ajouterScientifiques':
|
||||
echo "page ajout scientifiques admin";exit;
|
||||
// echo $twig->render('admin/ajouter.html');
|
||||
break;
|
||||
//mauvaise action
|
||||
default:
|
||||
$dVueErreur[] = "Erreur d'appel php";
|
||||
echo $twig->render('accueil.html', ['dVueErreur' => $dVueErreur]);
|
||||
break;
|
||||
}
|
||||
} catch (\PDOException $e) {
|
||||
$dVueErreur[] = 'Erreur avec la base de données !';
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
} catch (\Exception $e2) {
|
||||
$dVueErreur[] = 'Erreur inattendue !';
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//verifier si l'utilisateur est connecté mais pas admin
|
||||
if(isset($_SESSION["isLogged"])){
|
||||
if($_SESSION["isLogged"]==true) {
|
||||
//dire acces interdit au non admins
|
||||
array_push($dVueEreur, "Erreur 403 : Acces interdit");
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
//renvoyer a la page de connexion pour les non connectés
|
||||
echo $twig->render('login.html');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,129 +0,0 @@
|
||||
<?php
|
||||
namespace controller;
|
||||
|
||||
use config\Validation;
|
||||
use http\Params;
|
||||
use model\Connection;
|
||||
use model\LoginException;
|
||||
use model\MdlAdmin;
|
||||
use model\MdlUser;
|
||||
|
||||
class FrontController
|
||||
{
|
||||
private Connection $con;
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
global $twig, $router;
|
||||
global $basePath;
|
||||
|
||||
//altorouter
|
||||
$router = new \AltoRouter();
|
||||
$router->setBasePath($basePath);
|
||||
|
||||
$router->map('GET|POST','/[a:action]?','UserController');
|
||||
$router->map('GET|POST','/admin/[a:action]','AdminController');
|
||||
|
||||
$router->map('GET|POST', '/validationFormulaire', 'validationFormulaire');
|
||||
$router->map('GET|POST', '/logout', 'disconnect');
|
||||
|
||||
|
||||
// Tableau qui contient les messages d'erreur
|
||||
$dVueErreur = [];
|
||||
$dVue = [];
|
||||
$dVue['basePath'] = $basePath;
|
||||
|
||||
session_start();
|
||||
|
||||
if(isset($_SESSION['pseudo']))
|
||||
$dVue['pseudo'] = $_SESSION['pseudo'];
|
||||
|
||||
try {
|
||||
$match = $router->match();
|
||||
|
||||
if (!$match) {
|
||||
throw new \Exception('Wrong call');
|
||||
}
|
||||
|
||||
switch($match['target']) {
|
||||
|
||||
case 'UserController':
|
||||
$this->callController('UserController',$match);
|
||||
break;
|
||||
|
||||
case 'AdminController':
|
||||
$action = $match['params']['action'];
|
||||
if (!MdlAdmin::isAdmin()) {
|
||||
$action = 'login';
|
||||
}
|
||||
$this->callController('AdminController',$action);
|
||||
|
||||
case 'PseudoController':
|
||||
$this->callController('PseudoController',$match);
|
||||
break;
|
||||
|
||||
case 'validationFormulaire':
|
||||
$this->ValidationFormulaire($dVueErreur, $dVue);
|
||||
break;
|
||||
|
||||
//mauvaise action
|
||||
default:
|
||||
$dVueErreur[] = "Erreur d'appel php";
|
||||
echo $twig->render('accueil.html', ['dVueErreur' => $dVueErreur]);
|
||||
break;
|
||||
}
|
||||
} catch (\PDOException $e) {
|
||||
$dVueErreur[] = 'Erreur avec la base de données !';
|
||||
$dVueErreur[] = $e->getMessage();
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
} catch (LoginException $e) {
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
echo $twig->render('login.html');
|
||||
} catch (\Exception $e2) {
|
||||
$dVueErreur[] = 'Erreur inattendue !'.$e2->getMessage();
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
private function callController(string $cont, array $match) {
|
||||
global $twig;
|
||||
|
||||
$controller = '\\controller\\'.$cont;
|
||||
$controller = new $controller;
|
||||
$action = $match['params']['action'] ?? 'accueil';
|
||||
|
||||
if (is_callable(array($controller,$action))) {
|
||||
call_user_func_array(array($controller,$action),array($match['params']));
|
||||
} else {
|
||||
echo $twig->render('erreur.html', ['dVueErreur' => array('Page inconnue')]);
|
||||
}
|
||||
}
|
||||
|
||||
public function ValidationFormulaire(array &$dVueErreur, array &$dVue)
|
||||
{
|
||||
global $twig;
|
||||
|
||||
$id_jeu = $_POST['jeu'] ?? '';
|
||||
$id_difficulte = $_POST['difficulte'] ?? '';
|
||||
try{
|
||||
\config\Validation::val_form($id_jeu, $id_difficulte, $dVueErreur);
|
||||
}catch (\model\ValidationException $ex){
|
||||
$this->CreateParty($dVueErreur);
|
||||
}catch (\Exception $ex){
|
||||
$this->CreateParty($dVueErreur);
|
||||
}
|
||||
|
||||
if(count($dVueErreur) == 0){
|
||||
$jeu = (new \model\MdlJeu())->getFromId($id_jeu);
|
||||
$difficulte = (new \model\MdlDifficulte())->getFromId($id_difficulte);
|
||||
$_SESSION['configuration'] = new \model\ConfigurationJeu($jeu, $difficulte);
|
||||
|
||||
header("Location: /pseudo");
|
||||
#echo $twig->render('accueil.html', ['dVue' => $dVue, 'dVueErreur' => $dVueErreur]);
|
||||
}else{
|
||||
$this->CreateParty($dVueErreur);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
namespace controller;
|
||||
|
||||
use config\Validation;
|
||||
use Exception;
|
||||
use model\ValidationException;
|
||||
|
||||
class JouerController{
|
||||
|
||||
public function __construct(){
|
||||
global $twig, $config;
|
||||
$dVue = [];
|
||||
$dVueErreur = [];
|
||||
|
||||
if(isset($_SESSION["configuration"]) && isset($_SESSION['role'])){
|
||||
try{
|
||||
$role = $_SESSION['role'];
|
||||
$role = Validation::valRole($role, $dVueErreur);
|
||||
$configurationJeu = $_SESSION['configuration'];
|
||||
$configurationJeu = Validation::valConfigurationJeu($configurationJeu, $dVueErreur);
|
||||
}catch(ValidationException $e){
|
||||
header('Location: .');
|
||||
}
|
||||
|
||||
if(count($dVueErreur) == 0){
|
||||
$idJeu = $configurationJeu->getJeu()->getId();
|
||||
switch($idJeu){
|
||||
case 3:
|
||||
new PenduController($role, $configurationJeu);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Jeu non défini !");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
header("Location: .");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace controller;
|
||||
|
||||
use model\ConfigurationJeu;
|
||||
use model\Joueur;
|
||||
use model\MdlPendu;
|
||||
use model\MdlScientifique;
|
||||
use config\Validation;
|
||||
use model\ValidationException;
|
||||
|
||||
class PenduController{
|
||||
private array $dVue;
|
||||
private array $dVueErreur;
|
||||
private MdlPendu $pendu;
|
||||
public function __construct(Joueur $role, ConfigurationJeu $configJeu)
|
||||
{
|
||||
$this->dVue = [];
|
||||
$this->dVueErreur = [];
|
||||
if(isset($_SESSION['pendu']) && Validation::valMdlPendu($_SESSION['pendu'], $this->dVueErreur)){
|
||||
$this->pendu = $_SESSION['pendu'];
|
||||
}else{
|
||||
$this->reinit();
|
||||
}
|
||||
|
||||
if(isset($_POST['lettre'])){
|
||||
try{
|
||||
$this->pendu->jouerLettre($_POST['lettre']);
|
||||
}catch (ValidationException $e){
|
||||
$this->dVueErreur[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if($this->pendu->aGagne()){
|
||||
$this->renderAgagne();
|
||||
}elseif($this->pendu->aPerdu()){
|
||||
$this->renderAPerdu();
|
||||
}else{
|
||||
$this->renderJeu();
|
||||
}
|
||||
}
|
||||
|
||||
private function reinit(){
|
||||
$mdlScientifique = new MdlScientifique();
|
||||
$scientifique = $mdlScientifique->getRandom();
|
||||
$this->pendu = new MdlPendu($scientifique);
|
||||
$_SESSION['pendu'] = $this->pendu;
|
||||
}
|
||||
|
||||
private function renderJeu(){
|
||||
global $twig, $config;
|
||||
$this->dVue['decouvert'] = $this->pendu->getDecouvert();
|
||||
$this->dVue['essaisRestant'] = $this->pendu->getEssaisRestant();
|
||||
$lettreUtilisees = $this->pendu->getLettreUtilisees();
|
||||
sort($lettreUtilisees);
|
||||
$this->dVue['lettresUtilisees'] = $lettreUtilisees;
|
||||
echo $twig->render($config['templates']['pendu'], ['dVue' => $this->dVue, 'dVueErreur'=>$this->dVueErreur]);
|
||||
}
|
||||
|
||||
private function renderAgagne(){
|
||||
$this->dVue['messageScore'] = "Vous avez gagné !";
|
||||
$this->renderScore();
|
||||
}
|
||||
|
||||
private function renderAPerdu(){
|
||||
$this->dVue['messageScore'] = "Vous avez perdu !";
|
||||
$this->renderScore();
|
||||
}
|
||||
|
||||
private function renderScore(){
|
||||
global $twig, $config;
|
||||
$this->dVue['nbTours'] = $this->pendu->getNbTours();
|
||||
$this->dVue['nbFails'] = $this->pendu->getNbFails();
|
||||
$scientifique = $this->pendu->getScientifique();
|
||||
$dScientifique = [];
|
||||
$dScientifique['nom'] = $scientifique->getNom();
|
||||
$dScientifique['prenom'] = $scientifique->getPrenom();
|
||||
$dScientifique['sexe'] = $scientifique->getSexe()->getLibelle();
|
||||
$dScientifique['thematique'] = $scientifique->getThematique()->getLibelle();
|
||||
$dScientifique['dateNaiss'] = $scientifique->getDateNaiss()->format('d/m/Y');
|
||||
$this->dVue['scientifique'] = $dScientifique;
|
||||
unset($_SESSION['pendu']);
|
||||
|
||||
echo $twig->render($config['templates']['penduScore'], ["dVue" => $this->dVue]);
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
namespace controller;
|
||||
|
||||
use config\Validation;
|
||||
use model\IdSessionDoubleException;
|
||||
use model\PseudoDejaPrisException;
|
||||
use model\ValidationException;
|
||||
use model\MdlInvite;
|
||||
|
||||
class PseudoController{
|
||||
|
||||
public function __construct(){
|
||||
global $twig, $config;
|
||||
$dVue = [];
|
||||
$dVueErreur = [];
|
||||
|
||||
if(isset($_POST["pseudo"])){
|
||||
try{
|
||||
$mdlInvite = new MdlInvite();
|
||||
$pseudo = $_POST["pseudo"];
|
||||
$pseudo = Validation::valPseudo($pseudo, $dVueErreur);
|
||||
$role = $mdlInvite->insertInvite($pseudo, session_id());
|
||||
}catch(ValidationException $e){
|
||||
|
||||
}catch(PseudoDejaPrisException $e){
|
||||
$dVueErreur[] = "Pseudo déjà pris";
|
||||
}catch(IdSessionDoubleException $e){
|
||||
try{
|
||||
$role = $mdlInvite->setPseudo($e->getIdJoueur(), $pseudo);
|
||||
|
||||
}catch(PseudoDejaPrisException $e){
|
||||
$dVueErreur[] = "Pseudo déjà pris";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($role)){
|
||||
$_SESSION['role'] = $role;
|
||||
header('Location: jouer');
|
||||
}
|
||||
}
|
||||
echo $twig->render($config['templates']['pseudo'], ["dVue" => $dVue, "dVueErreur" => $dVueErreur]);
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace controller;
|
||||
|
||||
use config\Validation;
|
||||
use model\Connection;
|
||||
use model\GameGateway;
|
||||
use model\ValidationException;
|
||||
|
||||
class UserController {
|
||||
|
||||
public function accueil(array $params) {
|
||||
global $twig;
|
||||
|
||||
echo $twig->render('accueil.html');
|
||||
}
|
||||
|
||||
public function joinParty(array $params) {
|
||||
global $twig;
|
||||
|
||||
if(isset($_POST['codeInvitation'])){
|
||||
$codeInvitation = $_POST['codeInvitation'];
|
||||
Validation::valCodeInvitation($codeInvitation, $dVueErreur);
|
||||
echo $twig->render('join.html');
|
||||
}
|
||||
}
|
||||
|
||||
public function jouer(array $params) {
|
||||
global $twig, $config;
|
||||
$dVue = [];
|
||||
$dVueErreur = [];
|
||||
|
||||
if(isset($_SESSION["configuration"]) && isset($_SESSION['role'])){
|
||||
try{
|
||||
$role = $_SESSION['role'];
|
||||
$role = Validation::valRole($role, $dVueErreur);
|
||||
$configurationJeu = $_SESSION['configuration'];
|
||||
$configurationJeu = Validation::valConfigurationJeu($configurationJeu, $dVueErreur);
|
||||
}catch(ValidationException $e){
|
||||
header('Location: .');
|
||||
}
|
||||
|
||||
if(count($dVueErreur) == 0){
|
||||
$idJeu = $configurationJeu->getJeu()->getId();
|
||||
switch($idJeu){
|
||||
case 3:
|
||||
new PenduController($role, $configurationJeu);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Jeu non défini !");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
header("Location: .");
|
||||
}
|
||||
}
|
||||
|
||||
public function createParty(array $params) : void
|
||||
{
|
||||
global $twig;
|
||||
global $dVueErreur;
|
||||
|
||||
$listJeu = (new \model\MdlJeu())->getAll();
|
||||
$listDifficulte = (new \model\MdlDifficulte())->getAll();
|
||||
|
||||
$dVueCreateJeu = [];
|
||||
foreach($listJeu as $jeu){
|
||||
$dVueCreateJeu[] = ['id' => $jeu->getId(), 'nom' => $jeu->getNom()];
|
||||
}
|
||||
|
||||
$dVueCreateDifficulte = [];
|
||||
foreach($listDifficulte as $difficulte){
|
||||
$dVueCreateDifficulte[] = ['id' => $difficulte->getId(), 'libelle' => $difficulte->getLibelle()];
|
||||
}
|
||||
|
||||
echo $twig->render('create.html', ["dVueErreur" => $dVueErreur, 'dVueCreate' => ["jeux" => $dVueCreateJeu, "difficultes" => $dVueCreateDifficulte]]);
|
||||
}
|
||||
}
|
@ -1,597 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.3.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
--bs-pink: #d63384;
|
||||
--bs-red: #dc3545;
|
||||
--bs-orange: #fd7e14;
|
||||
--bs-yellow: #ffc107;
|
||||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
--bs-gray-100: #f8f9fa;
|
||||
--bs-gray-200: #e9ecef;
|
||||
--bs-gray-300: #dee2e6;
|
||||
--bs-gray-400: #ced4da;
|
||||
--bs-gray-500: #adb5bd;
|
||||
--bs-gray-600: #6c757d;
|
||||
--bs-gray-700: #495057;
|
||||
--bs-gray-800: #343a40;
|
||||
--bs-gray-900: #212529;
|
||||
--bs-primary: #0d6efd;
|
||||
--bs-secondary: #6c757d;
|
||||
--bs-success: #198754;
|
||||
--bs-info: #0dcaf0;
|
||||
--bs-warning: #ffc107;
|
||||
--bs-danger: #dc3545;
|
||||
--bs-light: #f8f9fa;
|
||||
--bs-dark: #212529;
|
||||
--bs-primary-rgb: 13, 110, 253;
|
||||
--bs-secondary-rgb: 108, 117, 125;
|
||||
--bs-success-rgb: 25, 135, 84;
|
||||
--bs-info-rgb: 13, 202, 240;
|
||||
--bs-warning-rgb: 255, 193, 7;
|
||||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text-emphasis: #052c65;
|
||||
--bs-secondary-text-emphasis: #2b2f32;
|
||||
--bs-success-text-emphasis: #0a3622;
|
||||
--bs-info-text-emphasis: #055160;
|
||||
--bs-warning-text-emphasis: #664d03;
|
||||
--bs-danger-text-emphasis: #58151c;
|
||||
--bs-light-text-emphasis: #495057;
|
||||
--bs-dark-text-emphasis: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #e2e3e5;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #c4c8cb;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
--bs-body-font-size: 1rem;
|
||||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-color: #212529;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-xxl: 2rem;
|
||||
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
--bs-focus-ring-width: 0.25rem;
|
||||
--bs-focus-ring-opacity: 0.25;
|
||||
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
|
||||
--bs-form-valid-color: #198754;
|
||||
--bs-form-valid-border-color: #198754;
|
||||
--bs-form-invalid-color: #dc3545;
|
||||
--bs-form-invalid-border-color: #dc3545;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
color-scheme: dark;
|
||||
--bs-body-color: #dee2e6;
|
||||
--bs-body-color-rgb: 222, 226, 230;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-emphasis-color-rgb: 255, 255, 255;
|
||||
--bs-secondary-color: rgba(222, 226, 230, 0.75);
|
||||
--bs-secondary-color-rgb: 222, 226, 230;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
|
||||
--bs-tertiary-color-rgb: 222, 226, 230;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-primary-text-emphasis: #6ea8fe;
|
||||
--bs-secondary-text-emphasis: #a7acb1;
|
||||
--bs-success-text-emphasis: #75b798;
|
||||
--bs-info-text-emphasis: #6edff6;
|
||||
--bs-warning-text-emphasis: #ffda6a;
|
||||
--bs-danger-text-emphasis: #ea868f;
|
||||
--bs-light-text-emphasis: #f8f9fa;
|
||||
--bs-dark-text-emphasis: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #161719;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #41464b;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #087990;
|
||||
--bs-warning-border-subtle: #997404;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #8bb9fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 139, 185, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-highlight-color: #dee2e6;
|
||||
--bs-highlight-bg: #664d03;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
--bs-form-valid-color: #75b798;
|
||||
--bs-form-valid-border-color: #75b798;
|
||||
--bs-form-invalid-color: #ea868f;
|
||||
--bs-form-invalid-border-color: #ea868f;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
:root {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--bs-body-font-family);
|
||||
font-size: var(--bs-body-font-size);
|
||||
font-weight: var(--bs-body-font-weight);
|
||||
line-height: var(--bs-body-line-height);
|
||||
color: var(--bs-body-color);
|
||||
text-align: var(--bs-body-text-align);
|
||||
background-color: var(--bs-body-bg);
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(1.375rem + 1.5vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(1.325rem + 0.9vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(1.3rem + 0.6vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h3 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h4 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
mark {
|
||||
padding: 0.1875em;
|
||||
color: var(--bs-highlight-color);
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
pre code {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
caption-side: bottom;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody,
|
||||
tfoot,
|
||||
tr,
|
||||
td,
|
||||
th {
|
||||
border-color: inherit;
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
[role=button] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
select:disabled {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
[type=button],
|
||||
[type=reset],
|
||||
[type=submit] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
button:not(:disabled),
|
||||
[type=button]:not(:disabled),
|
||||
[type=reset]:not(:disabled),
|
||||
[type=submit]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
line-height: inherit;
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
legend {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
legend + * {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
::-webkit-datetime-edit-fields-wrapper,
|
||||
::-webkit-datetime-edit-text,
|
||||
::-webkit-datetime-edit-minute,
|
||||
::-webkit-datetime-edit-hour-field,
|
||||
::-webkit-datetime-edit-day-field,
|
||||
::-webkit-datetime-edit-month-field,
|
||||
::-webkit-datetime-edit-year-field {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-inner-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* rtl:raw:
|
||||
[type="tel"],
|
||||
[type="url"],
|
||||
[type="email"],
|
||||
[type="number"] {
|
||||
direction: ltr;
|
||||
}
|
||||
*/
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
@ -1,594 +0,0 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.3.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2023 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
--bs-pink: #d63384;
|
||||
--bs-red: #dc3545;
|
||||
--bs-orange: #fd7e14;
|
||||
--bs-yellow: #ffc107;
|
||||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
--bs-gray-100: #f8f9fa;
|
||||
--bs-gray-200: #e9ecef;
|
||||
--bs-gray-300: #dee2e6;
|
||||
--bs-gray-400: #ced4da;
|
||||
--bs-gray-500: #adb5bd;
|
||||
--bs-gray-600: #6c757d;
|
||||
--bs-gray-700: #495057;
|
||||
--bs-gray-800: #343a40;
|
||||
--bs-gray-900: #212529;
|
||||
--bs-primary: #0d6efd;
|
||||
--bs-secondary: #6c757d;
|
||||
--bs-success: #198754;
|
||||
--bs-info: #0dcaf0;
|
||||
--bs-warning: #ffc107;
|
||||
--bs-danger: #dc3545;
|
||||
--bs-light: #f8f9fa;
|
||||
--bs-dark: #212529;
|
||||
--bs-primary-rgb: 13, 110, 253;
|
||||
--bs-secondary-rgb: 108, 117, 125;
|
||||
--bs-success-rgb: 25, 135, 84;
|
||||
--bs-info-rgb: 13, 202, 240;
|
||||
--bs-warning-rgb: 255, 193, 7;
|
||||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text-emphasis: #052c65;
|
||||
--bs-secondary-text-emphasis: #2b2f32;
|
||||
--bs-success-text-emphasis: #0a3622;
|
||||
--bs-info-text-emphasis: #055160;
|
||||
--bs-warning-text-emphasis: #664d03;
|
||||
--bs-danger-text-emphasis: #58151c;
|
||||
--bs-light-text-emphasis: #495057;
|
||||
--bs-dark-text-emphasis: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #e2e3e5;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #c4c8cb;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
--bs-body-font-size: 1rem;
|
||||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-color: #212529;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-xxl: 2rem;
|
||||
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
--bs-focus-ring-width: 0.25rem;
|
||||
--bs-focus-ring-opacity: 0.25;
|
||||
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
|
||||
--bs-form-valid-color: #198754;
|
||||
--bs-form-valid-border-color: #198754;
|
||||
--bs-form-invalid-color: #dc3545;
|
||||
--bs-form-invalid-border-color: #dc3545;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
color-scheme: dark;
|
||||
--bs-body-color: #dee2e6;
|
||||
--bs-body-color-rgb: 222, 226, 230;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-emphasis-color-rgb: 255, 255, 255;
|
||||
--bs-secondary-color: rgba(222, 226, 230, 0.75);
|
||||
--bs-secondary-color-rgb: 222, 226, 230;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
|
||||
--bs-tertiary-color-rgb: 222, 226, 230;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-primary-text-emphasis: #6ea8fe;
|
||||
--bs-secondary-text-emphasis: #a7acb1;
|
||||
--bs-success-text-emphasis: #75b798;
|
||||
--bs-info-text-emphasis: #6edff6;
|
||||
--bs-warning-text-emphasis: #ffda6a;
|
||||
--bs-danger-text-emphasis: #ea868f;
|
||||
--bs-light-text-emphasis: #f8f9fa;
|
||||
--bs-dark-text-emphasis: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #161719;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #41464b;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #087990;
|
||||
--bs-warning-border-subtle: #997404;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #8bb9fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 139, 185, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-highlight-color: #dee2e6;
|
||||
--bs-highlight-bg: #664d03;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
--bs-form-valid-color: #75b798;
|
||||
--bs-form-valid-border-color: #75b798;
|
||||
--bs-form-invalid-color: #ea868f;
|
||||
--bs-form-invalid-border-color: #ea868f;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
:root {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--bs-body-font-family);
|
||||
font-size: var(--bs-body-font-size);
|
||||
font-weight: var(--bs-body-font-weight);
|
||||
line-height: var(--bs-body-line-height);
|
||||
color: var(--bs-body-color);
|
||||
text-align: var(--bs-body-text-align);
|
||||
background-color: var(--bs-body-bg);
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(1.375rem + 1.5vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(1.325rem + 0.9vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(1.3rem + 0.6vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h3 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h4 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
mark {
|
||||
padding: 0.1875em;
|
||||
color: var(--bs-highlight-color);
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
pre code {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
caption-side: bottom;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody,
|
||||
tfoot,
|
||||
tr,
|
||||
td,
|
||||
th {
|
||||
border-color: inherit;
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
[role=button] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
select:disabled {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
[type=button],
|
||||
[type=reset],
|
||||
[type=submit] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
button:not(:disabled),
|
||||
[type=button]:not(:disabled),
|
||||
[type=reset]:not(:disabled),
|
||||
[type=submit]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
float: right;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
line-height: inherit;
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
legend {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
legend + * {
|
||||
clear: right;
|
||||
}
|
||||
|
||||
::-webkit-datetime-edit-fields-wrapper,
|
||||
::-webkit-datetime-edit-text,
|
||||
::-webkit-datetime-edit-minute,
|
||||
::-webkit-datetime-edit-hour-field,
|
||||
::-webkit-datetime-edit-day-field,
|
||||
::-webkit-datetime-edit-month-field,
|
||||
::-webkit-datetime-edit-year-field {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-inner-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
[type="tel"],
|
||||
[type="url"],
|
||||
[type="email"],
|
||||
[type="number"] {
|
||||
direction: ltr;
|
||||
}
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
|
@ -1,182 +0,0 @@
|
||||
|
||||
-- Testé sous pgsql 15
|
||||
|
||||
DROP TABLE IF EXISTS Reponse;
|
||||
|
||||
DROP TABLE IF EXISTS Question;
|
||||
|
||||
DROP TABLE IF EXISTS Admin;
|
||||
|
||||
DROP TABLE IF EXISTS Partie;
|
||||
|
||||
DROP TABLE IF EXISTS Jeu;
|
||||
|
||||
DROP TABLE IF EXISTS Decouvrir;
|
||||
|
||||
DROP TABLE IF EXISTS Utilisateur;
|
||||
|
||||
DROP TABLE IF EXISTS Invite;
|
||||
|
||||
DROP TABLE IF EXISTS Joueur;
|
||||
|
||||
DROP TABLE IF EXISTS Indice;
|
||||
|
||||
DROP TABLE IF EXISTS Scientifique;
|
||||
|
||||
DROP TABLE IF EXISTS Thematique;
|
||||
|
||||
DROP TABLE IF EXISTS Difficulte;
|
||||
|
||||
DROP TABLE IF EXISTS Sexe;
|
||||
|
||||
|
||||
-- THEMATIQUE
|
||||
|
||||
CREATE TABLE Thematique(
|
||||
id SERIAL PRIMARY KEY,
|
||||
libelle varchar(128) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- DIFFICULTE
|
||||
|
||||
CREATE TABLE Difficulte(
|
||||
id SERIAL PRIMARY KEY,
|
||||
libelle varchar(128) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- SEXE
|
||||
|
||||
CREATE TABLE Sexe(
|
||||
id SERIAL PRIMARY KEY,
|
||||
libelle varchar(128) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- SCIENTIFIQUE
|
||||
|
||||
CREATE TABLE Scientifique(
|
||||
id SERIAL PRIMARY KEY,
|
||||
nom varchar(128) NOT NULL,
|
||||
prenom varchar(128) NOT NULL,
|
||||
photo varchar(512) NOT NULL,
|
||||
dateNaissance date NOT NULL,
|
||||
descriptif text NOT NULL,
|
||||
ratioTrouvee numeric(5,4),
|
||||
idThematique integer REFERENCES Thematique(id),
|
||||
idDifficulte integer REFERENCES Difficulte(id),
|
||||
idSexe integer REFERENCES Sexe(id)
|
||||
);
|
||||
|
||||
|
||||
-- INDICE
|
||||
|
||||
CREATE TABLE Indice(
|
||||
id SERIAL PRIMARY KEY,
|
||||
libelle varchar(512) NOT NULL UNIQUE,
|
||||
idScientifique integer REFERENCES Scientifique(id)
|
||||
);
|
||||
|
||||
-- QUESTION
|
||||
|
||||
CREATE TABLE Question(
|
||||
id SERIAL PRIMARY KEY,
|
||||
question varchar(256) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- REPONSE
|
||||
|
||||
CREATE TABLE Reponse(
|
||||
id SERIAL PRIMARY KEY,
|
||||
reponse varchar(255) NOT NULL,
|
||||
idQuestion integer REFERENCES Question(id),
|
||||
idScientifique integer REFERENCES Scientifique(id)
|
||||
);
|
||||
|
||||
|
||||
-- ADMIN
|
||||
|
||||
CREATE TABLE Admin(
|
||||
id SERIAL PRIMARY KEY,
|
||||
email varchar(255) NOT NULL UNIQUE,
|
||||
password varchar(255) NOT NULL
|
||||
);
|
||||
|
||||
|
||||
-- JOUEUR
|
||||
|
||||
CREATE TABLE Joueur(
|
||||
id SERIAL PRIMARY KEY,
|
||||
pseudo varchar(255) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- Invite
|
||||
|
||||
CREATE TABLE Invite(
|
||||
idJoueur integer PRIMARY KEY REFERENCES Joueur(id),
|
||||
idSession varchar(255) NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
|
||||
-- Utilisateur
|
||||
|
||||
CREATE TABLE Utilisateur(
|
||||
idJoueur integer PRIMARY KEY REFERENCES Joueur(id),
|
||||
email varchar(255) NOT NULL UNIQUE,
|
||||
password varchar(255) NOT NULL
|
||||
);
|
||||
|
||||
|
||||
-- Decouvrir
|
||||
|
||||
CREATE TABLE Decouvrir(
|
||||
idUtilisateur integer REFERENCES Utilisateur(idJoueur),
|
||||
idScientifique integer REFERENCES Scientifique(id),
|
||||
PRIMARY KEY (idUtilisateur, idScientifique)
|
||||
);
|
||||
|
||||
|
||||
-- Jeu
|
||||
|
||||
CREATE TABLE Jeu(
|
||||
id SERIAL PRIMARY KEY,
|
||||
nom varchar(128) NOT NULL UNIQUE,
|
||||
nbrParties integer NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
|
||||
-- Partie
|
||||
|
||||
CREATE TABLE Partie(
|
||||
id SERIAL PRIMARY KEY,
|
||||
codeInvitation varchar(10) NOT NULL UNIQUE,
|
||||
idJoueur integer REFERENCES Joueur(id),
|
||||
idJeu integer REFERENCES Jeu(id)
|
||||
);
|
||||
|
||||
|
||||
-- INSERTS
|
||||
|
||||
INSERT INTO Jeu(nom) VALUES ('Qui-est-ce ?'),('Kahoot'), ('Pendu');
|
||||
|
||||
INSERT INTO Difficulte(libelle) VALUES ('Facile'),('Intermédiaire'),('Difficile');
|
||||
|
||||
INSERT INTO Sexe(libelle) VALUES ('Homme'),('Femme');
|
||||
|
||||
INSERT INTO Thematique(libelle) VALUES ('Nucléaire'),('Mathématiques');
|
||||
|
||||
INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, idSexe)
|
||||
VALUES
|
||||
('nomToto', 'prenomToto', '', CURRENT_DATE, 'desc', 0, 1, 1, 1),
|
||||
('nomTiti', 'prenomTiti', '', CURRENT_DATE, 'desc', 0, 2, 2, 2);
|
||||
|
||||
|
||||
INSERT INTO Joueur(id,pseudo) VALUES (1337, 'moi, le meilleur joueur du monde');
|
||||
INSERT INTO Utilisateur(idJoueur,email,password) VALUES (1337, 'joueur','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS');
|
||||
-- mdp = test
|
||||
|
||||
INSERT INTO Admin(id,email,password) VALUES (1, 'admin','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS');
|
||||
-- mdp = test
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
require_once(__DIR__.'/vendor/autoload.php');
|
||||
require_once(__DIR__.'/config/config.php');
|
||||
|
||||
|
||||
use controller\FrontController;
|
||||
|
||||
//twig
|
||||
$loader = new \Twig\Loader\FilesystemLoader('templates');
|
||||
$twig = new \Twig\Environment($loader, [
|
||||
'cache' => false,
|
||||
]);
|
||||
|
||||
$dVueErreur = array();
|
||||
$basePath = preg_replace('/\/index.php/i', '', $_SERVER['PHP_SELF']);
|
||||
|
||||
$cont = new FrontController();
|
||||
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class IdSessionDoubleException extends \RuntimeException
|
||||
{
|
||||
private int $idJoueur;
|
||||
private string $idSession;
|
||||
|
||||
public function __construct($idJoueur, $idSession)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->idJoueur=$idJoueur;
|
||||
$this->idSession=$idSession;
|
||||
}
|
||||
|
||||
public function getIdJoueur():int{
|
||||
return $this->idJoueur;
|
||||
}
|
||||
|
||||
public function getIdSession(): string{
|
||||
return $this->idSession;
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class LoginException extends \Exception
|
||||
{
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class PseudoDejaPrisException extends \RuntimeException
|
||||
{
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
namespace model;
|
||||
|
||||
class ValidationException extends \RuntimeException{
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class AdminGateway
|
||||
{
|
||||
private \PDO $con;
|
||||
private \PDOStatement $stmt;
|
||||
public function __construct(Connection $con)
|
||||
{
|
||||
$this->con=$con;
|
||||
}
|
||||
|
||||
public function login(string $email, string $password): bool
|
||||
{
|
||||
$sql = "SELECT * FROM Admin WHERE email=:email";
|
||||
$this->con->executeQuery($sql, array(
|
||||
':email' => array($email, \PDO::PARAM_STR)
|
||||
));
|
||||
|
||||
$result = $this->con->getOneResult();
|
||||
|
||||
if (!empty($result)) {
|
||||
return password_verify($password,$result['password']);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function addUser(string $email, string $password): void
|
||||
{
|
||||
$sql = "INSERT INTO Admin (email, password) VALUES (:email, :password)";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':email', $email);
|
||||
$stmt->bindValue(':password', password_hash($password, PASSWORD_DEFAULT));
|
||||
$stmt->execute();
|
||||
}
|
||||
public function deleteUser(int $id): void
|
||||
{
|
||||
$sql = "DELETE FROM Admin WHERE id=:id";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':id', $id);
|
||||
$stmt->execute();
|
||||
}
|
||||
public function updateUser(int $id, string $email, string $password): void
|
||||
{
|
||||
$sql = "UPDATE Admin SET email=:email, password=:password WHERE id=:id";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':id', $id);
|
||||
$stmt->bindValue(':email', $email);
|
||||
$stmt->bindValue(':password', password_hash($password, PASSWORD_DEFAULT));
|
||||
$stmt->execute();
|
||||
}
|
||||
public function getUser(int $id): User
|
||||
{
|
||||
$sql = "SELECT * FROM Admin WHERE id=:id";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':id', $id);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
return new User($result['id'], $result['email'], $result['password']);
|
||||
}
|
||||
public function getUsers(): array
|
||||
{
|
||||
$sql = "SELECT * FROM Admin";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll();
|
||||
$users = [];
|
||||
foreach ($result as $user) {
|
||||
$users[] = new User($user['id'], $user['email'], $user['password']);
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
public function getHashedPasswordById(int $id): string
|
||||
{
|
||||
$sql = "SELECT password FROM Admin WHERE id=:id";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':id', $id);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
return $result['password'];
|
||||
}
|
||||
public function getHashedPassword(int $email): string
|
||||
{
|
||||
$sql = "SELECT password FROM Admin WHERE email=:email";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':email', $email);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
return $result['password'];
|
||||
}
|
||||
|
||||
public function getUserId(string $email): int
|
||||
{
|
||||
$sql = "SELECT id FROM Admin WHERE email=:email";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':email', $email);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
return $result['id'];
|
||||
}
|
||||
public function getUserByEmailAndPassword(string $email, string $password): User
|
||||
{
|
||||
$sql = "SELECT * FROM Admin WHERE email=:email AND password=:password";
|
||||
$stmt = $this->con->prepare($sql);
|
||||
$stmt->bindValue(':email', $email);
|
||||
$stmt->bindValue(':password', password_hash($password, PASSWORD_DEFAULT));
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetch();
|
||||
return new User($result['id'], $result['email'], $result['password']);
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
use PDO;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public function getOneResult() {
|
||||
return $this->stmt->fetch();
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class DifficulteGateway
|
||||
{
|
||||
private $con;
|
||||
|
||||
function __construct(Connection $con) {
|
||||
$this->con = $con;
|
||||
}
|
||||
public function getAll() : array
|
||||
{
|
||||
$this->con->executeQuery("SELECT id, libelle FROM Difficulte;");
|
||||
return $this->con->getResults();
|
||||
}
|
||||
|
||||
public function getFromId(int $id): array
|
||||
{
|
||||
$this->con->executeQuery("SELECT id, libelle FROM Difficulte WHERE id=:id;",
|
||||
[':id' => [$id, $this->con::PARAM_INT]]);
|
||||
return $this->con->getOneResult();
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class GameGateway
|
||||
{
|
||||
private $con;
|
||||
|
||||
function __construct(Connection $co) {
|
||||
$this->con = $co;
|
||||
}
|
||||
public static function getGames() : array
|
||||
{
|
||||
// TODO: implémenter requête SQL
|
||||
return array(
|
||||
0 => ["Qui-est-ce ?", "Le qui est-ce...."],
|
||||
1 => ["Kahoot", "Le Kahoot permet..."]
|
||||
);
|
||||
}
|
||||
|
||||
public function getGameByCode(int $code) : array {
|
||||
$query = 'SELECT * FROM Partie WHERE codeInvitation=:id';
|
||||
$this->con->executeQuery($query,array(
|
||||
':id' => array($code,\PDO::PARAM_INT)
|
||||
));
|
||||
return $this->con->getResults();
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class InviteGateway extends JoueurGateway
|
||||
{
|
||||
|
||||
function __construct(Connection $con) {
|
||||
parent::__construct($con);
|
||||
}
|
||||
|
||||
public function getFromIdSession($idSession): array|bool
|
||||
{
|
||||
$this->con->executeQuery("SELECT idJoueur, pseudo, idSession FROM Invite JOIN Joueur ON id=idJoueur WHERE idSession = :idSession;",
|
||||
[":idSession" => [$idSession, $this->con::PARAM_STR]]);
|
||||
return $this->con->getOneResult();
|
||||
}
|
||||
|
||||
public function getFromId($id): array|bool
|
||||
{
|
||||
$this->con->executeQuery("SELECT idJoueur, pseudo, idSession FROM Invite JOIN Joueur ON id=idJoueur WHERE id = :id;",
|
||||
[":id" => [$id, $this->con::PARAM_INT]]);
|
||||
return $this->con->getOneResult();
|
||||
}
|
||||
|
||||
public function insertInvite(string $pseudo, string $idSession): int{
|
||||
$row = $this->getFromIdSession($idSession);
|
||||
if($row != false){
|
||||
throw new IdSessionDoubleException($row['idjoueur'], $row['idsession']);
|
||||
}else{
|
||||
$id = $this->insertJoueur($pseudo);
|
||||
$this->con->executeQuery("INSERT INTO Invite(idJoueur, idSession) VALUES(:id, :idSession);",
|
||||
[":id" => [$id, $this->con::PARAM_INT],
|
||||
":idSession" => [$idSession, $this->con::PARAM_STR]]);
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
use PDO;
|
||||
|
||||
class JeuGateway
|
||||
{
|
||||
private $con;
|
||||
|
||||
function __construct(Connection $con) {
|
||||
$this->con = $con;
|
||||
}
|
||||
public function getAll() : array
|
||||
{
|
||||
$this->con->executeQuery("SELECT id, nom, nbrparties FROM Jeu;");
|
||||
return $this->con->getResults();
|
||||
}
|
||||
|
||||
public function getFromId(int $id): array
|
||||
{
|
||||
$this->con->executeQuery("SELECT id, nom, nbrparties FROM Jeu WHERE id=:id;",
|
||||
[':id' => [$id, $this->con::PARAM_INT]]);
|
||||
return $this->con->getOneResult();
|
||||
}
|
||||
}
|