|
|
@ -1,41 +1,12 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace App\controleur;
|
|
|
|
namespace App\controleur;
|
|
|
|
use App\controleur\UtilisateurModele;
|
|
|
|
use App\gateway\ImageSaver;
|
|
|
|
use App\controleur\ImageSaver;
|
|
|
|
|
|
|
|
use App\config\Validation;
|
|
|
|
use App\config\Validation;
|
|
|
|
|
|
|
|
use App\modele\AdminModele;
|
|
|
|
|
|
|
|
|
|
|
|
class AdminControleur extends ModerateurControleur
|
|
|
|
class AdminControleur extends ModerateurControleur
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
if (!isset($_REQUEST["action"])) {
|
|
|
|
|
|
|
|
$action = NULL;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$action = \App\config\Validation::nettoyerString($_REQUEST["action"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($action) {
|
|
|
|
|
|
|
|
case "supprimerCompte":
|
|
|
|
|
|
|
|
$this->supprimerCompte();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "consulterSignalement":
|
|
|
|
|
|
|
|
$this->consulterSignalement();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "creerEvenement":
|
|
|
|
|
|
|
|
$this->creerEvenement();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "supprimerEvenement":
|
|
|
|
|
|
|
|
$this->supprimerEvenement();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "supprimerOffre":
|
|
|
|
|
|
|
|
$this->supprimerOffre();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function supprimerCompte()
|
|
|
|
protected function supprimerCompte()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
//TODO
|
|
|
@ -54,7 +25,7 @@ class AdminControleur extends ModerateurControleur
|
|
|
|
$img = ImageSaver::SaveImage('image');
|
|
|
|
$img = ImageSaver::SaveImage('image');
|
|
|
|
|
|
|
|
|
|
|
|
if (!Validation::validerEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1])) {
|
|
|
|
if (!Validation::validerEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1])) {
|
|
|
|
$mdl = new UtilisateurModele();
|
|
|
|
$mdl = new AdminModele();
|
|
|
|
$mdl->ajouterEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1]);
|
|
|
|
$mdl->ajouterEvenement($_POST["titre"], $_POST["description"], $_POST["date"], $_POST["nbPlaceMax"], $img[1]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->listerEvenement();
|
|
|
|
$this->listerEvenement();
|
|
|
@ -69,8 +40,8 @@ class AdminControleur extends ModerateurControleur
|
|
|
|
|
|
|
|
|
|
|
|
public function supprimerEvenement(?array $params)
|
|
|
|
public function supprimerEvenement(?array $params)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$mdl = new UtilisateurModele();
|
|
|
|
$mdl = new AdminModele();
|
|
|
|
$mdl->deleteEvenement($params["id"]);
|
|
|
|
$mdl->deleteEvenement($params["id2"]);
|
|
|
|
|
|
|
|
|
|
|
|
$this->listerEvenement();
|
|
|
|
$this->listerEvenement();
|
|
|
|
}
|
|
|
|
}
|
|
|
|