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

    + + + +
    +

    + +
    +

    + +
    +

    + + + +