Refactor user management layout in admin_users.php for improved styling and accessibility
This commit is contained in:
parent
cb587ba276
commit
960fcbe343
101
admin_users.php
101
admin_users.php
@ -34,60 +34,63 @@ $usersResult = $conn->query("SELECT userID, email, displayname, profilePicture,
|
|||||||
|
|
||||||
<?php include 'header.php'; ?>
|
<?php include 'header.php'; ?>
|
||||||
|
|
||||||
<main class="auth auth--admin">
|
<main class="auth" role="main">
|
||||||
<div class="auth__wrapper" style="max-width: 800px;">
|
<section class="auth__grid" style="display: block; max-width: 900px; margin: 40px auto; width: 90%;">
|
||||||
<h1 class="auth__title">Benutzerverwaltung</h1>
|
<div class="auth__card" style="width: 100%;">
|
||||||
<p class="auth__subtitle">Hier siehst du alle registrierten Benutzer.</p>
|
<header class="auth__header">
|
||||||
|
<h1 class="auth__title">Benutzerverwaltung</h1>
|
||||||
|
<p style="text-align: center; color: #94a3b8; font-size: 0.9rem; margin-top: 5px;">Hier siehst du alle registrierten Benutzer.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
<?php if (!empty($successMsg)): ?>
|
<?php if (!empty($successMsg)): ?>
|
||||||
<div class="auth__message auth__message--success"><?= htmlspecialchars($successMsg) ?></div>
|
<div class="auth__message auth__message--success" style="color: #4ade80; background: #064e3b; padding: 10px; border-radius: 4px; margin-bottom: 15px; text-align: center;"><?= htmlspecialchars($successMsg) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (!empty($errorMsg)): ?>
|
<?php if (!empty($errorMsg)): ?>
|
||||||
<div class="auth__message auth__message--error"><?= htmlspecialchars($errorMsg) ?></div>
|
<div class="auth__message auth__message--error" style="color: #f87171; background: #7f1d1d; padding: 10px; border-radius: 4px; margin-bottom: 15px; text-align: center;"><?= htmlspecialchars($errorMsg) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="auth__card" style="padding: 20px;">
|
<div style="overflow-x: auto; margin-top: 20px;">
|
||||||
<table style="width: 100%; border-collapse: collapse; text-align: left;">
|
<table style="width: 100%; border-collapse: collapse; text-align: left; color: #f8fafc;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr style="border-bottom: 2px solid #334155;">
|
<tr style="border-bottom: 2px solid #334155;">
|
||||||
<th style="padding: 10px;">ID</th>
|
<th style="padding: 12px 10px;">ID</th>
|
||||||
<th style="padding: 10px;">Profil</th>
|
<th style="padding: 12px 10px;">Profil</th>
|
||||||
<th style="padding: 10px;">Name</th>
|
<th style="padding: 12px 10px;">Name</th>
|
||||||
<th style="padding: 10px;">E-Mail</th>
|
<th style="padding: 12px 10px;">E-Mail</th>
|
||||||
<th style="padding: 10px;">Aktionen</th>
|
<th style="padding: 12px 10px;">Aktionen</th>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php while ($user = $usersResult->fetch_assoc()): ?>
|
|
||||||
<tr style="border-bottom: 1px solid #1e293b;">
|
|
||||||
<td style="padding: 10px;"><?= $user['userID'] ?></td>
|
|
||||||
<td style="padding: 10px;">
|
|
||||||
<img src="<?= !empty($user['profilePicture']) ? htmlspecialchars($user['profilePicture']) : 'assets/images/placeholder.png' ?>"
|
|
||||||
alt="Profil" style="width: 40px; height: 40px; border-radius: 50%; object-fit: cover;">
|
|
||||||
</td>
|
|
||||||
<td style="padding: 10px;"><?= htmlspecialchars($user['displayname']) ?></td>
|
|
||||||
<td style="padding: 10px;"><?= htmlspecialchars($user['email']) ?></td>
|
|
||||||
<td style="padding: 10px;">
|
|
||||||
<?php if ((int)$user['userID'] !== (int)$_SESSION['user_id']): ?>
|
|
||||||
<form method="post" action="admin_users.php" onsubmit="return confirm('Benutzer wirklich löschen?');" style="margin: 0;">
|
|
||||||
<input type="hidden" name="delete_user_id" value="<?= $user['userID'] ?>">
|
|
||||||
<button type="submit" style="background-color: #ef4444; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem;">Löschen</button>
|
|
||||||
</form>
|
|
||||||
<?php else: ?>
|
|
||||||
<span style="color: #94a3b8; font-size: 0.8rem;">Das bist du</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endwhile; ?>
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
<?php while ($user = $usersResult->fetch_assoc()): ?>
|
||||||
</div>
|
<tr style="border-bottom: 1px solid #1e293b;">
|
||||||
|
<td style="padding: 12px 10px;"><?= $user['userID'] ?></td>
|
||||||
|
<td style="padding: 12px 10px;">
|
||||||
|
<img src="<?= !empty($user['profilePicture']) ? htmlspecialchars($user['profilePicture']) : 'assets/images/placeholder.png' ?>"
|
||||||
|
alt="Profil" style="width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block;">
|
||||||
|
</td>
|
||||||
|
<td style="padding: 12px 10px;"><?= htmlspecialchars($user['displayname']) ?></td>
|
||||||
|
<td style="padding: 12px 10px; word-break: break-all;"><?= htmlspecialchars($user['email']) ?></td>
|
||||||
|
<td style="padding: 12px 10px;">
|
||||||
|
<?php if ((int)$user['userID'] !== (int)$_SESSION['user_id']): ?>
|
||||||
|
<form method="post" action="admin_users.php" onsubmit="return confirm('Benutzer wirklich löschen?');" style="margin: 0;">
|
||||||
|
<input type="hidden" name="delete_user_id" value="<?= $user['userID'] ?>">
|
||||||
|
<button type="submit" class="auth__submit" style="background-color: #ef4444; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; width: auto; margin: 0;">Löschen</button>
|
||||||
|
</form>
|
||||||
|
<?php else: ?>
|
||||||
|
<span style="color: #94a3b8; font-size: 0.85rem; padding: 6px 0; display: inline-block;">Das bist du</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="auth__actions" style="margin-top: 20px;">
|
<div class="auth__actions" style="margin-top: 30px; text-align: center;">
|
||||||
<a href="account.php" style="color: #cbd5e1; text-decoration: none;">← Zurück zum Profil</a>
|
<a href="account.php" style="color: #64748b; text-decoration: none; font-size: 0.95rem;">← Zurück zum Profil</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php include 'footer.php'; ?>
|
<?php include 'footer.php'; ?>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user