projectbased/app/Views/needs/index.php
SHA-256: ae58425b4244843438a063ea304796b428cb71a6f03a73210c6c6848c46d8aa9
<?php use App\Lib\Url; ?>
<div class="section-title mb-3">
<div>
<h1 class="h4 m-0">Bedarf</h1>
<div class="muted">Bedarf melden, bewerten und priorisieren (Demo).</div>
</div>
<a class="btn btn-primary" href="<?= Url::route('needs_new') ?>">Bedarf melden</a>
</div>
<div class="card p-4">
<div class="table-responsive">
<table class="table table-sm align-middle mb-0">
<thead><tr><th>Titel</th><th>Kategorie</th><th>Region</th><th>Prio</th><th></th></tr></thead>
<tbody>
<?php foreach($needs as $n): ?>
<tr>
<td>
<div class="fw-semibold"><?= htmlspecialchars($n['title']) ?></div>
<div class="muted small"><?= htmlspecialchars($n['created_at']) ?></div>
</td>
<td><span class="badge badge-soft"><?= htmlspecialchars($n['category']) ?></span></td>
<td><?= htmlspecialchars($n['region']) ?></td>
<td><span class="badge badge-soft"><?= (int)$n['priority'] ?></span></td>
<td class="text-end">
<a class="btn btn-sm btn-outline-light" href="<?= Url::route('need_view',['id'=>(int)$n['id']]) ?>">Öffnen</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>