Merge branch 'laura' of https://github.com/Yasder5/projet_php into laura

This commit is contained in:
laura.chevillet 2026-02-25 15:28:27 +01:00
commit 4d834823e7
123 changed files with 2589 additions and 13232 deletions

View file

@ -151,37 +151,38 @@ class UserCtrl extends MotherCtrl {
*/
public function user(){
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if ($intId <= 0) {
header("Location: index.php");
exit;
}
if ($intId <= 0) {
header("Location:index.php");
exit;
}
//affichage info utilisateur
$objUserModel = new UserModel;
$arrUserData = $objUserModel->findUserById($intId);
//affichage info utilisateur
$objUserModel = new UserModel;
$arrUserData = $objUserModel->findUserById($intId);
if ($arrUserData === false) {
header("Location: index.php");
exit;
}
$objUser = new User;
$objUser->hydrate($arrUserData);
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);
//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;
}
$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");
$this->_arrData['user'] = $objUser;
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_display("user");
}
}