<!DOCTYPE html>
<html>
<head><title>Register</title></head>
<body>
    <!-- application/views/admin/create_user.php -->
<h3>Create New User</h3>
<form method="POST" action="<?= base_url('admin/create_user') ?>">
    <div>
        <label for="name">Name</label>
        <input type="text" name="name" id="name" required>
    </div>

    <div>
        <label for="email">Email</label>
        <input type="email" name="email" id="email" required>
    </div>

    <div>
        <label for="password">Password</label>
        <input type="password" name="password" id="password" required>
    </div>

    <div>
        <label for="role_id">Role</label>
        <select name="role_id" id="role_id" required>
            <?php foreach ($roles as $role): ?>
                <option value="<?= $role->id ?>"><?= $role->name ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    
    <label for="is_active">Status:</label>
<select name="is_active" id="is_active">
    <option value="1">Active</option>
    <option value="0">Inactive</option>
</select>


    <button type="submit">Create User</button>
</form>
<a href="<?= base_url('dashboard') ?>">Back to Dashboard</a>
</body>
</html>