Début du soft-delete côté projet
This commit is contained in:
parent
a53dffb0fd
commit
80dcaee91c
18 changed files with 610 additions and 64 deletions
|
|
@ -506,13 +506,22 @@
|
|||
* @author Guillaume
|
||||
*/
|
||||
public function delete(){
|
||||
//Vérif utilisateur soit bien modérateur
|
||||
if (!isset($_SESSION['user']) || $_SESSION['user']['user_status'] != 2) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$intId = $_GET['id'] ?? null;
|
||||
|
||||
//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->delete($intId);
|
||||
if ($intId) {
|
||||
$objProjectModel = new ProjectModel();
|
||||
if ($objProjectModel->delete_soft_project((int) $intId)) {
|
||||
$_SESSION['success'] = "Le projet a été archivé avec succès.";
|
||||
} else {
|
||||
$_SESSION['error'] = "Une erreur est survenue lors de l'archivage.";
|
||||
}
|
||||
}
|
||||
|
||||
//Redirection vers la page
|
||||
header("Location: index.php");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue