<?= Form::open(['id' => 'convertGuestForm']) ?>
    <div class="modal-header flex-row-reverse">
        <button type="button" class="close" data-dismiss="popup">&times;</button>
        <h4 class="modal-title">Convert Guest User</h4>
    </div>
    <div class="modal-body">
        <?php if ($this->fatalError): ?>
            <p class="flash-message static error"><?= $fatalError ?></p>
        <?php endif ?>

        <div class="form-group dropdown-field span-full">
            <label class="form-label">Select a new user group</label>
            <select class="form-control custom-select" name="new_group">
                <option selected="selected" value="">- No group -</option>
                <?php foreach ($groups as $group): ?>
                    <option value="<?= $group->id ?>"><?= e($group->name) ?></option>
                <?php endforeach ?>
            </select>
        </div>

        <div class="form-group checkbox-field span-full">
            <div class="checkbox custom-checkbox">
                <input type="hidden" class="checkbox" value="" name="send_registration_notification">
                <input name="send_registration_notification" value="1" type="checkbox" id="sendNotification" checked="checked" />
                <label class="storm-icon-pseudo" for="sendNotification">Send registration notification</label>
            </div>
            <p class="help-block form-text">Use this checkbox to generate new random password for the user and send a registration notification email.</p>
        </div>

    </div>

    <div class="modal-footer">
        <button
            type="submit"
            class="btn btn-primary"
            data-popup-load-indicator
            data-request="onConvertGuest">
            Convert to Registered
        </button>
        <button
            type="button"
            class="btn btn-default"
            data-dismiss="popup">
            <?= e(trans('backend::lang.form.cancel')) ?>
        </button>
    </div>
<?= Form::close() ?>
