<div id="add_user_modal"class="modal fade"tabindex="-1"role="dialog"aria-labelledby="myModalLabel"aria-hidden="true"style="display:none;">
    <div class="modal-dialog">
        <div class="modal-content card-outline-info">
            <div class="card-header text-white text-center">New User Form</div>
            <div class="modal-body">
              <?= form_open('', ['id' => 'formAdd', 'class' => 'form-validation']) ?>
                            <div class="form-group">
                                <label class="small" for="name">Full Name</label>
                                <input autofocus type="text" name="name" id="name" class="form-control" required />
                            </div>
                            <div class="form-group">
                                <label class="small" for="username">Username</label>
                                <input type="text" id="username" name="username" class="form-control" required placeholder="Username">
                                <div id="error_username" class="alert alert-danger" style="display: none;">Username already exists</div>
                            </div>
                            <div class="form-group">
                                <label class="small" for="email">Email</label>
                                <input type="email" id="email" name="email" class="form-control" required placeholder="Email">
                                <div id="error_email" class="alert alert-danger" style="display: none;">Email already exists</div>
                            </div>
                            <div class="form-group">
                                <label class="small" for="role">User Role</label>
                                <select id="role" name="role" class="form-control" required>
                                    <option value="">Select Role</option>
                                    <?php if (!empty($roles)): ?>
                                        <?php foreach ($roles as $role): ?>
                                            <option value="<?= $role->name ?>"><?= $role->label ?></option>
                                        <?php endforeach; ?>
                                    <?php endif; ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="small" for="password">Password</label>
                                <input type="password" id="password" name="password" class="form-control" required placeholder="Password">
                            </div>


                        <div class="form-group text-right">
                            <div class="col-md-4">
                                <button type="submit" class="btn btn-success">Submit</button>
                            </div>
                        </div>
                <?= form_close(); ?>
                </div>
            </div>
        </div>
    </div>
</div>