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

<style>
    .page-title {
        font-size: 18px;
        font-weight: 600;
        color: #1a1a2e;
        padding: 24px 0 16px 0;
        border-bottom: 2px solid #e8e8e8;
        margin-bottom: 20px;
    }
</style>

<div class="right-content">
    <div class="page-title">
        <i class="am-icon-history am-margin-right-sm"></i>核销记录
    </div>

    <!-- 搜索栏 -->
    <div class="am-panel am-panel-default am-radius am-margin-bottom-sm">
        <div class="am-panel-bd am-cf">
            <form action="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerificationList')}}" method="POST" class="am-form form-validation form-search am-fl" request-type="form">
                <div class="am-input-group am-input-group-sm am-fl" style="width: 200px;">
                    <input type="text" name="keywords" value="{{$keywords|default=''}}" placeholder="搜索票码/核销员" class="am-radius" />
                </div>
                <div class="am-input-group am-input-group-sm am-fl am-margin-left-xs" style="width: 150px;">
                    <select name="verifier_id">
                        <option value="">全部核销员</option>
                        {{if !empty($verifiers)}}
                        {{foreach $verifiers as $vid=>$vname}}
                        <option value="{{$vid}}" {{if !empty($verifier_id) && $verifier_id==$vid}}selected{{/if}}>{{$vname}}</option>
                        {{/foreach}}
                        {{/if}}
                    </select>
                </div>
                <div class="am-input-group am-input-group-sm am-fl am-margin-left-xs" style="width: 140px;">
                    <input type="text" name="start_date" value="{{$start_date|default=''}}" placeholder="开始日期" class="am-radius" autocomplete="off" data-date-format="yyyy-mm-dd" />
                </div>
                <div class="am-input-group am-input-group-sm am-fl" style="width: 140px;">
                    <input type="text" name="end_date" value="{{$end_date|default=''}}" placeholder="结束日期" class="am-radius" autocomplete="off" data-date-format="yyyy-mm-dd" />
                </div>
                <button type="submit" class="am-btn am-btn-primary am-btn-xs am-radius am-fl am-margin-left-xs" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">
                    <i class="am-icon-search"></i> 搜索
                </button>
                <a href="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerificationList')}}" class="am-btn am-btn-default am-btn-xs am-radius am-fl am-margin-left-xs">
                    <i class="am-icon-refresh"></i> 重置
                </a>
            </form>
        </div>
    </div>

    <!-- 表格 -->
    <div class="am-panel am-panel-default am-radius">
        <div class="am-panel-hd">核销记录 <span class="am-text-xs am-padding-left">共 {{$count|default=0}} 条</span></div>
        <div class="am-panel-bd">
            <table class="am-table am-table-striped am-table-hover am-text-middle am-scrollable-horizontal">
                <thead>
                    <tr>
                        <th class="am-text-center" width="60">ID</th>
                        <th class="am-text-left">票码</th>
                        <th class="am-text-left">核销员</th>
                        <th class="am-text-left">商品</th>
                        <th class="am-text-left">座位信息</th>
                        <th class="am-text-left">观演人</th>
                        <th class="am-text-left">核销时间</th>
                    </tr>
                </thead>
                <tbody>
                    {{if !empty($list)}}
                    {{foreach $list as $item}}
                    <tr>
                        <td class="am-text-center">{{$item.id}}</td>
                        <td>{{$item.ticket_code}}</td>
                        <td>{{$item.verifier_name|default='-'}}</td>
                        <td>{{$item.goods_title|default='-'}}</td>
                        <td>{{$item.seat_info|default='-'}}</td>
                        <td>{{$item.real_name|default='-'}}</td>
                        <td>{{if !empty($item.created_at)}}{{$item.created_at|date='Y-m-d H:i'}}{{else}}-{{/if}}</td>
                    </tr>
                    {{/foreach}}
                    {{else}}
                    <tr>
                        <td colspan="7" class="am-text-center">暂无数据</td>
                    </tr>
                    {{/if}}
                </tbody>
            </table>

            <!-- 分页 -->
            {{if !empty($page)}}
            <div class="am-margin-top-sm">
                {{$page|raw}}
            </div>
            {{/if}}
        </div>
    </div>
</div>

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