{{ header }}
<div id="account-order" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
     
    <div id="content" class="col-sm-9">
        <div class="row">
             <div id="filter-order" class="col-md-3 col-sm-12">
              <div class="panel panel-default">
                <div class="panel-heading">
                  <h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
                </div>
                <div class="panel-body">
                 
                
                  <div class="form-group">
                    <label class="control-label" for="input-date-added">{{ entry_date_start}}</label>
                    <input type="date" name="filter_date_start" value="{{ filter_date_start}}" placeholder="{{ entry_date_start }}" id="input-date-added" class="form-control" />
                     
                  </div>
                  <div class="form-group">
                    <label class="control-label" for="input-date-modified">{{ entry_date_end }}</label>
                    <input type="date" name="filter_date_end" value="{{ filter_date_end }}" placeholder="{{ entry_date_end }}" id="input-date-modified" class="form-control" />
                    
                  </div>
                  <div class="form-group text-right">
                    <button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
                  </div>
                </div>
              </div>
            </div>
            <div id="filter-order" class="col-md-9 col-sm-12">
                 {{ content_top }}
                  <h1>{{ heading_title }}</h1>
                  {% if businesses %}
                  <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                      <thead>
                        <tr>
                          <td class="text-right">{{ column_total_GBP }}</td>
                          <td class="text-right">{{ column_total_GBPurchase }}</td>
                        </tr>
                      </thead>
                      <tbody>
                       {% for business in businesses %}
                        <tr>
                          <td class="text-right">{{ business.points }}</td>
                          <td class="text-right">{{ business.total }}</td>
                        </tr>
                        {% endfor %}
                      </tbody>
                    </table>
                  </div>
                  {% else %}
                  <p>{{ text_empty }}</p>
                  {% endif %}
                  {{ content_bottom }}
            </div>
           
        </div>
        
       </div>
      
      
    {{ column_right }}</div>
</div>
 <script type="text/javascript"><!--
   $('#button-filter').on('click', function() {
       
	url = '';
	
	var filter_date_start = $('input[name=\'filter_date_start\']').val();

	if (filter_date_start) {
		url += '&filter_date_start=' + encodeURIComponent(filter_date_start);
	}

	var filter_date_end = $('input[name=\'filter_date_end\']').val();

	if (filter_date_end) {
		url += '&filter_date_end=' + encodeURIComponent(filter_date_end);
	}

	location = 'index.php?route=account/business_detail' + url;
});
//--></script> 
   

{{ footer }}
