<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>

<div class="container mt-4">
    <h2>Add Staff Member</h2>
    <form action="<?= site_url('staff/store') ?>" method="post">
        <?= csrf_field() ?>
        <div class="mb-3">
            <label>First Name</label>
            <input type="text" name="firstname" class="form-control" required>
        </div>
        <div class="mb-3">
            <label>Last Name</label>
            <input type="text" name="lastname" class="form-control" required>
        </div>
        <div class="mb-3">
            <label>Email</label>
            <input type="email" name="email" class="form-control" required>
        </div>
        <div class="mb-3">
            <label>Password</label>
            <input type="password" name="password" class="form-control" required>
        </div>
        <div class="mb-3">
            <label>Role</label>
            <select name="role_id" class="form-control" required>
                <?php foreach ($roles as $role): ?>
                    <option value="<?= $role['id'] ?>"><?= esc($role['name']) ?></option>
                <?php endforeach ?>
            </select>
        </div>
        <button type="submit" class="btn btn-success">Create</button>
    </form>
</div>

<?= $this->endSection() ?>
