diff --git a/ensiie-project/src/Model/Classes/Commande.php b/ensiie-project/src/Model/Classes/Commande.php new file mode 100644 index 0000000000000000000000000000000000000000..255c832bb1bcc57966de898c94ba1a78642b62f5 --- /dev/null +++ b/ensiie-project/src/Model/Classes/Commande.php @@ -0,0 +1,73 @@ +<?php +namespace Commande; + +class Commande +{ + /** + * @var int id de la BDD + */ + private $idCommande; + + /** + * @var int ID de l'utilisateur qui a commandé + */ + private $userID; + + /** + * @var string "2019-04-04 18:25:10.000000" par exemple. Je suis sur si tu cherche "mysql datetime to php" tu va trouver des jolies fonction qui rtansforment la string en une belle date + */ + private $dateTimeCommande; + + + /** + * @var boolean Si la commande a été payée ou pas + */ + private $isPaid; + + /** + * @var array<ItemCommande> Le tableau qui contient les différentes nourritures + */ + private $items; + /** + * Constructeur valué + */ + public function Commande($idIt,$user,$date, $paid, $nourriture) + { + $this->idCommande = $idIt; + $this->userID = $user; + $this->dateTimeCommande = $date; + $this->isPaid = $paid; + $this->items = $nourriture; + } + + public function getIDCommande() + { + return $this->idCommande; + } + + public function getUserID() + { + return $this->userID; + } + + public function getDateTimeCommande() + { + return $this->dateTimeCommande; + } + + public function getPaid() //je trouve ca drole comme blague :/ + { + return $this->isPaid; + } + + public function getItems() //je trouve ca drole comme blague :/ + { + return $this->items; + } + + public function addItem($item){ + array_push($this->items, $item); + } +} + +?> \ No newline at end of file diff --git a/ensiie-project/src/Model/Classes/Event.php b/ensiie-project/src/Model/Classes/Event.php new file mode 100644 index 0000000000000000000000000000000000000000..af081a86fa5305e90152dc69ade64f2fb8153cc5 --- /dev/null +++ b/ensiie-project/src/Model/Classes/Event.php @@ -0,0 +1,63 @@ +<?php +namespace Event; + +class Event +{ + /** + * @var int id de la BDD + */ + private $idEvent; + + /** + * @var string "NJV" ou "ObiLAN" + */ + private $typeEvent; + + /** + * @var int Numero de l'event + */ + private $numEvent; + + /** + * Constructeur valué + */ + public function Event($idEve,$type,$num,) + { + $this->idEvent = $idEve; + $this->typeEvent = $type; + $this->numEvent = $num; + } + + public function getIDEvent() + { + return $this->idEvent; + } + + public function setIDEvent($id) + { + $this->idEvent = $id; + } + + public function getTypeEvent() + { + return $this->typeEvent; + } + + public function setTypeEvent($id) + { + $this->typeEvent = $id; + } + + public function getNumEvent() + { + return $this->numEvent; + } + + public function setNumEvent($id) + { + $this->numEvent = $id; + } + +} + +?> \ No newline at end of file diff --git a/ensiie-project/src/Model/Classes/ItemCommande.php b/ensiie-project/src/Model/Classes/ItemCommande.php new file mode 100644 index 0000000000000000000000000000000000000000..e7802976f5a7af3e39f6cf1034b079c6b10a4fbb --- /dev/null +++ b/ensiie-project/src/Model/Classes/ItemCommande.php @@ -0,0 +1,63 @@ +<?php +namespace ItemCommande; + +class ItemCommande +{ + /** + * @var int id de la BDD + */ + private $idItem; + + /** + * @var Nourriture contennat les infos de ce qui est acheté + */ + private $foodCommande; + + /** + * @var array<Special> contenant les sauces, viandes, etc... + */ + private $specialsFood; + + /** + * Constructeur valué + */ + public function ItemCommande($idIt,$foodCom,$specials,) + { + $this->idItem = $idIt; + $this->foodCommande = $foodCom; + $this->specialsFood = $specials; + } + + public function getIDItem() + { + return $this->idItem; + } + + public function setIDItem($id) + { + $this->idItem = $id; + } + + public function getNourriture() + { + return $this->foodCommande; + } + + public function setNourriture($id) + { + $this->foodCommande = $id; + } + + public function getSpecials() + { + return $this->numEvent; + } + + public function setSpecials($id) + { + $this->specialsFood = $id; + } + +} + +?> \ No newline at end of file diff --git a/ensiie-project/src/Model/Classes/Nourriture.php b/ensiie-project/src/Model/Classes/Nourriture.php new file mode 100644 index 0000000000000000000000000000000000000000..bc18e292e9ebd7efac380a0028c16c0eb29619fd --- /dev/null +++ b/ensiie-project/src/Model/Classes/Nourriture.php @@ -0,0 +1,103 @@ +<?php +namespace Nourriture; + +class Nourriture +{ + /** + * @var int id de la BDD + */ + private $idFood; + + /** + * @var string "Pizza", "Tacos", etc... + */ + private $foodType; + + /** + * @var int Id du type de nourriture dans la BDD + */ + private $foodTypeID; + + + /** + * @var string "Calzone (Tomates, Oignons)", "Tacos XXL", etc... + */ + private $nomFood; + + /** + * @var string "Le Palais", "Obigdelice", etc... + */ + private $nomPart; + + /** + * @var int id du partenariat dans la BDD + */ + private $idPart; + + /** + * @var string "6.5 €", "8€", Le prix que VONT PAYER LES IIENS + */ + private $pricePaid; + + /** + * @var string "6.5 €", "8€", Le prix que L'ONT DOIT AU PART (moins cher que pricePaid) + */ + private $pricePart; + + + /** + * Constructeur valué + */ + public function Nourriture($idIt,$foodTypeName,$foodTypeid, $nameFood, $namePart, $idPartenariat, $coutPourIIEN, $coutPourLP) + { + $this->idFood = $idIt; + $this->foodType = $foodTypeName; + $this->nomFood = $nameFood; + $this->nomPart = $namePart; + $this->idPart = $idPartenariat; + $this->pricePaid = $coutPourIIEN; + $this->pricePart = $coutPourLP; + } + + public function getIDFood() + { + return $this->idFood; + } + + public function setIDFood($id) + { + $this->idFood = $id; + } + + public function getFoodType() + { + return $this->foodType; + } + + public function getNomFood() + { + return $this->nomFood; + } + + public function getNomPart() + { + return $this->foodType; + } + + public function getIDPart() + { + return $this->idPart; + } + + public function getPriceIIEN() + { + return $this->pricePaid; + } + + public function getPricePart() + { + return $this->pricePart; + } +} + +?> \ No newline at end of file diff --git a/ensiie-project/src/Model/Classes/Special.php b/ensiie-project/src/Model/Classes/Special.php new file mode 100644 index 0000000000000000000000000000000000000000..c51b9a61243e7a0ef031578c2592cf47e173b9d3 --- /dev/null +++ b/ensiie-project/src/Model/Classes/Special.php @@ -0,0 +1,63 @@ +<?php +namespace Special; + +class Special +{ + /** + * @var int id de la BDD + */ + private $idSpecial; + + /** + * @var string "Sauce", "Viande", etc... + */ + private $specialType; + + /** + * @var int Id du type de nourriture dans la BDD + */ + private $specialTypeID; + + + /** + * @var string "Algérienne", "Poulet", etc... + */ + private $nomSpecial; + + /** + * Constructeur valué + */ + public function Special($idIt,$specTypeName,$specTypeid, $nameSpec) + { + $this->idSpecial = $idIt; + $this->specialType = $specTypeName; + $this->specialTypeID = $specTypeid; + $this->nomSpecial = $nameSpec; + } + + public function getIDFood() + { + return $this->idSpecial; + } + + public function setIDSpecial($id) + { + $this->idSpecial = $id; + } + + public function getSpecialType() + { + return $this->specialType; + } + + public function getIDTypeSpecial() + { + return $this->specialTypeID; + } + + public function getNomSpecial() + { + return $this->nomSpecial; + } +} +?> \ No newline at end of file diff --git a/ensiie-project/src/Model/Utilisateur/Utilisateur.php b/ensiie-project/src/Model/Classes/Utilisateur.php similarity index 91% rename from ensiie-project/src/Model/Utilisateur/Utilisateur.php rename to ensiie-project/src/Model/Classes/Utilisateur.php index 837531d86676494dc87451fcad1acd7dab08e7f9..f994a9e9924ec13b67af51cc36845e16bbcd4de9 100644 --- a/ensiie-project/src/Model/Utilisateur/Utilisateur.php +++ b/ensiie-project/src/Model/Classes/Utilisateur.php @@ -29,7 +29,7 @@ class Utilisateur private $isAdmin; /** - * @var array<commande> + * @var array<commande> Commandes de l'evenement courrant */ private $commandes; @@ -37,13 +37,14 @@ class Utilisateur /** * Constructeur valué */ - public function Utilisateur($ariseID,$prenom,$nom,$pseudo,$isAdmin) + public function Utilisateur($ariseID,$prenom,$nom,$pseudo,$isAdmin,$commande) { $this->ariseID = $ariseID; $this->prenom = $prenom; $this->nom = $nom; $this->pseudo = $pseudo; $this->isAdmin = $isAdmin; + $this->commandes = $commande; } /** @@ -51,7 +52,7 @@ class Utilisateur */ public function Utilisateur() { - Utilisateur("","","","",FALSE); + Utilisateur("","","","",FALSE,NULL); } /** @@ -161,5 +162,10 @@ class Utilisateur $this->commandes = $commandes; return $this; } + + public function addCommande($com){ + array_push($this->commandes, $com); + } } +?> \ No newline at end of file