|
|
|
@ -16,12 +16,14 @@ class UtilisateurModele
|
|
|
|
|
{
|
|
|
|
|
private $con;
|
|
|
|
|
protected $offreGw;
|
|
|
|
|
protected $eventGw;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this->con = new Connection(DB_HOST,DB_USER,DB_PASS);
|
|
|
|
|
$this->offreGw = new OffreGateway($this->con);
|
|
|
|
|
$this->eventGw = new EvenementGateway($this->con);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -119,29 +121,6 @@ class UtilisateurModele
|
|
|
|
|
return $evenement;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ajouterEvenement(string $titre, string $description, string $date, int $nbPlaceMax, string $img)
|
|
|
|
|
{
|
|
|
|
|
$gate = new EvenementGateway($this->con);
|
|
|
|
|
|
|
|
|
|
$evenement = new Evenement(
|
|
|
|
|
$gate->getNewId(),
|
|
|
|
|
'1', //TODO : Ajouter l'ID de l'admin connecté
|
|
|
|
|
$titre,
|
|
|
|
|
$description,
|
|
|
|
|
$date,
|
|
|
|
|
$nbPlaceMax,
|
|
|
|
|
$img
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$gate->insertEvenement($evenement);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function deleteEvenement(int $id)
|
|
|
|
|
{
|
|
|
|
|
$gate = new EvenementGateway($this->con);
|
|
|
|
|
$gate->deleteEvenement($id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getEvenementById(int $id) : Evenement
|
|
|
|
|
{
|
|
|
|
|
$gate = new EvenementGateway($this->con);
|
|
|
|
@ -236,10 +215,6 @@ class UtilisateurModele
|
|
|
|
|
$profilGw = new ProfilGateway(new Connection(DB_HOST,DB_USER,DB_PASS));
|
|
|
|
|
$resProfl = $profilGw->getProfilById($resal[0]['id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
var_dump($resal);
|
|
|
|
|
|
|
|
|
|
$alumni = new Alumni(intval($resal[0]['id']),$resal[0]['mail'],$resal[0]['mdp'],$resal[0]['role'],$resProfl[0]['nom'],$resProfl[0]["prenom"]);
|
|
|
|
|
|
|
|
|
|
$date = \DateTime::createFromFormat('Y-m-d', $row['date']);
|
|
|
|
@ -298,6 +273,4 @@ class UtilisateurModele
|
|
|
|
|
{
|
|
|
|
|
return $this->offreGw->getNbTotalPages();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|