Débug, accès de la view addedit_project via le header et formulaire prêt à l'emplois

This commit is contained in:
GuillaumeH-Cci 2026-02-17 19:07:16 +01:00
parent c91eb6cf89
commit b6ca898069
46 changed files with 109 additions and 4896 deletions

View file

@ -88,9 +88,6 @@
$this->_arrData['arrProject'] = $arrProject;
$this->_arrData['arrUser'] = $arrUser;
$this->_display("search");
}
@ -154,12 +151,17 @@
$objProject->hydrate($_SESSION);
$objProject->setThumbnail($strDest);
$objProjectModel->insert($objProject);
header("Location: index.php");
exit;
}
} else if (isset($_POST['toContinue'])) {
$objProject->hydrate($_SESSION);
$objProject->setThumbnail($strDest);
// } else if (isset($_POST['toContinue'])) {
// $objProject->hydrate($_SESSION);
// $objProject->setThumbnail($strDest);
//$objProjectModel->insert($objProject);
}
// header("Location: index.php");
// exit;
// }
var_dump($_SESSION);
var_dump($objProject);
@ -168,10 +170,8 @@
$this->_arrData['arrProjectToDiplay'] = $arrProjectToDisplay;
$this->_arrData['arrImageToDiplay'] = $arrImageToDisplay;
$this->_display("project");
header("Location: index.php");
exit;
$this->_display("project"); // <A changer pour récupérer l'ancien formulaire
// $this->_display('addedit_project'); // <A changer pour récupérer le nouveau formulaire
}
@ -325,4 +325,16 @@
header("Location: index.php?ctrl=project&action=addedit_project&id=".$intId);
exit;
}
}
public function addedit_project() {
$objCategoryModel = new CategoryModel;
$arrCategory = $objCategoryModel->findAllCategory();
$_SESSION['category']= $_POST['category']??0;
$this->_arrData['arrCategory'] = $arrCategory;
$this->_display('addedit_project');
}
}

View file

@ -154,7 +154,7 @@ class UserCtrl extends MotherCtrl {
$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if ($intId <= 0) {
header("Location: index.php");
header("Location:index.php");
exit;
}
@ -163,7 +163,7 @@ class UserCtrl extends MotherCtrl {
$arrUserData = $objUserModel->findUserById($intId);
if ($arrUserData === false) {
header("Location: index.php");
header("Location:index.php");
exit;
}
$objUser = new User;
@ -184,19 +184,5 @@ class UserCtrl extends MotherCtrl {
$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;
}
}