You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.1 KiB
82 lines
2.1 KiB
<?php
|
|
|
|
namespace controleur;
|
|
|
|
use config\Validation;
|
|
|
|
class UtilisateurControleur
|
|
{
|
|
public function __construct()
|
|
{
|
|
global $twig;
|
|
if (!isset($_REQUEST["action"])) {
|
|
$action = NULL;
|
|
} else {
|
|
$action = Validation::nettoyerString($_REQUEST["action"]);
|
|
}
|
|
switch ($action) {
|
|
case NULL:
|
|
case "accueil":
|
|
$this->accueil();
|
|
break;
|
|
case "connection":
|
|
$this->connection();
|
|
break;
|
|
case "inscription":
|
|
$this->inscription();
|
|
break;
|
|
case "consulterProfilLimite":
|
|
$this->consulterProfilLimite();
|
|
break;
|
|
default:
|
|
$dVueErreur[] ="Action inconnue ou non autorisée";
|
|
echo $twig->render("erreur.html",['dVueErreur' => $dVueErreur]);
|
|
|
|
}
|
|
}
|
|
|
|
protected function connection()
|
|
{
|
|
global $twig;
|
|
echo $twig->render('connexion.html', []);
|
|
}
|
|
|
|
protected function inscription()
|
|
{
|
|
global $twig;
|
|
echo $twig->render('inscription.html', []);
|
|
}
|
|
|
|
protected function accueil()
|
|
{
|
|
global $twig;
|
|
/* Temporaire (le temps d'avoir en base) */
|
|
$eventsList = [
|
|
[
|
|
'imagePath' => 'assets/event1.png',
|
|
'nom' => 'Événement 1',
|
|
'description' => 'Description de l\'événement 1',
|
|
'date' => '01/01/2023'
|
|
],
|
|
[
|
|
'imagePath' => 'assets/event2.png',
|
|
'nom' => 'Événement 2',
|
|
'description' => 'Description de l\'événement 2',
|
|
'date' => '02/01/2023'
|
|
],
|
|
[
|
|
'imagePath' => 'assets/event3.png',
|
|
'nom' => 'Événement 3',
|
|
'description' => 'Description de l\'événement 3',
|
|
'date' => '03/01/2023'
|
|
]
|
|
];
|
|
echo $twig->render('accueil.html', ["eventsList"=>$eventsList]);
|
|
}
|
|
|
|
protected function consulterProfilLimite()
|
|
{
|
|
//TODO
|
|
}
|
|
|
|
} |