diff --git a/php/.idea/.gitignore b/php/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/php/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/php/.idea/modules.xml b/php/.idea/modules.xml
new file mode 100644
index 0000000..2047c36
--- /dev/null
+++ b/php/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/php/.idea/php.iml b/php/.idea/php.iml
new file mode 100644
index 0000000..d28f97f
--- /dev/null
+++ b/php/.idea/php.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/php/.idea/php.xml b/php/.idea/php.xml
new file mode 100644
index 0000000..eed9a80
--- /dev/null
+++ b/php/.idea/php.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/php/.idea/vcs.xml b/php/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/php/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/php/public/assets/close.png b/php/public/assets/close.png
new file mode 100644
index 0000000..162cb0b
Binary files /dev/null and b/php/public/assets/close.png differ
diff --git a/php/public/assets/search.svg b/php/public/assets/search.svg
new file mode 100644
index 0000000..4874e01
--- /dev/null
+++ b/php/public/assets/search.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/php/public/css/evenement.css b/php/public/css/evenement.css
new file mode 100644
index 0000000..56d1a21
--- /dev/null
+++ b/php/public/css/evenement.css
@@ -0,0 +1,54 @@
+/* styles.css */
+
+/* Reset CSS pour normaliser le rendu sur tous les navigateurs */
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Arial', sans-serif;
+ background-color: #f8f9fa;
+ color: #333;
+}
+
+.container {
+ margin-top: 20px;
+}
+
+.div_titres {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.div_titres a {
+ width: 20%;
+}
+
+.div_titres h1 {
+ width: 50%;
+ color: #00DBFF;
+}
+
+.div_titres a img {
+ margin-left: 40px;
+}
+
+h1 {
+ display: flex;
+ justify-content: center;
+ color: #00DBFF;
+}
+
+.list-group-item {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ margin-top: 20px;
+ padding: 15px;
+ border: 1px solid #dee2e6;
+ border-radius: 5px;
+}
diff --git a/php/public/uploads/10246LOGO-CGI-1993-1998.svg.png b/php/public/uploads/10246LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/10246LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/1037575640739_2017832954986003_3631312063273369600 b/php/public/uploads/1037575640739_2017832954986003_3631312063273369600
new file mode 100644
index 0000000..4e07958
Binary files /dev/null and b/php/public/uploads/1037575640739_2017832954986003_3631312063273369600 differ
diff --git a/php/public/uploads/10412LOGO-CGI-1993-1998.svg.png b/php/public/uploads/10412LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/10412LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/10989LOGO-CGI-1993-1998.svg.png b/php/public/uploads/10989LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/10989LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/11118LOGO-CGI-1993-1998.svg.png b/php/public/uploads/11118LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/11118LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/11258148705384_3066830383419583_836309298646490890 b/php/public/uploads/11258148705384_3066830383419583_836309298646490890
new file mode 100644
index 0000000..273aea0
Binary files /dev/null and b/php/public/uploads/11258148705384_3066830383419583_836309298646490890 differ
diff --git a/php/public/uploads/11371LOGO-CGI-1993-1998.svg.png b/php/public/uploads/11371LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/11371LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/11560Adidas 3D LOGO.jpg b/php/public/uploads/11560Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/11560Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/11575LOGO-CGI-1993-1998.svg.png b/php/public/uploads/11575LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/11575LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/11596Adidas 3D LOGO.jpg b/php/public/uploads/11596Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/11596Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/12020LOGO-CGI-1993-1998.svg.png b/php/public/uploads/12020LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/12020LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/12211 .png b/php/public/uploads/12211 .png
new file mode 100644
index 0000000..955bdb3
Binary files /dev/null and b/php/public/uploads/12211 .png differ
diff --git a/php/public/uploads/12228Adidas 3D LOGO.jpg b/php/public/uploads/12228Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/12228Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/1223075640739_2017832954986003_3631312063273369600 b/php/public/uploads/1223075640739_2017832954986003_3631312063273369600
new file mode 100644
index 0000000..4e07958
Binary files /dev/null and b/php/public/uploads/1223075640739_2017832954986003_3631312063273369600 differ
diff --git a/php/public/uploads/1303975640739_2017832954986003_3631312063273369600 b/php/public/uploads/1303975640739_2017832954986003_3631312063273369600
new file mode 100644
index 0000000..4e07958
Binary files /dev/null and b/php/public/uploads/1303975640739_2017832954986003_3631312063273369600 differ
diff --git a/php/public/uploads/13807LOGO-CGI-1993-1998.svg.png b/php/public/uploads/13807LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/13807LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/13811Capture_decran_2023-11-01_a_10.56.59.png b/php/public/uploads/13811Capture_decran_2023-11-01_a_10.56.59.png
new file mode 100644
index 0000000..7290ba7
Binary files /dev/null and b/php/public/uploads/13811Capture_decran_2023-11-01_a_10.56.59.png differ
diff --git a/php/public/uploads/13822Adidas 3D LOGO.jpg b/php/public/uploads/13822Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/13822Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/14330Adidas 3D LOGO.jpg b/php/public/uploads/14330Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/14330Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/14902LOGO-CGI-1993-1998.svg.png b/php/public/uploads/14902LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/14902LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/15529LOGO-CGI-1993-1998.svg.png b/php/public/uploads/15529LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/15529LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/16163 .png b/php/public/uploads/16163 .png
new file mode 100644
index 0000000..955bdb3
Binary files /dev/null and b/php/public/uploads/16163 .png differ
diff --git a/php/public/uploads/17005 .png b/php/public/uploads/17005 .png
new file mode 100644
index 0000000..955bdb3
Binary files /dev/null and b/php/public/uploads/17005 .png differ
diff --git a/php/public/uploads/17285LOGO-CGI-1993-1998.svg.png b/php/public/uploads/17285LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/17285LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/17669LOGO-CGI-1993-1998.svg.png b/php/public/uploads/17669LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/17669LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/17854LOGO-CGI-1993-1998.svg.png b/php/public/uploads/17854LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/17854LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/18355 .png b/php/public/uploads/18355 .png
new file mode 100644
index 0000000..955bdb3
Binary files /dev/null and b/php/public/uploads/18355 .png differ
diff --git a/php/public/uploads/18652Adidas 3D LOGO.jpg b/php/public/uploads/18652Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/18652Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/18887LOGO-CGI-1993-1998.svg.png b/php/public/uploads/18887LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/18887LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/19015LOGO-CGI-1993-1998.svg.png b/php/public/uploads/19015LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/19015LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/19023Adidas 3D LOGO.jpg b/php/public/uploads/19023Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/19023Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/19821Adidas 3D LOGO.jpg b/php/public/uploads/19821Adidas 3D LOGO.jpg
new file mode 100644
index 0000000..b3a36a5
Binary files /dev/null and b/php/public/uploads/19821Adidas 3D LOGO.jpg differ
diff --git a/php/public/uploads/19858LOGO-CGI-1993-1998.svg.png b/php/public/uploads/19858LOGO-CGI-1993-1998.svg.png
new file mode 100644
index 0000000..b02459b
Binary files /dev/null and b/php/public/uploads/19858LOGO-CGI-1993-1998.svg.png differ
diff --git a/php/public/uploads/19879 .png b/php/public/uploads/19879 .png
new file mode 100644
index 0000000..955bdb3
Binary files /dev/null and b/php/public/uploads/19879 .png differ
diff --git a/php/src/config/Validation.php b/php/src/config/Validation.php
index 05d2f4e..62d1465 100755
--- a/php/src/config/Validation.php
+++ b/php/src/config/Validation.php
@@ -63,6 +63,7 @@ class Validation
return filter_var($str, FILTER_VALIDATE_EMAIL);
}
+
public static function validateImage($img) : bool
{
if(isset($_FILES[$img]))
@@ -79,6 +80,20 @@ class Validation
return false;
}
+ public static function validerEvenement(string $titre, string $description, string $date, int $nbPlaceMax, string $img) : bool
+ {
+ if(!empty($titre) && !empty($description) && !empty($date) && !empty($nbPlaceMax) && !empty($img))
+ {
+ if(self::validerIntPossitif($nbPlaceMax))
+ {
+ if(self::validateImage($img))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
public static function validateNumber($number) : bool
{
diff --git a/php/src/config/config.php b/php/src/config/config.php
index ff7c8f1..5baebeb 100755
--- a/php/src/config/config.php
+++ b/php/src/config/config.php
@@ -12,3 +12,7 @@ static $OffersByPage = 5;
define('DB_HOST', 'mysql:host=localhost;dbname=dbAlica');
define('DB_USER', 'Dev');
define('DB_PASS', 'Dev');
+//BD
+// $dsn = 'mysql:host=localhost;dbname=dbAlica';
+// $username = 'test';
+// $password = 'test';
diff --git a/php/src/controleur/FrontControleur.php b/php/src/controleur/FrontControleur.php
index 4c8043d..594bd18 100755
--- a/php/src/controleur/FrontControleur.php
+++ b/php/src/controleur/FrontControleur.php
@@ -10,7 +10,7 @@ class FrontControleur
$dVueErreur = [];
$actions = array(
"Admin" => [
- "supprimerCompte", "consulterSignalement", "creerEvenement", "supprimerEvenement","supprimerOffre"
+ "supprimerCompte", "consulterSignalement","supprimerOffre"
],
"Moderateur" => [
//TODO
@@ -20,8 +20,7 @@ class FrontControleur
],
"Utilisateur" => [
- "connexion", "inscription", "accueil","consulterProfilLimite","publierOffre"
-
+ "connexion", "inscription", "accueil", "consulterProfilLimite", "publierOffre", "listerEvenement", "creerEvenement", "supprimerEvenement", "avoirDetailEvenement", "rechercherEvenement"
]
);
diff --git a/php/src/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php
index 0047b0b..533dbed 100644
--- a/php/src/gateway/AlumniGateway.php
+++ b/php/src/gateway/AlumniGateway.php
@@ -1,6 +1,8 @@
con = $con;
}
- public function insert(){
- $query='INSERT INTO Evenement VALUES ()';
- $this->con->executeQuery($query, array());
+ public function getNewId()
+ {
+ $query='SELECT MAX(id) FROM Evenement';
+ $this->con->executeQuery($query);
+ $res=$this->con->getResults();
+ return $res[0]['MAX(id)']+1;
+ }
+
+ public function insertEvenement(Evenement $evenement)
+ {
+
+ $query = 'INSERT INTO Evenement VALUES (:i, :o, :t, :d, :img, :date, :nb)';
+
+ $this->con->executeQuery($query,$params = array(
+ ':i' => array($evenement->getId(), \PDO::PARAM_INT),
+ ':o' => array($evenement->getOrganisateurId(), \PDO::PARAM_INT),
+ ':t' => array($evenement->getTitre(), \PDO::PARAM_STR),
+ ':d' => array($evenement->getDescription(), \PDO::PARAM_STR),
+ ':img' => array($evenement->getImage(), \PDO::PARAM_STR),
+ ':date' => array($evenement->getDate(), \PDO::PARAM_STR),
+ ':nb' => array($evenement->getNbPlaceMax(), \PDO::PARAM_INT),
+ ));
+ }
+
+
+ public function getAllEvenement()
+ {
+ $query = 'SELECT * FROM Evenement ORDER BY id DESC';
+ $this->con->executeQuery($query);
+ $res = $this->con->getResults();
+ return $res;
}
+
+ public function deleteEvenement($id)
+ {
+ $query='DELETE FROM Evenement WHERE id=:id';
+ $this->con->executeQuery($query, array(
+ ':id' => array($id, \PDO::PARAM_INT)
+ ));
+ }
+
+ public function findById($id)
+ {
+ $query='SELECT * FROM Evenement WHERE id=:id';
+ $this->con->executeQuery($query, array(
+ ':id' => array($id, \PDO::PARAM_INT)
+ ));
+ $res=$this->con->getResults();
+ return $res;
+ }
+
+ public function findByTitle($titre)
+ {
+ $query = 'SELECT * FROM Evenement WHERE titre LIKE :titre';
+ $this->con->executeQuery($query, array(
+ ':titre' => array("%$titre%", \PDO::PARAM_STR)
+ ));
+ $res = $this->con->getResults();
+ return $res;
+ }
+
}
\ No newline at end of file
diff --git a/php/src/metier/Alumni.php b/php/src/metier/Alumni.php
index 9765cd1..7b61e8a 100644
--- a/php/src/metier/Alumni.php
+++ b/php/src/metier/Alumni.php
@@ -3,8 +3,7 @@
namespace App\metier;
class Alumni{
-
-
+
/**
* @var string Email
*/
diff --git a/php/src/metier/Evenement.php b/php/src/metier/Evenement.php
index 69d43e0..0f26b13 100755
--- a/php/src/metier/Evenement.php
+++ b/php/src/metier/Evenement.php
@@ -1,5 +1,6 @@
id = $id;
- $this->nom = $nom;
- $this->date = $date;
$this->organisateur = $organisateur;
- $this->participants = $participants;
- $this->nbInscriptionMax = $nbInscriptionMax;
- $this->imageUrl = $imageUrl;
+ $this->titre = $titre;
+ $this->description = $description;
+ $this->date = $date;
+ $this->nbPlaceMax = $nbPlaceMax;
+ $this->image = $image;
+
}
+ /**
+ * @return int
+ */
public function getId(): int
{
return $this->id;
}
- public function getNom() : string
+ /**
+ * @return string
+ */
+ public function getTitre(): string
{
- return $this->nom;
+ return $this->titre;
}
- public function getDate() : string
+ /**
+ * @return int
+ */
+ public function getOrganisateurId(): int
{
- return $this->date;
+ return $this->organisateur;
}
- public function getParticipants() : array
+ /**
+ * @return string
+ */
+ public function getDescription(): string
{
- return $this->participants;
+ return $this->description;
}
- public function getOrganisateur(): Alumni
+ /**
+ * @return string
+ */
+ public function getDate(): string
{
- return $this->organisateur;
+ return $this->date;
}
- public function getNbInscriptionMax(): int
+ /**
+ * @return int
+ */
+ public function getNbPlaceMax(): int
{
- return $this->nbInscriptionMax;
+ return $this->nbPlaceMax;
}
- public function getImageUrl(): string
+ /**
+ * @return int
+ */
+ public function getImage(): string
{
- return $this->imageUrl;
+ return $this->image;
}
}
\ No newline at end of file
diff --git a/php/src/modele/ImageModele.php b/php/src/modele/ImageModele.php
deleted file mode 100644
index 26743c0..0000000
--- a/php/src/modele/ImageModele.php
+++ /dev/null
@@ -1,52 +0,0 @@
-gw = new ImageGateway(new Connection(DB_HOST,DB_USER,DB_PASS));
- }
-
- public function publierImage(string $file) : Image
- {
- $img = new Image($this->gw->getNewId(),
- $_FILES[$file]["name"],
- $_FILES[$file]["size"],
- $_FILES[$file]["type"],
- file_get_contents($_FILES[$file]["tmp_name"]));
-
- $this->insertImage($img);
-
- return $img;
- }
-
- public function insertImage(Image $img)
- {
- $this->gw->insertImage($img);
- }
-
- public function obtenirParId(int $id)
- {
- $this->gw->getFromId($id);
- $res = $this->gw->getResults();
- return new Image($this->gw->getNewId(),$res[0]['nom'], $res[0]['taille'], $res[0]['type'], $res[0]['blob']);
- }
-
- public function obtenirToutesImages() : array
- {
- $this->gw->obtenirToutesImages();
- $res = $this->gw->getResults();
- foreach ($res as $r) {
- $array[] = new Image($this->gw->getNewId(),$r['nom'], $r['taille'], $r['type'], $r['blob']);
- }
- return $array;
- }
-
-
-}
\ No newline at end of file
diff --git a/php/templates/creerEvenement.html b/php/templates/creerEvenement.html
new file mode 100644
index 0000000..7b7b28d
--- /dev/null
+++ b/php/templates/creerEvenement.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+ Créer un Événement
+
+
+
+
+
+
+
+
+
+
diff --git a/php/templates/creerOffre.html b/php/templates/creerOffre.html
new file mode 100644
index 0000000..8a1e867
--- /dev/null
+++ b/php/templates/creerOffre.html
@@ -0,0 +1,125 @@
+
+
+
+
+ Publier une Offre
+
+
+
+
+
+
+ {% include "menu.html" %}
+
+
+
+ Publier Une Offre
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/php/templates/detailEvenement.html b/php/templates/detailEvenement.html
new file mode 100644
index 0000000..fd9e78d
--- /dev/null
+++ b/php/templates/detailEvenement.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+ {% if evenement %}
+ {{evenement.titre}}
+ {% endif %}
+
+
+
+
+
+
+ {% include "menu.html" %}
+
+
+
+ {% if evenement %}
+
Détails de l'Événement : {{evenement.titre}}
+
+
Organisateur: {{ evenement.organisateurId }}
+
Date: {{ evenement.date }}
+
Description: {{ evenement.description }}
+
+
Places disponibles: {{ evenement.nbPlaceMax }}
+
Retour
+
+ {% else %}
+
L'événement n'existe pas ou n'est pas disponible.
+ {% endif %}
+
+
+
+
+
+
+
diff --git a/php/templates/evenement.html b/php/templates/evenement.html
new file mode 100644
index 0000000..8d45c2e
--- /dev/null
+++ b/php/templates/evenement.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+ Liste des Événements
+
+
+
+
+
+
+ {% include "menu.html" %}
+
+
+
+
+
+
+ {% if evenements is not empty %}
+ {% for evenement in evenements %}
+ -
+
+
{{ evenement.titre }}
+
Organisateur: {{ evenement.getNomOrganisateur() }}
+
Date: {{ evenement.date }}
+
Description: {{ evenement.description }}
+
+
Places disponibles: {{ evenement.nbPlaceMax }}
+
Détails
+
+
+
+ {% endfor %}
+ {% else %}
+ - Aucun événement trouvé.
+ {% endif %}
+
+
+
+
+
+
+
+