Fonctionnalité tri catégorie et date ok. Nettoyage du code et des commentaires de tous les models

This commit is contained in:
laura.chevillet 2026-02-10 11:23:29 +01:00
parent 3af2e8a056
commit 8ce49943dd
18 changed files with 381 additions and 116 deletions

View file

@ -23,9 +23,20 @@
*/
public function home(){
$intCategory = 0;
if (!empty($_GET['filter_cat'])) {
$intCategory = (int) $_GET['filter_cat'];
}
$boolOld = false;
if (!empty($_GET['filter_old']) && $_GET['filter_old'] == 'true') {
$boolOld = true;
}
$objProjectModel = new ProjectModel;
$arrProject = $objProjectModel->findAll();
$arrProject = $objProjectModel->findAll(0,'',0,0,'','','',$intCategory,$boolOld);
$arrProjectToDisplay = array();
foreach($arrProject as $arrDetProject){
$objProject = new Project;
@ -34,8 +45,6 @@
}
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_display("home");
}
@ -43,8 +52,8 @@
/**
* Fonction d'affichage de la barre de recherche
*/
public function search(){
//Récupérer les informations du formulaire
$strKeywords = $_POST['keywords']??'';
$intAuthor = $_POST['author']??0;
@ -87,8 +96,6 @@
/**
* Fonction d'affichage de la page projet
*/
public function project (){
$objProjectModel = new ProjectModel;
@ -151,9 +158,9 @@
$objProjectModel->insert($objProject);
}
//Débuggage
/*Débuggage
var_dump($_SESSION);
var_dump($objProject);
var_dump($objProject);*/
$this->_arrData['arrProjectToDiplay'] = $arrProjectToDiplay;
$this->_arrData['arrImageToDiplay'] = $arrImageToDiplay;