File manager - Edit - /home/verseaumee/quaadraa/admin/views/users.php
Back
<div class="admin-section"> <h2 class="admin-section-title">Ajouter un administrateur</h2> <form action="/admin/users/create" method="POST" style="display: flex; flex-direction: column; gap: 15px; margin-bottom: 2rem;"> <input type="hidden" name="_csrf" value="<?= $csrf ?>"> <div style="display: flex; gap: 10px;"> <div style="flex: 1;"> <input type="text" name="username" placeholder="Nom" class="field input" style="width: 100%; height: 44px; padding: 0 10px; background: var(--adm-dark3); border: 1px solid var(--adm-grey1); color: var(--adm-white);" required> </div> <div style="flex: 1;"> <input type="email" name="email" placeholder="Email" class="field input" style="width: 100%; height: 44px; padding: 0 10px; background: var(--adm-dark3); border: 1px solid var(--adm-grey1); color: var(--adm-white);" required> </div> <div style="flex: 1;"> <input type="password" name="password" placeholder="Mot de passe" class="field input" style="width: 100%; height: 44px; padding: 0 10px; background: var(--adm-dark3); border: 1px solid var(--adm-grey1); color: var(--adm-white);" required> </div> <div style="flex: 1;"> <select name="role" class="field input" style="width: 100%; height: 44px; padding: 0 10px; background: var(--adm-dark3); border: 1px solid var(--adm-grey1); color: var(--adm-white);"> <option value="editor">Éditeur</option> <option value="superadmin">Super Admin</option> </select> </div> </div> <div style="display: flex; justify-content: flex-end;"> <button type="submit" class="quick-btn quick-btn-primary" style="height: 44px; padding: 0 30px;">Créer</button> </div> </form> </div> <div class="admin-section"> <h2 class="admin-section-title">Liste des administrateurs</h2> <div class="admin-table-wrap"> <table class="admin-table"> <thead> <tr> <th>Utilisateur</th> <th>Rôle</th> <th>Actions</th> </tr> </thead> <tbody> <?php foreach ($admins as $u): ?> <tr> <td><?= $e($u['username']) ?></td> <td><?= $u['role'] ?></td> <td> <div style="display: flex; gap: 10px;"> <form action="/admin/users/toggle/<?= $u['id'] ?>" method="POST"> <input type="hidden" name="_csrf" value="<?= $csrf ?>"> <button type="submit" class="quick-btn"><?= $u['is_active'] ? 'Désactiver' : 'Activer' ?></button> </form> <?php if ($u['id'] != $_SESSION['admin_id']): ?> <form action="/admin/users/delete/<?= $u['id'] ?>" method="POST"> <input type="hidden" name="_csrf" value="<?= $csrf ?>"> <button type="submit" class="quick-btn" style="color: var(--adm-red);">Supprimer</button> </form> <?php endif; ?> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings