<?= Form::open(['id' => 'convertGuestForm']) ?>
    <div class="modal-header">
        <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>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 for="sendNotification">Send registration notification</label>
                <p class="help-block">Use this checkbox to generate new random password for the user and send a registration notification email.</p>
            </div>
        </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() ?>
