70 lines
No EOL
6.4 KiB
PHP
70 lines
No EOL
6.4 KiB
PHP
<?php require_once __DIR__ . '/../inc/admin_header.php'; ?>
|
|
<div class="max-w-6xl w-full mx-auto flex flex-col md:flex-row gap-4 sm:gap-6 p-4 sm:p-6">
|
|
<aside class="w-full md:w-64 bg-slate-900/80 backdrop-blur-sm border border-slate-700/50 rounded-xl shadow-lg p-4 h-fit shrink-0">
|
|
<div class="flex items-center gap-2 mb-6 border-b border-slate-700/50 pb-3">
|
|
<span class="text-xl">⚙️</span>
|
|
<h2 class="text-emerald-400 font-mono font-bold text-lg tracking-tight">System_Admin</h2>
|
|
</div>
|
|
<nav class="flex flex-col gap-2 font-mono text-sm">
|
|
<a href="<?= Config::get('BASE_URL', '/') ?>admin" class="px-3 py-2 hover:bg-slate-800 text-slate-400 hover:text-slate-200 rounded-md transition-all">> Dashboard</a>
|
|
<a href="<?= Config::get('BASE_URL', '/') ?>admin/users" class="px-3 py-2 bg-emerald-500/10 text-emerald-400 rounded-md border border-emerald-500/20 transition-all">> Benutzer</a>
|
|
<a href="<?= Config::get('BASE_URL', '/') ?>admin/settings" class="px-3 py-2 hover:bg-slate-800 text-slate-400 hover:text-slate-200 rounded-md transition-all">> Einstellungen</a>
|
|
</nav>
|
|
</aside>
|
|
<main class="flex-1 min-w-0 bg-slate-900/80 backdrop-blur-sm border border-slate-700/50 rounded-xl shadow-2xl overflow-hidden flex flex-col">
|
|
<div class="bg-slate-800/80 px-4 py-3 border-b border-slate-700/50 flex items-center justify-between">
|
|
<div class="flex items-center gap-2">
|
|
<div class="w-3 h-3 rounded-full bg-rose-500 hidden sm:block"></div>
|
|
<div class="w-3 h-3 rounded-full bg-amber-500 hidden sm:block"></div>
|
|
<div class="w-3 h-3 rounded-full bg-emerald-500 hidden sm:block"></div>
|
|
<div class="sm:ml-2 font-mono text-xs text-slate-400">philcore-users.sh</div>
|
|
</div>
|
|
<a href="<?= Config::get('BASE_URL') ?>admin/user_form" class="text-xs font-mono bg-emerald-500/20 text-emerald-400 border border-emerald-500/50 px-3 py-1 rounded hover:bg-emerald-500/40 transition-colors whitespace-nowrap">+ NEW_USER</a>
|
|
</div>
|
|
<div class="p-4 sm:p-8 flex-1">
|
|
<header class="mb-6 sm:mb-8 border-b border-slate-800 pb-4 sm:pb-6">
|
|
<h1 class="text-2xl sm:text-3xl font-extrabold text-transparent bg-clip-text bg-linear-to-r from-emerald-400 to-cyan-400 tracking-tight mb-2">> <?= htmlspecialchars($title) ?>_</h1>
|
|
<p class="text-slate-400 font-mono text-xs sm:text-sm">Registrierte System-Accounts.</p>
|
|
</header>
|
|
<div class="overflow-x-auto border border-slate-800/80 rounded-lg -mx-4 sm:mx-0">
|
|
<table class="w-full text-left font-mono text-xs sm:text-sm text-slate-400">
|
|
<thead class="bg-slate-950/80 text-emerald-400 text-[10px] sm:text-xs uppercase">
|
|
<tr>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap">ID</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap md:whitespace-normal">Name</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap md:whitespace-normal">Email</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap md:whitespace-normal">Rolle</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap md:whitespace-normal">Projekte</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 whitespace-nowrap">Status</th>
|
|
<th class="px-3 sm:px-4 py-3 border-b border-slate-800/80 text-right whitespace-nowrap">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-800/50 bg-slate-900/50">
|
|
<?php if(empty($users)): ?>
|
|
<tr><td colspan="7" class="px-4 py-4 text-center">Keine Benutzer gefunden.</td></tr>
|
|
<?php else: foreach($users as $u): ?>
|
|
<tr class="hover:bg-slate-800/50 transition-colors">
|
|
<td class="px-3 sm:px-4 py-3 whitespace-nowrap">#<?= $u['id'] ?></td>
|
|
<td class="px-3 sm:px-4 py-3 text-slate-200 text-xs sm:text-sm whitespace-nowrap md:whitespace-normal"><?= htmlspecialchars($u['name']) ?></td>
|
|
<td class="px-3 sm:px-4 py-3 text-[10px] sm:text-xs text-slate-400 whitespace-nowrap md:whitespace-normal break-all"><?= htmlspecialchars($u['email']) ?></td>
|
|
<td class="px-3 sm:px-4 py-3 whitespace-nowrap"><?= $u['is_admin'] ? '<span class="text-fuchsia-400">Admin</span>' : 'User' ?></td>
|
|
<td class="px-3 sm:px-4 py-3 text-[10px] sm:text-xs text-slate-500 min-w-120px max-w-180px md:max-w-none truncate md:whitespace-normal md:wrap-break-words"><?php $proj = $u['projects'] ?? []; echo empty($proj) ? '-' : htmlspecialchars(implode(', ', $proj)); ?></td>
|
|
<td class="px-3 sm:px-4 py-3 whitespace-nowrap"><span class="<?= $u['status'] === 'Active' ? 'text-emerald-500' : 'text-rose-500' ?>"><?= htmlspecialchars($u['status']) ?></span></td>
|
|
<td class="px-3 sm:px-4 py-3 text-right whitespace-nowrap">
|
|
<div class="flex justify-end gap-2 sm:gap-3">
|
|
<a href="<?= Config::get('BASE_URL') ?>admin/user_form/<?= $u['id'] ?>" class="text-cyan-400 hover:text-cyan-300">Edit</a>
|
|
<form action="<?= Config::get('BASE_URL') ?>admin/user_delete/<?= $u['id'] ?>" method="POST" class="inline" onsubmit="return confirm('Wirklich löschen?');">
|
|
<input type="hidden" name="csrf_token" value="<?= Security::csrf() ?>">
|
|
<button type="submit" class="text-rose-400 hover:text-rose-300">Del</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<?php require_once __DIR__ . '/../inc/admin_footer.php'; ?>
|