Débug et ajout de la page addedit_project
This commit is contained in:
parent
46f48230a9
commit
a448d0e2b4
14 changed files with 186 additions and 124 deletions
|
|
@ -125,7 +125,7 @@
|
|||
$_SESSION['content'] = $_POST['textProject']??"";
|
||||
$_SESSION['thumbnail'] = $_FILES['imageThumbnail']['name']??"";
|
||||
$_SESSION['status'] = 'en_attente';
|
||||
$_SESSION['user_id'] = $_SESSION['user']['user_id'];
|
||||
$_SESSION['user_id'] = $_SESSION['user']['user_id']??null;
|
||||
$_SESSION['category']= $_POST['category']??0;
|
||||
|
||||
$objProject = new Project();
|
||||
|
|
@ -169,6 +169,9 @@
|
|||
$this->_arrData['arrImageToDiplay'] = $arrImageToDisplay;
|
||||
|
||||
$this->_display("project");
|
||||
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -308,4 +311,18 @@
|
|||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
public function modify(){
|
||||
|
||||
//Récupéré l'id dans l'url
|
||||
$intId = $_GET['id'];
|
||||
|
||||
//Je créer un nouveau model pour exec la commande SQL
|
||||
$objProjectModel = new ProjectModel;
|
||||
$objProjectModel->modify($intId);
|
||||
|
||||
//Redirection vers la page projet
|
||||
header("Location: index.php?ctrl=project&action=addedit_project&id=".$intId);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
@ -151,37 +151,52 @@ 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");
|
||||
}
|
||||
|
||||
public function addedit_project(){
|
||||
|
||||
// Voir si l'utilisateur est connecté ? Retour sur l'index sinon
|
||||
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
|
||||
if ($intId <= 0){
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Location: index.php?ctrl=project&action=addedit_project");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue