1
0
mirror of synced 2025-12-28 00:23:25 +00:00

feat(admin) user delete & admin creation

This commit is contained in:
Valentin
2024-06-14 11:29:01 +02:00
parent b04fc41ab2
commit 1d20fd7815
4 changed files with 90 additions and 36 deletions

View File

@@ -16,15 +16,24 @@
<td><?php echo htmlspecialchars($user['firstName']); ?></td>
<td><?php echo htmlspecialchars($user['lastName']); ?></td>
<td>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#editUserModal"
data-id="<?php echo htmlspecialchars($user['id']); ?>"
data-email="<?php echo htmlspecialchars($user['email']); ?>"
data-firstname="<?php echo htmlspecialchars($user['firstName']); ?>"
data-lastname="<?php echo htmlspecialchars($user['lastName']); ?>">
Edit
</button>
<div class="d-flex">
<button type="button" class="btn btn-primary me-2" data-bs-toggle="modal" data-bs-target="#editUserModal"
data-id="<?php echo htmlspecialchars($user['id']); ?>"
data-email="<?php echo htmlspecialchars($user['email']); ?>"
data-firstname="<?php echo htmlspecialchars($user['firstName']); ?>"
data-lastname="<?php echo htmlspecialchars($user['lastName']); ?>"
data-isadmin="<?php echo htmlspecialchars($user['is_admin']); ?>"
>
Edit
</button>
<form method="POST" action="">
<input type="hidden" name="userId" value="<?php echo htmlspecialchars($user['id']); ?>">
<button type="submit" name="delete" class="btn btn-danger">Delete</button>
</form>
</div>
</td>
</tr>
</tr>
<?php endforeach; ?>
</tbody>
</table>