diff --git a/app/controllers/project_controller.php b/app/controllers/project_controller.php index 8859d06..4f6a656 100644 --- a/app/controllers/project_controller.php +++ b/app/controllers/project_controller.php @@ -1,17 +1,19 @@ findAll(); @@ -53,11 +66,27 @@ } // Récupération des utilisateurs - require("../app/models/user_model.php"); + 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 (){ + 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 e6d39d9..f612a4a 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é"); } } } @@ -55,8 +48,6 @@ class UserCtrl{ public function logout(){ session_start(); - /*session_destroy(); - session_start();*/ // on supprime l'utilisateur en session unset($_SESSION['user']); diff --git a/app/entities/category_entity.php b/app/entities/category_entity.php new file mode 100644 index 0000000..eecebdc --- /dev/null +++ b/app/entities/category_entity.php @@ -0,0 +1,55 @@ +_prefix = 'category_'; + } + + // Méthode Getter et Setter + + /** + * Récuperation de l'id du Projet + * @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/mother_entity.php b/app/entities/mother_entity.php index 05eafb0..c564be4 100644 --- a/app/entities/mother_entity.php +++ b/app/entities/mother_entity.php @@ -19,4 +19,11 @@ } } + protected function nettoyer(string $strText){ + $strText = trim($strText); + $strText = str_replace("", "", $strText); + return $strText; + } + } \ 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..aa13516 --- /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/user_model.php b/app/models/user_model.php index aaa33c3..73a5d34 100644 --- a/app/models/user_model.php +++ b/app/models/user_model.php @@ -58,11 +58,6 @@ 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 @@ -74,8 +69,6 @@ $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 index 1f0fff6..b85dc3b 100644 --- a/app/views/home.php +++ b/app/views/home.php @@ -11,7 +11,7 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. + Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Pas de résultats
-Pas de résultats
+