{% extends 'TopxiaAdminBundle:User:layout.html.twig' %}

{% block title %}用户管理 - {{ parent() }}{% endblock %}

{% set menu = 'money_card' %}

{% set script_controller = 'money-card/money-card-list' %}

{% block main %}

<div class="page-header clearfix">
  <button class="btn btn-info btn-sm pull-right" id="add-navigation-btn" data-toggle="modal" data-target="#modal" data-url="{{path('admin_money_card_create')}}">生成充值卡</button>
  <h1 class="pull-left">充值卡管理</h1>
</div>



<ul class="nav nav-tabs">
  <li class="active"><a href="{{ path('admin_money_card') }}">充值卡</a></li>
  <li><a href="{{ path('admin_money_card_batch') }}">生成记录</a></li>
</ul>
<br>

    <form id="money-card-search-form" class="form-inline well well-sm" action="" method="get" novalidate>

        <div class="form-group">
          <input type="text" id="cardIdSearch" name="cardId" class="form-control" value="{{ app.request.query.get('cardId') }}" placeholder="卡号">
        </div>

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

        <div class="form-group">
          <input type="text" id="deadlineSearch" name="deadlineSearch" class="form-control" value="{{ app.request.query.get('deadlineSearch') }}" placeholder="有效期">
        </div>

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

        <div class="form-group">
          <input type="text" id="batchIdSearch" name="batchId" class="form-control" value="{{ app.request.query.get('batchId') }}" placeholder="批次">
        </div>

        <button class="btn btn-primary">搜索</button>
    </form>

    <table id="money-card-table" class="table table-striped table-hover" data-search-form="#money-card-search-form">
      <thead>
        <tr>
          <th>卡号</th>
          <th>密码</th>
          <th>有效期</th>
          <th>批次</th>
          <th>状态</th>
          <th>充值记录</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      {% if moneyCards %}
        {% for moneyCard in moneyCards %}
            {% include 'TopxiaAdminBundle:MoneyCard:money-card-table-tr.html.twig' with {moneyCard:moneyCard} %}
        {% endfor %}
      </tbody>
    </table>
      {% else %}
      </tbody>
    </table>
    <div class='empty'>数据库君表示自己非常不给力，啥都没找到~~</div>
      {% endif %}
  {{ web_macro.paginator(paginator) }}

{% endblock %}