This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
dogstats/web/pages/dogs/list.html

43 lines
1.7 KiB
HTML
Raw Normal View History

2023-10-22 23:05:24 +02:00
<h1 class="text-2xl p-6 text-center">Meine Hunde</h1>
2023-10-23 10:00:19 +02:00
<div class="border-b border-gray-200 shadow overflow-x">
<table class="divide-y divide-gray-300 table-auto overflow-scroll w-ful">
<thead class="bg-gray-50">
<tr>
<?php foreach (array_keys($doggos[0]) as $key) : ?>
<th class="px-6 py-2 text-xs text-gray-500">
<?= $key ?>
</th>
<?php endforeach; ?>
2023-10-22 23:05:24 +02:00
2023-10-23 10:00:19 +02:00
<th class="px-6 py-2 text-xs text-gray-500">
Bearbeiten
</th>
<th class="px-6 py-2 text-xs text-gray-500">
Löschen
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-300">
<?php foreach ($doggos as $dog) : ?>
2023-10-22 23:05:24 +02:00
2023-10-23 10:00:19 +02:00
<tr class="whitespace-nowrap">
<?php foreach (array_keys($dog) as $key) : ?>
<td class="px-6 py-4 text-sm text-gray-500">
<?= $dog[$key] ?>
</td>
<?php endforeach; ?>
2023-10-22 23:05:24 +02:00
2023-10-23 10:00:19 +02:00
<td class="px-6 py-4">
<button hx-get="/dogs/edit/<?= $dog['id'] ?>" hx-push-url="/dogs/edit/<?= $dog['id'] ?>" hx-target="#main" class="px-4 py-1 text-sm text-indigo-600 bg-indigo-200 rounded-full">Bearbeiten</button>
</td>
<td class="px-6 py-4">
<button hx-get="/dogs/delete/<?= $dog['id'] ?>" hx-target="#main" class="px-4 py-1 text-sm text-red-400 bg-red-200 rounded-full">Löschen</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
2023-10-22 23:05:24 +02:00
</div>