<?= $this->extend('layouts/admin') ?><?= $this->section('content') ?>
<div class="panel table-responsive"><table class="table align-middle"><thead><tr><th>Pengirim</th><th>Ucapan</th><th>Status</th><th></th></tr></thead><tbody><?php foreach($items as $item): ?><tr><td><?= esc($item['nama_pengirim']) ?></td><td><?= esc($item['ucapan']) ?></td><td><span class="badge <?= $item['is_approved']?'text-bg-success':'text-bg-warning' ?>"><?= $item['is_approved']?'Tayang':'Menunggu' ?></span></td><td class="text-end"><?php if(!$item['is_approved']): ?><form class="d-inline" method="post" action="<?= base_url('admin/ucapan/approve/'.$item['id']) ?>"><?= csrf_field() ?><button class="btn btn-sm btn-outline-success"><i class="bi bi-check-lg"></i></button></form><?php endif ?><form class="d-inline" method="post" action="<?= base_url('admin/ucapan/'.$item['id']) ?>"><?= csrf_field() ?><input type="hidden" name="_method" value="DELETE"><button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button></form></td></tr><?php endforeach ?></tbody></table></div>
<?= $this->endSection() ?>
