diff --git a/app/controllers/project_controller.php b/app/controllers/project_controller.php
new file mode 100644
index 0000000..8859d06
--- /dev/null
+++ b/app/controllers/project_controller.php
@@ -0,0 +1,63 @@
+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');
+
+ }
+
+ public function search(){
+
+ // inclusion du header
+ include('../app/views/partials/header.php');
+
+ //Récupérer les informations du Formulaire
+
+ // Récupération des Projects
+ $objProjectModel = new ProjectModel;
+ //$arrProject = findAll(0, $strKeywords, $intAuthor, $intPeriod, $strDate, $strStartDate, $strEndDate);
+ // Depuis PHP 8 - accès direct aux paramètres
+ $arrProject = $objProjectModel->findAll();
+
+ // 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("../app/models/user_model.php");
+ $objUserModel = new UserModel;
+ $arrUser = $objUserModel->findAllUsers();
+
+ include('../app/views/search.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
new file mode 100644
index 0000000..e6d39d9
--- /dev/null
+++ b/app/controllers/user_controller.php
@@ -0,0 +1,70 @@
+ 0) {
+ // Vérifier le formulaire
+ if ($strMail == ""){
+ $arrError['mail'] = "Le mail est obligatoire";
+ }
+ if ($strPwd == ""){
+ $arrError['pwd'] = "Le mot de passe est obligatoire";
+ }
+
+ // Si le formulaire est rempli correctement
+ if (count($arrError) == 0){
+ // Vérifier l'utilisateur en BDD
+ $objUserModel = new UserModel;
+ $arrResult = $objUserModel->verifUser($strMail, $strPwd);
+ //var_dump($arrResult);
+ if ($arrResult === false){ // Si la base de données ne renvoie rien
+ $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é");
+ }
+ }
+ }
+ include("../app/views/login.php");
+ include("../app/views/partials/footer.php");
+
+ }
+
+
+ public function logout(){
+ session_start();
+ /*session_destroy();
+ session_start();*/
+
+ // on supprime l'utilisateur en session
+ unset($_SESSION['user']);
+
+ $_SESSION['success'] = "Vous êtes bien déconnecté";
+
+ header("Location:index.php");
+ exit;
+
+ }
+ }
\ 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..05eafb0
--- /dev/null
+++ b/app/entities/mother_entity.php
@@ -0,0 +1,22 @@
+$value){
+ $strMethodName = "set".ucfirst(str_replace($this->_prefix,'',$key));
+ if (method_exists($this,$strMethodName)){
+ $this->$strMethodName($value);
+ }
+ }
+ }
+
+ }
\ 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/project_model.php b/app/models/project_model.php
new file mode 100644
index 0000000..85742ae
--- /dev/null
+++ b/app/models/project_model.php
@@ -0,0 +1,23 @@
+ 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/user_model.php b/app/models/user_model.php
new file mode 100644
index 0000000..aaa33c3
--- /dev/null
+++ b/app/models/user_model.php
@@ -0,0 +1,81 @@
+_db->query($strRq)->fetchAll();
+ }
+
+ /**
+ * @param string $strMail
+ * @param string $strPwd
+ * @return array|bool
+ */
+ public function verifUser(string $strMail, string $strPwd):array|bool{
+ // 2. Construire la requête
+ $strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image
+ FROM users
+ WHERE user_mail = '".$strMail."'";
+ // Récupère mon utilisateur
+ // Executer la requête et récupérer les résultats
+ $arrUser = $this->_db->query($strRq)->fetch();
+ // Vérification du mot de passe haché
+ if (password_verify($strPwd, $arrUser['user_password'])){
+ // Renvoi l'utilisateur
+ unset($arrUser['user_password']); // on enlève le pwd
+ return $arrUser;
+ }else{
+ return false;
+ }
+ }
+
+ //public function insert(string $strName, string $strFirstname, string $strMail, string $strPwd):int{
+ /**
+ * Fonction d'insertion d'un utilisateur en BDD
+ * @param object $objUser L'objet utilisateur
+ * @return bool Est-ce que la requête s'est bien passée (true/false)
+ */
+ public function insert(object $objUser):bool{
+
+ // 2. Construire la requête
+ /*$strRq = "INSERT INTO users (user_name, user_firstname, user_mail, user_pwd)
+ VALUES ('".$objUser->getName()."',
+ '".$objUser->getFirstname()."',
+ '".$objUser->getMail()."',
+ '".$objUser->getPwdHash()."')";*/
+ $strRq = "INSERT INTO users (user_name, user_firstname, user_mail, user_pwd)
+ VALUES (:name, :firstname, :mail, :pwd)";
+ // Préparer la requête
+ $rqPrep = $this->_db->prepare($strRq);
+ // Donne les informations
+ $rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":mail", $objUser->getMail(), PDO::PARAM_STR);
+ $rqPrep->bindValue(":pwd", $objUser->getPwdHash(), PDO::PARAM_STR);
+
+ // 3. Executer la requête
+ //var_dump($strRq);die;
+ //return $db->exec($strRq);
+ return $rqPrep->execute();
+ }
+ }
\ No newline at end of file
diff --git a/app/views/home.php b/app/views/home.php
new file mode 100644
index 0000000..1f0fff6
--- /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/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 @@
+
+ 0) {?>
+
+
+
+
+
+
+
+
\ 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..1d2a71c
--- /dev/null
+++ b/app/views/partials/footer.php
@@ -0,0 +1,5 @@
+
+