smarty ça casse les couilles zebi
This commit is contained in:
parent
b1960b2f35
commit
aec3c845e0
469 changed files with 53465 additions and 69 deletions
115
controllers/project_controller.php
Normal file
115
controllers/project_controller.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
require("./models/project_model.php");
|
||||
require("./entities/project_entity.php");
|
||||
require("./models/category_model.php");
|
||||
require("./entities/category_entity.php");
|
||||
require("./models/image_model.php");
|
||||
require("./entities/image_entity.php");
|
||||
require("mother_controller.php");
|
||||
|
||||
/**
|
||||
* Le controler des Project
|
||||
* @author Yasser & Laura
|
||||
*/
|
||||
class ProjectCtrl extends MotherCtrl{
|
||||
|
||||
/**
|
||||
* Fonction d'affichage de la page d'acceuil
|
||||
*/
|
||||
|
||||
public function home(){
|
||||
|
||||
$objProjectModel = new ProjectModel;
|
||||
$arrProject = $objProjectModel->findAll(4);
|
||||
$arrProjectToDisplay = array();
|
||||
foreach($arrProject as $arrDetProject){
|
||||
$objProject = new Project;
|
||||
$objProject->hydrate($arrDetProject);
|
||||
$arrProjectToDisplay[] = $objProject;
|
||||
}
|
||||
|
||||
//$this->_arrData['arrArticleToDisplay'] = $arrArticleToDisplay;
|
||||
|
||||
var_dump($this->_arrData);
|
||||
|
||||
$this->_display("home");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
$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;
|
||||
}
|
||||
|
||||
$objUserModel = new UserModel;
|
||||
$arrUser = $objUserModel->findAllUsers();
|
||||
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue