From 1fb709b923f212c6138b935aa8f77a513616475a Mon Sep 17 00:00:00 2001 From: WhyKorp <117651228+whykorp@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:22:38 +0200 Subject: [PATCH] Add Task Menu --- ruty/get_task.php | 19 ++++++ ruty/todo.php | 122 ++++++++++++++++++++++++++++++++--- ruty/update_task_details.php | 21 ++++++ 3 files changed, 154 insertions(+), 8 deletions(-) create mode 100644 ruty/get_task.php create mode 100644 ruty/update_task_details.php diff --git a/ruty/get_task.php b/ruty/get_task.php new file mode 100644 index 0000000..b680976 --- /dev/null +++ b/ruty/get_task.php @@ -0,0 +1,19 @@ +query($sql); + + if ($result->num_rows > 0) { + $task = $result->fetch_assoc(); + echo json_encode($task); + } else { + echo json_encode([]); + } +} + +$conn->close(); +?> diff --git a/ruty/todo.php b/ruty/todo.php index 34b8baf..dd680a9 100644 --- a/ruty/todo.php +++ b/ruty/todo.php @@ -55,6 +55,32 @@ color: black; }; +/* Menu latéral de modification de tâche */ +#task-edit-menu { + position: fixed; + top: 0; + right: -300px; /* Cacher initialement */ + width: 300px; + height: 100%; + background-color: #f4f4f4; + box-shadow: -2px 0 5px rgba(0,0,0,0.5); + padding: 20px; + transition: right 0.3s ease-in-out; +} + +#task-edit-menu.open { + right: 0; /* Ouvre le menu lorsqu'il est actif */ +} + +#close-edit-menu { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + cursor: pointer; +} + + @@ -72,18 +98,98 @@
×

Ajouter une tâche

-
-
-

+ Description :
-

+ $result = $conn->query($sql); -
-

+ if ($result->num_rows > 0) { + while ($row = $result->fetch_assoc()) { + $taskId = $row["id"]; + $taskName = $row["task_name"]; + $completed = $row["completed"] ? "checked" : ""; - + // Chaque tâche est cliquable pour ouvrir le menu + echo "
  • "; + echo " "; + echo "$taskName"; + echo "
  • "; + } + } else { + echo "Aucune tâche trouvée."; + } + + $conn->close(); + ?> + +
    + × +

    Modifier la tâche

    + + + +
    +

    + +
    +

    + +
    +

    + + + +