diff --git a/app/controllers/project_controller.php b/app/controllers/project_controller.php index 8859d06..8a2e188 100644 --- a/app/controllers/project_controller.php +++ b/app/controllers/project_controller.php @@ -35,10 +35,16 @@ include('../app/views/partials/header.php'); //Récupérer les informations du Formulaire + $strKeywords = $_GET['keywords']??''; + $intAuthor = $_GET['author']??0; + $intPeriod = $_GET['period']??0; + $strDate = $_GET['date']??''; + $strStartDate = $_GET['startdate']??''; + $strEndDate = $_GET['enddate']??''; // 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(); @@ -60,4 +66,11 @@ include('../app/views/search.php'); include('../app/views/partials/footer.php'); } + + 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/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/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/project.php b/app/views/project.php index c157be9..f5356bd 100644 --- a/app/views/project.php +++ b/app/views/project.php @@ -1,6 +1,3 @@ -
Pas de résultats
-Pas de résultats
+