okkkaaaay wieder zu bootstrap
Some checks failed
Build and push / Pulling repo on server (push) Failing after 17s

This commit is contained in:
2023-10-23 13:05:16 +02:00
parent 7779d189df
commit bd151ab4e6
17 changed files with 133 additions and 128 deletions

View File

@ -1,6 +1,7 @@
<div class="hidden sm:mb-8 sm:flex sm:justify-center">
<div class="relative rounded-full px-3 py-1 text-sm leading-6 text-gray-600 ring-1 ring-gray-900/10 hover:ring-gray-900/20">
Currently logged in as: <?= $_SESSION['userid']?:'nobody' ?>
Currently logged in as:
<?= $_SESSION['userid']?:'nobody' ?>
</div>
</div>
<div class="text-center">
@ -14,51 +15,44 @@
</div>
</div>
<h1 class="text-2xl p-6 text-center">Admin stuff</h1>
<h1>Admin stuff</h1>
<figure>
<table role="grid">
<thead>
<tr>
<?php foreach (array_keys($userdata[0]) as $key) : ?>
<th>
<?= $key ?>
</th>
<?php endforeach; ?>
<div class="container flex justify-center mx-auto">
<div class="flex flex-col">
<div class="w-full">
<div class="border-b border-gray-200 shadow">
<table class="divide-y divide-gray-300 table-auto overflow-x-scroll w-full">
<thead class="bg-gray-50">
<tr>
<?php foreach (array_keys($userdata[0]) as $key) : ?>
<th class="px-6 py-2 text-xs text-gray-500">
<?= $key ?>
</th>
<?php endforeach; ?>
<th>
Login
</th>
<th>
Edit
</th>
</tr>
</thead>
<tbody>
<?php foreach ($userdata as $user) : ?>
<th class="px-6 py-2 text-xs text-gray-500">
Login
</th>
<th class="px-6 py-2 text-xs text-gray-500">
Edit
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-300">
<?php foreach ($userdata as $user) : ?>
<tr>
<?php foreach (array_keys($user) as $key) : ?>
<td class="px-6 py-4 text-sm text-gray-500">
<?= is_array($user[$key])?json_encode($user[$key]):$user[$key] ?>
</td>
<?php endforeach; ?>
<tr class="whitespace-nowrap">
<?php foreach (array_keys($user) as $key) : ?>
<td class="px-6 py-4 text-sm text-gray-500">
<?= is_array($user[$key])?json_encode($user[$key]):$user[$key] ?>
</td>
<?php endforeach; ?>
<td>
<button name="email" value="<?= $user['email'] ?>" hx-post="/admin/loginas/">Login</button>
</td>
<td>
<button name="email" value="<?= $user['email'] ?>" hx-post="/admin/edituser/" hx-target="#main">Edit</button>
</td>
</tr>
<td class="px-6 py-4">
<button name="email" value="<?= $user['email'] ?>" hx-post="/admin/loginas/" class="px-4 py-1 text-sm text-indigo-600 bg-indigo-200 rounded-full">Login as this user</button>
</td>
<td class="px-6 py-4">
<button name="email" value="<?= $user['email'] ?>" hx-post="/admin/edituser/" hx-target="#main" class="px-4 py-1 text-sm text-red-400 bg-red-200 rounded-full">Edit</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</tbody>
</table>
</figure>