{% extends (course_count(course.courseSetId) > 1 ? 'course' : 'courseset') ~ '-manage/layout.html.twig' %}

{% block title %}{{'课程订单查询'|trans}} - {{ course.title }} - {{ parent() }}{% endblock %}
{% set side_nav = 'orders' %}

{% block main %}

  {% do load_script('course-manage/order') %}
  {% include 'seajs_loader_compatible.html.twig' with {topxiawebbundle: true} %}

  <div class="panel panel-default">
    {% include 'course-manage/panel-header/course-publish-header.html.twig' with {code: side_nav,btnGroup:1} %}
    <div class="panel-body">
      <form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
        <div class="mbm">
          {{'创建时间'|trans}} :
          <div class="form-group">
              <input class="form-control" type="text" id="startDate" name="startDateTime" value="{{app.request.query.get('startDateTime')}}" placeholder="{{'起始时间'|trans}}">
          </div>
          <div class="form-group">-</div>
          <div class="form-group">
              <input class="form-control" type="text" id="endDate" name="endDateTime" value="{{app.request.query.get('endDateTime')}}" placeholder="{{'结束时间'|trans}}">
          </div>
        </div>
        <div>
          {{'筛选条件'|trans}} :
          <div class="form-group">
            <select class="form-control" name="status">
              {{ select_options(dict('orderStatus'), request.get('status'), '订单状态'|trans) }}
            </select>
          </div>

          <div class="form-group">
            <select class="form-control" name="payment">
              {% set options = {'':'支付方式'|trans,'alipay':'支付宝'|trans,'wxpay':'微信支付'|trans,'none':'其他支付'|trans} %}
              {{ select_options(options, request.get('payment')) }}
            </select>
          </div>

          <span class="divider"></span>

            <div class="form-group">
                <select class="form-control" name="keywordType">
                  {% set options = {sn: '订单号'|trans, buyer:'购买者用户名'|trans} %}
                  {{ select_options(options, request.get('keywordType')) }}
                </select>
            </div>

            <div class="form-group">
                <input class="form-control" type="text" name="keyword" value="{{ request.get('keyword') }}" placeholder="{{'关键词'|trans}}">
            </div>

          <button class="btn btn-primary">{{'搜索'|trans}}</button>
        </div>
      </form>
      <table class="table table-striped table-hover" id="order-table">
          {% include 'order/order-table.html.twig' with {mode:'course'} %}
      </table>
      {{ web_macro.paginator(paginator) }}
    </div>
  </div>
{% endblock %}