<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Edit Kos</title>
    <link rel="stylesheet" href="<?= base_url('asset/css/bootstrap.min.css') ?>">
</head>
<body class="p-4">
<div class="container">
    <h3>Edit Kos</h3>
    <form method="post">
        <div class="mb-3">
            <label>Nama Kos</label>
            <input type="text" name="nama_kos" class="form-control" value="<?= $kos->nama_kos ?>" required>
        </div>
        <div class="mb-3">
            <label>Alamat</label>
            <textarea name="alamat" class="form-control" required><?= $kos->alamat ?></textarea>
        </div>
        <div class="mb-3">
            <label>Jumlah Kamar</label>
            <input type="number" name="jumlah_kamar" class="form-control" value="<?= $kos->jumlah_kamar ?>" required>
        </div>
        <div class="mb-3">
            <label>Deskripsi</label>
            <textarea name="deskripsi" class="form-control"><?= $kos->deskripsi ?></textarea>
        </div>
        <div class="mb-3">
            <label>Status</label>
            <select name="status" class="form-control">
                <option value="Aktif" <?= $kos->status == 'Aktif' ? 'selected' : '' ?>>Aktif</option>
                <option value="Nonaktif" <?= $kos->status == 'Nonaktif' ? 'selected' : '' ?>>Nonaktif</option>
            </select>
        </div>
        <button type="submit" class="btn btn-success">Simpan Perubahan</button>
        <a href="<?= site_url('admin/kos') ?>" class="btn btn-secondary">Batal</a>
    </form>
</div>
</body>
</html>
