{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-customer').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button></div>
      <h1>{{ heading_title }}</h1>
      <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
          <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    {% if error_warning %}
      <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      </div>
    {% endif %}
    {% if success %}
      <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      </div>
    {% endif %}
    <div class="row">
      <div class="col-md-9 col-md-pull-3 col-sm-12">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
          </div>
          <div class="panel-body">
            <div id="payment-method"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script type="text/javascript"><!--
      $('#payment-method').delegate('.pagination a', 'click', function (e) {
          e.preventDefault();

          $('#payment-method').load(this.href);
      });

      $('#payment-method').load('index.php?route=customer/customer_payment/getPayment&user_token={{ user_token }}');

      $('#payment-method').on('click', '.btn-success, .btn-danger', function (e) {
          e.preventDefault();

          var element = this;

          $.ajax({
              url: $(element).attr('href'),
              dataType: 'json',
              beforeSend: function () {
                  $(element).button('loading');
              },
              complete: function () {
                  $(element).button('reset');
              },
              success: function (json) {
                  $('.alert-dismissible').remove();

                  if (json['error']) {
                      $('#payment-method').before('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                  }

                  if (json['success']) {
                      $('#payment-method').load('index.php?route=customer/customer_payment/getPayment&user_token={{ user_token }}');

                      $('#payment-method').before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                  }
              },
              error: function (xhr, ajaxOptions, thrownError) {
                  alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
              }
          });
      });
  //--></script>
</div>
{{ footer }}