{% extends 'my-order/layout.html.twig' %}
{% do script(['app/js/my/order/index.js']) %}

{% set main_nav = 'orders' %}

{% block main_body %}
  <ul class="nav nav-pills" role="tablist">
    <li role="presentation" {% if app.request.query.get('status')=='' %}class="active"{% endif %}><a href="{{path('my_orders',{status:''})}}">{{'全部订单'|trans}}</a></li>
    <li role="presentation" {% if app.request.query.get('status')=='created' %}class="active"{% endif %}><a href="{{path('my_orders',{status:'created'})}}">{{'待付款'|trans}}<span class="badge">{{waitToBePaidCount}}</span></a></li>
    <li role="presentation" {% if app.request.query.get('status')=='paid' %}class="active"{% endif %}><a href="{{path('my_orders',{status:'paid'})}}">{{'已付款'|trans}}</a></li>
  </ul>
  <br>
  <form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
    <input type="hidden" name="status" value="{{app.request.query.get('status')}}">
    <div class="form-group">
      <select class="form-control" name="lastHowManyMonths"  onchange="submit();" >
        {% set options = {'oneWeek':'最近一周'|trans,'twoWeeks':'最近两周'|trans,'oneMonth':'最近一个月'|trans,'twoMonths':'最近两个月'|trans,'threeMonths':'最近三个月'|trans,'':'全部记录'|trans} %}
        {{ select_options(options, request.get('lastHowManyMonths')) }}
      </select>
    </div>
    <div class="form-group">
      <select class="form-control" name="payWays"  onchange="submit();" >

        {% set options = {'alipay':'支付宝'|trans,'wxpay':'微信支付'|trans,'heepay':'网银支付'|trans,'quickpay':'快捷支付'|trans,'llpay':'连连支付'|trans,'none':'其他支付'|trans,'':'支付方式'|trans} %}
        {{ select_options(options, request.get('payWays')) }}
      </select>
    </div>
  </form>
  <div class="table-responsive">
    <table class="table table-striped table-hover" id="orders-table">
      {% include 'order/order-table.html.twig' with {mode: 'my'} %}
    </table>
  </div>
{{ web_macro.paginator(paginator) }}
{% endblock %}