|
|
|
@ -1,41 +1,12 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\controleur;
|
|
|
|
|
use App\controleur\UtilisateurModele;
|
|
|
|
|
use App\controleur\ImageSaver;
|
|
|
|
|
use App\gateway\ImageSaver;
|
|
|
|
|
use App\config\Validation;
|
|
|
|
|
use App\modele\AdminModele;
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
//TODO
|
|
|
|
@ -54,7 +25,7 @@ class AdminControleur extends ModerateurControleur
|
|
|
|
|
$img = ImageSaver::SaveImage('image');
|
|
|
|
|
|
|
|
|
|
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]);
|
|
|
|
|
|
|
|
|
|
$this->listerEvenement();
|
|
|
|
@ -69,8 +40,8 @@ class AdminControleur extends ModerateurControleur
|
|
|
|
|
|
|
|
|
|
public function supprimerEvenement(?array $params)
|
|
|
|
|
{
|
|
|
|
|
$mdl = new UtilisateurModele();
|
|
|
|
|
$mdl->deleteEvenement($params["id"]);
|
|
|
|
|
$mdl = new AdminModele();
|
|
|
|
|
$mdl->deleteEvenement($params["id2"]);
|
|
|
|
|
|
|
|
|
|
$this->listerEvenement();
|
|
|
|
|
}
|
|
|
|
|