<?= $this->extend('layouts/admin') ?><?= $this->section('content') ?>
<form class="panel" method="post" action="<?= $item ? base_url('admin/tamu/'.$item['id']) : base_url('admin/tamu') ?>"><?= csrf_field() ?><?php if($item): ?><input type="hidden" name="_method" value="PUT"><?php endif ?>
<div class="row g-3"><div class="col-md-6"><label class="form-label">Nama Tamu</label><input class="form-control" name="nama_tamu" maxlength="180" value="<?= esc(old('nama_tamu', $item['nama_tamu'] ?? '')) ?>" required></div><div class="col-md-6"><label class="form-label">Nomor HP</label><input class="form-control" name="nomor_hp" maxlength="30" value="<?= esc(old('nomor_hp', $item['nomor_hp'] ?? '')) ?>" placeholder="Contoh: 081234567890"></div><div class="col-md-6"><label class="form-label">Status Kehadiran</label><select class="form-select" name="status_kehadiran"><?php foreach(['belum'=>'Belum Konfirmasi','hadir'=>'Hadir','tidak_hadir'=>'Tidak Hadir'] as $v=>$l): ?><option value="<?= $v ?>" <?= old('status_kehadiran', $item['status_kehadiran']??'belum')===$v?'selected':'' ?>><?= $l ?></option><?php endforeach ?></select></div><div class="col-12"><button class="btn btn-emerald">Simpan</button> <a class="btn btn-light" href="<?= base_url('admin/tamu') ?>">Batal</a></div></div></form>
<?= $this->endSection() ?>
