diff --git a/app/controllers/project_controller.php b/app/controllers/project_controller.php
new file mode 100644
index 0000000..b8cf009
--- /dev/null
+++ b/app/controllers/project_controller.php
@@ -0,0 +1,115 @@
+findAll(4);
+ $arrProjectToDiplay = array();
+ foreach($arrProject as $arrDetProject){
+ $objProject = new Project;
+ $objProject->hydrate($arrDetProject);
+ $arrProjectToDiplay[] = $objProject;
+ }
+
+ include('../app/views/partials/header.php');
+ include('../app/views/home.php');
+ include('../app/views/partials/footer.php');
+
+ }
+
+ /**
+ * Fonction d'affichage de la barre de recherche
+ */
+
+ public function search(){
+
+ //variable pour faire fonctionner le script en footer
+ $strPage = "search";
+
+ // inclusion du header
+ include('../app/views/partials/header.php');
+
+ //Récupérer les informations du Formulaire
+ $strKeywords = $_POST['keywords']??'';
+ $intAuthor = $_POST['author']??0;
+ $intPeriod = $_POST['period']??0;
+ $strDate = $_POST['date']??'';
+ $strStartDate = $_POST['startdate']??'';
+ $strEndDate = $_POST['enddate']??'';
+ $intCategory = $_POST['category']??0;
+ // Récupération des projetc
+ $objProjectModel = new ProjectModel;
+ $arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
+ strKeywords:$strKeywords, strStartDate:$strStartDate, strEndDate:$strEndDate, intCategory:$intCategory);
+
+ // Initialisation d'un tableau => objets
+ $arrProjectToDisplay = array();
+ // Boucle de transformation du tableau de tableau en tableau d'objets
+ foreach($arrProject as $arrDetProject){
+ $objProject = new Project;
+ $objProject->hydrate($arrDetProject);
+ $arrProjectToDisplay[] = $objProject;
+ }
+
+ // Récupération des utilisateurs
+ require_once("../app/models/user_model.php");
+ $objUserModel = new UserModel;
+ $arrUser = $objUserModel->findAllUsers();
+
+ // Récupération des catégories
+ require_once("../app/models/category_model.php");
+ $objCategoryModel = new CategoryModel;
+ $arrCategory = $objCategoryModel->findAllCategory();
+
+
+ include('../app/views/search.php');
+ include('../app/views/partials/footer.php');
+ }
+
+ /**
+ * Fonction d'affichage de la page projet
+ */
+
+
+ public function project (){
+
+ $objProjectModel = new ProjectModel;
+ $arrProject = $objProjectModel->findAll(4);
+ $arrProjectToDiplay = array();
+ foreach($arrProject as $arrDetProject){
+ $objProject = new Project;
+ $objProject->hydrate($arrDetProject);
+ $arrProjectToDiplay[] = $objProject;
+ }
+
+ $objImageModel = new ImageModel;
+ $arrImage = $objImageModel->findAllImage(4);
+ $arrImageToDiplay = array();
+ foreach($arrImage as $arrDetImage){
+ $objImage = new Image;
+ $objImage->hydrate($arrDetImage);
+ $arrImageToDiplay[] = $objImage;
+ }
+
+ include("../app/views/partials/header.php");
+ include('../app/views/project.php');
+ include('../app/views/partials/footer.php');
+
+ }
+ }
\ No newline at end of file
diff --git a/app/controllers/user_controller.php b/app/controllers/user_controller.php
index 7ec6c18..ae38767 100644
--- a/app/controllers/user_controller.php
+++ b/app/controllers/user_controller.php
@@ -32,18 +32,11 @@ class UserCtrl{
$arrError[] = "Mail ou mot de passe invalide";
}else{
// Ajoute l'utilisateur en session
- /*$_SESSION['firstname'] = $arrResult['user_firstname'];
- $_SESSION['name'] = $arrResult['user_name'];
- $_SESSION['id'] = $arrResult['user_id'];*/
- // j'enlève le mot de passe avant la session
- //unset($arrResult['user_pwd']);
$_SESSION['user'] = $arrResult;
$_SESSION['success'] = "Bienvenue, vous êtes bien connecté";
header("Location:index.php");
exit;
- //var_dump($_SESSION);
- //var_dump("Connecté");
}
}
}
diff --git a/app/entities/category_entity.php b/app/entities/category_entity.php
new file mode 100644
index 0000000..72ac739
--- /dev/null
+++ b/app/entities/category_entity.php
@@ -0,0 +1,57 @@
+_prefix = 'category_';
+ }
+
+ // Méthode Getter et Setter
+
+ /**
+ * Récuperation de l'id de la catégorie
+ * @return int l'id de la catégorie
+ */
+ public function getId():int{
+ return $this->_id;
+ }
+
+ /**
+ * Mise à jour de l'id de la catégorie
+ * @param int le nouvelle id
+ */
+ public function setId($id){
+ $this->_id = $id;
+ }
+
+ /**
+ * Récuperation du nom de la catégorie
+ * @return string nom de la catégorie
+ */
+ public function getName(){
+ return $this->_name;
+ }
+
+ /**
+ * Mise à jour du nom de la catégorie
+ * @param string le nouveau nom de la catégorie
+ */
+ public function setName($name){
+ $this->_name = $name;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/entities/image_entity.php b/app/entities/image_entity.php
new file mode 100644
index 0000000..b919d67
--- /dev/null
+++ b/app/entities/image_entity.php
@@ -0,0 +1,91 @@
+_prefix = 'image_';
+ }
+
+ // Méthode Getter et Setter
+
+ /**
+ * Récuperation de l'id de l'image
+ * @return int l'id de l'image
+ */
+ public function getId():int{
+ return $this->_id;
+ }
+
+ /**
+ * Mise à jour de l'id de l'image
+ * @param int le nouvelle id
+ */
+ public function setId($id){
+ $this->_id = $id;
+ }
+
+ /**
+ * Récuperation du nom de l'image
+ * @return string nom de l'image
+ */
+ public function getName(){
+ return $this->_name;
+ }
+
+ /**
+ * Mise à jour du nom de l'image
+ * @param string le nouveau nom de l'image
+ */
+ public function setName($name){
+ $this->_name = $name;
+ }
+
+ /**
+ * Récuperation de l'alt
+ * @return string contenu de l'alt
+ */
+ public function getAlt(){
+ return $this->_alt;
+ }
+
+ /**
+ * Mise à jour de l'alt
+ * @param string le nouveau contenu de l'alt
+ */
+ public function setAlt($alt){
+ $this->_alt = $alt;
+ }
+
+ /**
+ * Récuperation du statut de la photo
+ * @return string du statut
+ */
+ public function getStatus(){
+ return $this->_status;
+ }
+
+ /**
+ * Mise à jour du statut de la photo
+ * @param string le nouveau statut de la photo
+ */
+ public function setStatus($status){
+ $this->_status = $status;
+ }
+
+ }
\ No newline at end of file
diff --git a/app/entities/mother_entity.php b/app/entities/mother_entity.php
new file mode 100644
index 0000000..992fb89
--- /dev/null
+++ b/app/entities/mother_entity.php
@@ -0,0 +1,29 @@
+$value){
+ $strMethodName = "set".ucfirst(str_replace($this->_prefix,'',$key));
+ if (method_exists($this,$strMethodName)){
+ $this->$strMethodName($value);
+ }
+ }
+ }
+
+ protected function nettoyer(string $strText){
+ $strText = trim($strText);
+ $strText = str_replace("", "", $strText);
+ return $strText;
+ }
+
+ }
\ No newline at end of file
diff --git a/app/entities/project_entity.php b/app/entities/project_entity.php
new file mode 100644
index 0000000..ab9047e
--- /dev/null
+++ b/app/entities/project_entity.php
@@ -0,0 +1,220 @@
+_prefix = 'project_';
+ }
+
+ // Méthode Getter et Setter
+
+ /**
+ * Récuperation de l'id du Projet
+ * @return int l'id du projet
+ */
+ public function getId():int{
+ return $this->_id;
+ }
+
+ /**
+ * Mise à jour de l'id du projet
+ * @param int le nouvelle id
+ */
+ public function setId($id){
+ $this->_id = $id;
+ }
+
+ /**
+ * Récuperation du titre
+ * @return string tite du projet
+ */
+ public function getTitle(){
+ return $this->_title;
+ }
+
+ /**
+ * Mise à jour du titre
+ * @param string le nouveau titre
+ */
+ public function setTitle($title){
+ $this->_title = $title;
+ }
+
+ /**
+ * Récuperation de la description
+ * @return string description du projet
+ */
+ public function getDescription(){
+ return $this->_description;
+ }
+
+ /**
+ * Mise à jour de la description
+ * @param string la nouvelle description
+ */
+ public function setDescription($description){
+ $this->_description = $description;
+ }
+
+
+ /**
+ * Récuperation de l'image
+ * @return string chemin vers l'image
+ */
+ public function getThumbnail(){
+ return $this->_thumbnail;
+ }
+
+ /**
+ * Mise à jour de l'image
+ * @param string chemin vers nouvelle image
+ */
+ public function setThumbnail($thumbnail){
+ $this->_thumbnail = $thumbnail;
+ }
+
+ /**
+ * Récuperation du contenue
+ * @return string contenue du projet
+ */
+ public function getContent(){
+ return $this->_content;
+ }
+
+ /**
+ * Mise à jour du contenue
+ * @param string le nouveau contenue
+ */
+ public function setContent($content){
+ $this->_content = $content;
+ }
+
+
+ /**
+ * Récupération de la date de création
+ * @param string lang de formatage de la date (par défaut = "fr_FR")
+ * @return string date de création formatter
+ */
+ public function getCreation_date(string $strFormat = "fr_FR"){
+ $objDate = new DateTime($this->_creation_date);
+
+ $objDateFormatter = new IntlDateFormatter(
+ $strFormat,
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::NONE,
+
+ );
+ $strFormat = $objDateFormatter->format($objDate);
+ return $strFormat;
+ }
+
+ /**
+ * Mise à jour de la date de création
+ * @param string la nouvelle date de création
+ */
+ public function setCreation_date($creation_date){
+ $this->_creation_date = $creation_date;
+ }
+
+ /**
+ * Récupération du statut
+ * @return string statut
+ */
+ public function getStatus(){
+ return $this->_status;
+ }
+
+ /**
+ * Mise à jour du statut
+ * @param string le nouveau statut
+ */
+ public function setStatus($status){
+ $this->_status = $status;
+ }
+
+ /**
+ * Récupération de l'utilisateur
+ * @return int id de l'utilisateur
+ */
+ public function getUser(){
+ return $this->_user;
+ }
+
+ /**
+ * Mise à jour de l'utilisateur
+ * @param int id de l'utilisateur
+ */
+ public function setUser($user){
+ $this->_user = $user;
+ }
+
+ /**
+ * Récupération de la catégorie
+ * @return int id de la catégorie
+ */
+ public function getCategory(){
+ return $this->_category;
+ }
+
+ /**
+ * Mise à jour de la catégorie
+ * @param int id de la catégorie
+ */
+ public function setCategory($category){
+ $this->_category = $category;
+ }
+
+ /**
+ * Récupération du nom du créateur
+ * @return string nom du créateur
+ */
+ public function getCreatorName(){
+ return $this->_creatorname;
+ }
+
+ /**
+ * Mise à jour du nom du créateur
+ * @param string le nom du créateur
+ */
+ public function setCreatorName($creatorname){
+ $this->_creatorname = $creatorname;
+ }
+ /**
+ * Récupération du chemin photo profil
+ * @return string nom du chemin photo profil
+ */
+ public function getUser_image(){
+ return $this->_user_image;
+ }
+
+ /**
+ * Mise à jour du chemin photo profil
+ * @param string chemin photo profil
+ */
+ public function setUser_image($user_image){
+ $this->_user_image = $user_image;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/entities/user_entity.php b/app/entities/user_entity.php
new file mode 100644
index 0000000..6fa9d08
--- /dev/null
+++ b/app/entities/user_entity.php
@@ -0,0 +1,51 @@
+_prefixe = 'user_';
+ }
+
+ // Méthodes - getters et setters
+ public function getName():string{
+ return $this->_name;
+ }
+ public function setName(string $strNewName){
+ $this->_name = $this->nettoyer($strNewName);
+ }
+ public function getFirstname():string{
+ return $this->_firstname;
+ }
+ public function setFirstname(string $strFirstname){
+ $this->_firstname = $this->nettoyer($strFirstname);
+ }
+ public function getMail():string{
+ return $this->_mail;
+ }
+ public function setMail(string $strMail){
+ $this->_mail = strtolower($this->nettoyer($strMail));
+ }
+ public function getPwd():string{
+ return $this->_pwd;
+ }
+ public function getPwdHash():string{
+ return password_hash($this->_pwd, PASSWORD_DEFAULT);
+ }
+ public function setPwd(string $strPwd){
+ $this->_pwd = $strPwd;
+ }
+
+
+
+
+ }
\ No newline at end of file
diff --git a/app/models/category_model.php b/app/models/category_model.php
new file mode 100644
index 0000000..4aa3e6c
--- /dev/null
+++ b/app/models/category_model.php
@@ -0,0 +1,25 @@
+ 0){
+ $strRq .= " LIMIT ".$intLimit;
+ }
+
+ // Lancer la requête et récupérer les résultats
+ return $this->_db->query($strRq)->fetchAll();
+ }
+ }
\ No newline at end of file
diff --git a/app/models/image_model.php b/app/models/image_model.php
new file mode 100644
index 0000000..6c0ca45
--- /dev/null
+++ b/app/models/image_model.php
@@ -0,0 +1,25 @@
+ 0){
+ $strRq .= " LIMIT ".$intLimit;
+ }
+
+ // Lancer la requête et récupérer les résultats
+ return $this->_db->query($strRq)->fetchAll();
+ }
+ }
\ No newline at end of file
diff --git a/app/models/project_model.php b/app/models/project_model.php
new file mode 100644
index 0000000..6b1fecb
--- /dev/null
+++ b/app/models/project_model.php
@@ -0,0 +1,76 @@
+ 0){
+ $strRq .= $strWhere." user_id = ".$intAuthor;
+ $strWhere = " AND ";
+ }
+
+ // Recherche par catégorie
+ if ($intCategory > 0){
+ $strRq .= $strWhere." project_category = ".$intCategory;
+ $strWhere = " AND ";
+ }
+
+ // Recherche par dates
+ if ($intPeriod == 0){
+ // Par date exacte
+ if ($strDate != ''){
+ $strRq .= $strWhere." project_creation_date = '".$strDate."'";
+ }
+ }else{
+ // Par période de dates
+ if ($strStartDate != '' && $strEndDate != ''){
+ $strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'";
+ }else{
+ if ($strStartDate != ''){
+ // A partir de
+ $strRq .= $strWhere." project_creation_date >= '".$strStartDate."'";
+ }else if ($strEndDate != ''){
+ // Avant le
+ $strRq .= $strWhere." project_creation_date <= '".$strEndDate."'";
+ }
+ }
+ }
+
+ $strRq .= " ORDER BY project_creation_date DESC";
+
+
+ if ($intLimit > 0){
+ $strRq .= " LIMIT ".$intLimit;
+ }
+
+ // Lancer la requête et récupérer les résultats
+ var_dump($strRq);
+ return $this->_db->query($strRq)->fetchAll();
+ }
+ }
\ No newline at end of file
diff --git a/app/views/connexion.php b/app/views/connexion.php
index aba0f13..60c2e7b 100644
--- a/app/views/connexion.php
+++ b/app/views/connexion.php
@@ -3,6 +3,11 @@
+
+
+
+
+
diff --git a/app/views/home.php b/app/views/home.php
new file mode 100644
index 0000000..b85dc3b
--- /dev/null
+++ b/app/views/home.php
@@ -0,0 +1,17 @@
+
+ Folliow
+ Là où les talents rencontrent leur avenir
+ Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
+ Créer un portfolio réellement pertinent aux exigences du marché et rentrez
+ directement en contact avec les entreprises.
+
+
+
+ Les 4 derniers articles
+
+
+
\ No newline at end of file
diff --git a/app/views/inscription.php b/app/views/inscription.php
index e52b5b3..9595a92 100644
--- a/app/views/inscription.php
+++ b/app/views/inscription.php
@@ -3,6 +3,11 @@
+
diff --git a/app/views/login.php b/app/views/login.php
new file mode 100644
index 0000000..0021e56
--- /dev/null
+++ b/app/views/login.php
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/app/views/partials/footer.php b/app/views/partials/footer.php
new file mode 100644
index 0000000..c380f5b
--- /dev/null
+++ b/app/views/partials/footer.php
@@ -0,0 +1,32 @@
+
+
+