Ajout de la page user fonctionnelle (ctrl, model associé etc) update des liens en display pour fonctionnement. Correction nom fichier project_display
This commit is contained in:
parent
48108f717f
commit
f4d5669e44
16 changed files with 471 additions and 364 deletions
|
|
@ -3,6 +3,8 @@
|
|||
require("models/user_model.php");
|
||||
require("entities/user_entity.php");
|
||||
require("mother_controller.php");
|
||||
require("./models/project_model.php");
|
||||
require("./entities/project_entity.php");
|
||||
|
||||
class UserCtrl extends MotherCtrl {
|
||||
|
||||
|
|
@ -147,4 +149,43 @@ class UserCtrl extends MotherCtrl {
|
|||
// Affichage de la vue inscription
|
||||
$this->_display("inscription");
|
||||
}
|
||||
|
||||
/**
|
||||
* le controlleur affichage de la page user
|
||||
*/
|
||||
public function user(){
|
||||
|
||||
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
|
||||
if ($intId <= 0) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
//affichage info utilisateur
|
||||
$objUserModel = new UserModel;
|
||||
$arrUserData = $objUserModel->findUserById($intId);
|
||||
|
||||
if ($arrUserData === false) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$objUser = new User;
|
||||
$objUser->hydrate($arrUserData);
|
||||
|
||||
//affichage projet de l'utilisateur
|
||||
$objProjectModel = new ProjectModel;
|
||||
$arrProjects = $objProjectModel->findAll(0,'',$intId);
|
||||
|
||||
$arrProjectToDisplay = array();
|
||||
foreach($arrProjects as $projectData) {
|
||||
$objProject = new Project();
|
||||
$objProject->hydrate($projectData);
|
||||
$arrProjectToDisplay[] = $objProject;
|
||||
}
|
||||
|
||||
$this->_arrData['user'] = $objUser;
|
||||
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
|
||||
$this->_display("user");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue