change checkbox

This commit is contained in:
WhyKorp
2024-03-11 19:46:48 +01:00
committed by GitHub
parent bac77cffdd
commit 4e8de3f76d
+21 -2
View File
@@ -18,8 +18,6 @@
$taskId = $row["id"];
$taskName = $row["task_name"];
$completed = $row["completed"] ? "checked" : "";
echo "<li><div class='checkbox-wrapper'><input id='terms-checkbox-37' name='checkbox' type='checkbox'><label class='terms-label' for='terms-checkbox-37'><svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 200 200' class='checkbox-svg'><mask fill='white' id='path-1-inside-1_476_5-37'><rect height='200' width='200'></rect></mask><rect mask='url(#path-1-inside-1_476_5-37)' stroke-width='40' class='checkbox-box' height='200' width='200'></rect><path stroke-width='15' d='M52 111.018L76.9867 136L149 64' class='checkbox-tick'></path></svg>span class='label-text'>$taskName</span></label></div></li>";
}
} else {
echo "Aucune tâche trouvée.";
@@ -44,6 +42,27 @@
<button type="submit">Ajouter</button>
</form>
<!-- Liste de tâches -->
<h2>Tâches en cours</h2>
<script>
for(i = 0; i < <?php echo $row ?>; i++){
document.writeln(
<div class="checkbox-wrapper">
<input id="terms-checkbox-37" name="checkbox" type="checkbox">
<label class="terms-label" for="terms-checkbox-37">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 200 200" class="checkbox-svg">
<mask fill="white" id="path-1-inside-1_476_5-37">
<rect height="200" width="200"></rect>
</mask>
<rect mask="url(#path-1-inside-1_476_5-37)" stroke-width="40" class="checkbox-box" height="200" width="200"></rect>
<path stroke-width="15" d="M52 111.018L76.9867 136L149 64" class="checkbox-tick"></path>
</svg>
<span class="label-text">Checkbox</span>
</label>
</div>
);
}
</script>
<!-- Script pour mettre à jour l'état d'une tâche -->
<script>
function updateTask(taskId, completed) {