{{:ModuleInclude('public/header')}}

<div class="right-content">
    <div class="content-nav">
        <a href="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierList')}}" class="am-btn am-btn-secondary am-btn-xs">
            <i class="am-icon-angle-left"></i> 返回
        </a>
        <span>{{if !empty($info)}}编辑核销员{{else}}添加核销员{{/if}}</span>
    </div>

    <div class="content-body">
        <form class="am-form form-validation" action="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierSave')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierList')}}">
            {{if !empty($info)}}
            <input type="hidden" name="id" value="{{$info.id}}" />
            {{/if}}

            <div class="am-panel am-panel-default">
                <div class="am-panel-hd">核销员信息</div>
                <div class="am-panel-bd">
                    <div class="am-form-group">
                        <label>关联用户 <span class="am-text-danger">*</span></label>
                        <select name="user_id" data-validation-message="请选择关联用户" required>
                            <option value="">请选择用户</option>
                            {{if !empty($users)}}
                            {{foreach $users as $u}}
                            <option value="{{$u.id}}" {{if !empty($info.user_id) && $info.user_id==$u.id}}selected{{/if}}>{{$u.nickname|default='-'}}/{{$u.username}}</option>
                            {{/foreach}}
                            {{/if}}
                        </select>
                    </div>

                    <div class="am-form-group">
                        <label>核销员名称 <span class="am-text-danger">*</span></label>
                        <input type="text" name="name" value="{{if !empty($info)}}{{$info.name}}{{/if}}" placeholder="请输入核销员名称" data-validation-message="核销员名称不能为空" required class="am-radius" />
                    </div>

                    <div class="am-form-group">
                        <label>状态</label>
                        <select name="status">
                            <option value="1" {{if !empty($info) && $info.status==1}}selected{{/if}}>启用</option>
                            <option value="0" {{if !empty($info) && $info.status==0}}selected{{/if}}>禁用</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="am-form-group am-margin-top-lg">
                <button type="submit" class="am-btn am-btn-primary am-btn-block am-radius" data-am-loading="{spinner: 'circle-o-notch', loadingText: '保存中...'}">
                    {{if !empty($info)}}保存修改{{else}}添加核销员{{/if}}
                </button>
            </div>
        </form>
    </div>
</div>

{{:ModuleInclude('public/footer')}}