fixed delete note

This commit is contained in:
Felix Ivo
2025-06-27 10:54:24 +02:00
parent 5a63cc66c5
commit 95b7634901
3 changed files with 12 additions and 57 deletions

View File

@@ -56,7 +56,12 @@
<td><?php echo date("d.m.Y H:i", strtotime($note['updated_at'])); ?></td>
<td class="actions-cell">
<a href="?controller=Notes&do=editNote&id=<?php echo $note['id']; ?>" class="button">Edit</a>
<button class="button danger delete-note-btn" data-note-id="<?php echo $note['id']; ?>">Delete</button>
<form method="POST" action="?controller=Notes&do=deleteNote" onsubmit="return confirm('Are you sure you want to delete this note?');" style="display: inline;">
<input type="hidden" name="note_id" value="<?php echo $note['id']; ?>">
<button type="submit" class="button danger">Delete</button>
<input type="hidden" name="controller" value="Notes">
<input type="hidden" name="do" value="deleteNote">
</form>
</td>
</tr>
<?php endforeach; ?>