{{ header }}
<div class="pts-container">
  <ul class="pts-breadcrumb">
	{% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
	{% endfor %}
  </ul>
  <div class="pts-row">{{ column_left }}
	{% if column_left and column_right %}
    {% set class = 'pts-col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'pts-col-sm-9' %}
    {% else %}
    {% set class = 'pts-col-sm-12' %}
    {% endif %}
    <div id="pts-content" class="{{ class }}">{{ content_top }}
      <h2>{{ heading_title }}</h2>
	  <div class="pts-well">
	  <div class="pts-row">
		<div class="pts-col-sm-4">
		  <div class="pts-form-group">
			<label class="pts-control-label" for="input-date-added">{{ entry_date_from }}</label>
			<div class="pts-input-group date">
			  <input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" data-date-format="YYYY-MM-DD" id="input-date-from" class="pts-form-control" />
			  <span class="pts-input-group-btn">
			  <button type="button" class="pts-btn pts-btn-default"><i class="fa fa-calendar"></i></button>
			  </span></div>
		  </div>
		</div>
		<div class="pts-col-sm-4">
		  <div class="pts-form-group">
			<label class="pts-control-label" for="input-date-modified">{{ entry_date_to }}</label>
			<div class="pts-input-group date">
			  <input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" data-date-format="YYYY-MM-DD" id="input-date-to" class="pts-form-control" />
			  <span class="pts-input-group-btn">
			  <button type="button" class="pts-btn pts-btn-default"><i class="fa fa-calendar"></i></button>
			  </span></div>
		  </div>        
		</div>
		<div class="pts-col-sm-4">
		  <div class="pts-form-group">
			<label class="pts-control-label" for="input-order-status">{{ entry_order_status }}</label>
			<select name="filter_order_status" id="input-order-status" class="pts-form-control">
			  <option value="*"></option>
			  {% if filter_order_status == '0' %}
			  <option value="0" selected="selected">{{ text_missing }}</option>
			  {% else %}
			  <option value="0">{{ text_missing }}</option>
			  {% endif %}
				{% for order_status in order_statuses %}
				{% if order_status.order_status_id == filter_order_status %}
			  <option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
			  {% else %}
			  <option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
			  {% endif %}
			  {% endfor %}
			</select>
		  </div>
		</div>
	  </div>
	  <div class="pts-row">
		<div class="pts-col-sm-10">
		{% if filter_date_from is not empty or filter_date_to is not empty or filter_order_status is not empty %}
				<div class="pts-col-sm-4">{{ entry_total_sale }} <b>{{ total_sale }}</b></div>
				<div class="pts-col-sm-4">{{ entry_total_pay }} <b>{{ total_pay }}</b></div>
				<div class="pts-col-sm-4">{{ entry_total_commission }} <b>{{ total_commission }}</b></div>
			{% endif %}
		</div>
		<div class="pts-col-sm-2">
		  <button type="button" id="pts-button-filter" class="pts-btn pts-btn-primary pts-pull-right"><i class="fa fa-filter"></i> {{ button_filter }}</button>
		</div>
	  </div>
	  </div>
      <div class="pts-table-responsive">
		<table class="pts-table pts-table-bordered pts-table-hover">
		  <thead>
			<tr>
			  <td class="pts-text-left">{{ column_order_id }}</td>
			  <td class="pts-text-left">{{ column_customer }}</td>
			  <td class="pts-text-left">{{ column_status }}</td>
			  <td class="pts-text-left">{{ column_commissions }}</td>
			  <td class="pts-text-left">{{ column_total }}</td>
			  <td class="pts-text-left">{{ column_date_added }}</td>
			  <td class="pts-text-left">{{ column_date_modified }}</td>
			  <td class="pts-text-left"></td>
			</tr>
		  </thead>
		  <tbody>
			{% if seller_orders %}
			{% for order in seller_orders %}
			<tr>
			  <td class="pts-text-left">{{ order.order_id }}</td>
			  <td class="pts-text-left">{{ order.customer }}</td>
			  <td class="pts-text-left">{{ order.order_status }}</td>
              <td class="pts-text-left">{{ order.commission }}</td>
			  <td class="pts-text-left">{{ order.total }}</td>
			  <td class="pts-text-left">{{ order.date_added }}</td>
			  <td class="pts-text-left">{{ order.date_modified }}</td>
			  <td class="pts-text-left"><a href="{{ order.view }}" data-toggle="tooltip" title="{{ button_view }}" class="pts-btn pts-btn-info"><i class="fa fa-eye"></i></a></td>
			</tr>
			{% endfor %}
			{% else %}
			<tr>
			  <td class="pts-text-center" colspan="8">{{ text_no_results }}</td>
			</tr>
			{% endif %}
		  </tbody>
		</table>
	</div>
	<div class="pts-row">
		  <div class="pts-col-sm-6 pts-text-left">{{ pagination }}</div>
		  <div class="pts-col-sm-6 pts-text-right">{{ results }}</div>
	</div>
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
 <script type="text/javascript"><!--
$('#pts-button-filter').on('click', function() {
	url = 'index.php?route=extension/account/purpletree_multivendor/sellerorder';
	
	var filter_order_status = $('select[name=\'filter_order_status\']').val();

	if (filter_order_status != '*') {
		url += '&filter_order_status=' + encodeURIComponent(filter_order_status);
	}

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

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

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

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

	location = url;
});
//--></script>
<script src="admin/view/javascript/jquery/datetimepicker/moment/moment.min.js" type="text/javascript"></script>
<script src="admin/view/javascript/jquery/datetimepicker/moment/moment-with-locales.min.js" type="text/javascript"></script>
<script src="admin/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<link href="admin/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
  <script type="text/javascript"><!--
$('.date').datetimepicker({
	pickTime: false
});
//--></script>
{{ footer }}