$typeMessage = "success";
        } else {
            $actionMessage = "Erreur Modification Todo : Vous devez remplir le champ 'todo'.";
            $typeMessage = "error";
        }
    } else {
        if ($action == "update-priority") {
            $idTodo = htmlentities($_POST['idTodo']);
            $priority = htmlentities($_POST['priority']);
            $todoManager->updatePriority($idTodo, $priority);
            $actionMessage = "Opération Valide : Todo Modifié avec succès.";
            $typeMessage = "success";
        } else {
            if ($action == "delete") {
                $idTodo = htmlentities($_POST['idTodo']);
                $todoManager->delete($idTodo);
                $actionMessage = "Opération Valide : Todo supprimé(e) avec succès.";
                $typeMessage = "success";
            }
        }
    }
}
//Action Delete Processing End
$_SESSION['todo-action-message'] = $actionMessage;
$_SESSION['todo-type-message'] = $typeMessage;
//header('Location:../todo-projet.php?idProjet='.$idProjet.'&idSociete='.$idSociete);
$redirektLink = "Location:../todos.php";
if (isset($_POST['idSociete'])) {
    $idSociete = htmlentities($_POST['idSociete']);
    $redirektLink = "Location:../todos.php?idSociete=" . $idSociete;
}
Example #2
0
<?php

include '../config.php';
include '../model/TodoProjetManager.php';
$todoManager = new TodoProjetManager($pdo);
$task_id = $_GET['idTask'];
$idSociete = $_GET['idSociete'];
//mysql_query("DELETE FROM tasks WHERE id='$task_id'");
$todoManager->delete($task_id);
$redirektLink = "Location:../todos.php?idSociete=" . $idSociete;
if (isset($_GET['source']) and $_GET['source'] == "todos-archive") {
    $redirektLink = "Location:../todos-archive.php";
}
header($redirektLink);