63 lines
No EOL
2.1 KiB
PHP
63 lines
No EOL
2.1 KiB
PHP
<?php
|
|
require("../app/models/project_model.php");
|
|
require("../app/entities/project_entity.php");
|
|
|
|
/**
|
|
* Le controler des Project
|
|
* @author Yasser
|
|
*/
|
|
class ProjectCtrl{
|
|
|
|
|
|
/**
|
|
* Fonction d'affichage de la page d'acceuil
|
|
*/
|
|
public function home(){
|
|
|
|
$objProjectModel = new ProjectModel;
|
|
$arrProject = $objProjectModel->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');
|
|
}
|
|
} |