findAll(4); $arrProjectToDisplay = array(); foreach($arrProject as $arrDetProject){ $objProject = new Project; $objProject->hydrate($arrDetProject); $arrProjectToDisplay[] = $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'); } public function admin(){ include('../app/views/admin.php'); } }