{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right"> <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a> </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="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_fulfillment_list }}</h3>
      </div>
      <div class="panel-body">
        <div class="well">
          <div class="row">
            <div class="col-sm-12">
              <div class="form-group">
                <label class="control-label" for="input-date">{{ entry_start_date }}</label>
                <div class="input-group date">
                  <input type="text" name="filter_date" value="{{ filter_date }}" placeholder="YYYY-MM-DD" data-date-format="YYYY-MM-DD" id="input-date" class="form-control" />
                  <span class="input-group-btn">
                  <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                  </span> </div>
              </div>
            </div>
            <button type="button" id="button-filter" class="btn btn-primary pull-right"><i class="fa fa-filter"></i> {{ button_filter }}</button>
          </div>
        </div>
        <div class="table-responsive">
          <table class="table table-bordered table-hover">
            <thead>
              <tr>
                <th class="text-left">{{ column_seller_fulfillment_order_id }}</th>
                <th class="text-left">{{ column_displayable_order_id }}</th>
                <th class="text-left">{{ column_displayable_order_date }}</th>
                <th class="text-left">{{ column_shipping_speed_category }}</th>
                <th class="text-left">{{ column_fulfillment_order_status }}</th>
                <td class="text-left">{{ column_action }}</td>
              </tr>
            </thead>
            <tbody>
            
            {% if not fulfillments %}
            <tr>
              <td class="text-center" colspan="6">{{ text_no_results }}</td>
            </tr>
            {% else %}
            {% for fulfillment in fulfillments %}
            <tr>
              <td class="text-left">{{ fulfillment.seller_fulfillment_order_id }}</td>
              <td class="text-left">{{ fulfillment.displayable_order_id }}</td>
              <td class="text-left">{{ fulfillment.displayable_order_date_time }}</td>
              <td class="text-left">{{ fulfillment.shipping_speed_category }}</td>
              <td class="text-left">{{ fulfillment.fulfillment_order_status }}</td>
              <td class="text-right"><a href="{{ fulfillment.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
            </tr>
            {% endfor %}
            {% endif %}
              </tbody>
            
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
$('#button-filter').on('click', function() {
	var url = 'index.php?route=extension/openbay/fba/fulfillmentlist&user_token={{ user_token }}';
	
	var filter_date = $('input[name=\'filter_date\']').val();
	
	if (filter_date) {
		url += '&filter_date=' + encodeURIComponent(filter_date);
	}
	
	var filter_time = $('input[name=\'filter_time\']').val();
	
	if (filter_time) {
		url += '&filter_time=' + encodeURIComponent(filter_time);
	}
	
	location = url;
});
//--></script> 
</script>
<script type="text/javascript"><!--
$('.date').datetimepicker({
	language: '{{ datepicker }}',
	pickTime: false
});
//--></script> 
{{ footer }}