{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-tracking-discount" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <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"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
      <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-pencil"></i> {{ text_edit }}</h3>
      </div>
      <div class="panel-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-tracking-discount" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-amount">{{ entry_amount }}</label>
            <div class="col-sm-10">
              <input type="text" name="tracking_discount_amount" value="{{ tracking_discount_amount }}" placeholder="{{ entry_amount }}" id="input-amount" class="form-control" size="8" />
            </div>
          </div>
          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-type">{{ entry_type }}</label>
            <div class="col-sm-10">
              <select name="tracking_discount_type" id="input-type" class="form-control">
                                {% if tracking_discount_type == 'percent' %}
                                    <option value="percent" selected="selected">{{ text_percent }}</option>
                                    <option value="fixed">{{ text_fixed }}</option>
                                {% else %}
                                    <option value="percent">{{ text_percent }}</option>
                                    <option value="fixed" selected="selected">{{ text_fixed }}</option>
                                {% endif %}
              </select>
            </div>
          </div>		  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-fixed-max"><span data-toggle="tooltip" title="{{ help_fixed_max }}">{{ entry_fixed_max }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="tracking_discount_fixed_max" value="{% if tracking_discount_fixed_max %}{{ tracking_discount_fixed_max }}{% else %}50{% endif %}" placeholder="50" id="input-fixed-max" class="form-control" size="8" />
            </div>
          </div>
          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-fixed-per-item"><span data-toggle="tooltip" title="{{ help_fixed_per_item }}">{{ entry_fixed_per_item }}</span></label>
            <div class="col-sm-10">
              <select name="tracking_discount_fixed_per_item" id="input-fixed-per-item" class="form-control">
                                {% if tracking_discount_fixed_per_item %}
                                    <option value="0">{{ text_no }}</option>
                                    <option value="1" selected="selected">{{ text_yes }}</option>
                                {% else %}
                                    <option value="0" selected="selected">{{ text_no }}</option>								
                                    <option value="1">{{ text_yes }}</option>
                                {% endif %}
              </select>
            </div>
          </div>	

          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-apply-to">{{ entry_apply_to }}</label>
            <div class="col-sm-10">
              <select name="tracking_discount_apply_to" id="input-apply-to" class="form-control">
				<option value="a"{% if not tracking_discount_apply_to or tracking_discount_apply_to == 'a' %} selected="selected"{% endif %}>{{ text_affiliates }}</option>
				<option value="m"{% if tracking_discount_apply_to == 'm' %} selected="selected"{% endif %}>{{ text_marketing_campaigns }}</option>				
				<option value="am"{% if tracking_discount_apply_to == 'am' %} selected="selected"{% endif %}>{{ text_both }}</option>
              </select>
            </div>
          </div>
		  
          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-when"><span data-toggle="tooltip" title="{{ help_when }}">{{ entry_when }}</span></label>
            <div class="col-sm-10">
              <select name="tracking_discount_when" id="input-when" class="form-control">
		{% if tracking_discount_when == 'all' %}
	                <option value="all" selected="selected">{{ text_when_all }}</option>
                {% else %}
	                <option value="all">{{ text_when_all }}</option>
                {% endif %}
		{% if tracking_discount_when == 'first' %}
	                <option value="first" selected="selected">{{ text_when_first }}</option>
                {% else %}
	                <option value="first">{{ text_when_first }}</option>
                {% endif %}
		{% if tracking_discount_when == 'period' %}
	                <option value="period" selected="selected">{{ text_when_period }}</option>
                {% else %}
	                <option value="period">{{ text_when_period }}</option>
                {% endif %}
              </select>
            </div>
          </div>		  		  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-period"><span data-toggle="tooltip" title="{{ help_period }}">{{ entry_period }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="tracking_discount_period" value="{{ tracking_discount_period }}" placeholder="7" id="input-period" class="form-control" size="8" />
            </div>
          </div>
          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-what"><span data-toggle="tooltip" title="{{ help_what }}">{{ entry_what }}</span></label>
            <div class="col-sm-10">
              <select name="tracking_discount_what" id="input-what" class="form-control">
   		{% for what, whattext in whats %}
			{% if tracking_discount_what == what %}
                         	<option value="{{ what }}" selected="selected">{{ whattext }}</option>
			{% else %}
                                <option value="{{ what }}">{{ whattext }}</option>
			{% endif %}
		{% endfor %}
              </select>
            </div>
          </div>		  		  
          <div class="form-group">		  
            <label class="col-sm-2 control-label" for="input-no-coupon"><span data-toggle="tooltip" title="{{ help_no_coupon }}">{{ entry_no_coupon }}</span></label>
            <div class="col-sm-10">
              <select name="tracking_discount_no_coupon" id="input-no-coupon" class="form-control">
                                {% if not tracking_discount_no_coupon %}
                                    <option value="0" selected="selected">{{ text_yes }}</option>
                                    <option value="1">{{ text_no }}</option>
                                {% else %}
                                    <option value="0">{{ text_yes }}</option>
                                    <option value="1" selected="selected">{{ text_no }}</option>
                                {% endif %}
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
            <div class="col-sm-10">
              <select name="tracking_discount_status" id="input-status" class="form-control">
                {% if tracking_discount_status %}
                <option value="1" selected="selected">{{ text_enabled }}</option>
                <option value="0">{{ text_disabled }}</option>
                {% else %}
                <option value="1">{{ text_enabled }}</option>
                <option value="0" selected="selected">{{ text_disabled }}</option>
                {% endif %}
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-sort-order">{{ entry_sort_order }}</label>
            <div class="col-sm-10">
              <input type="text" name="tracking_discount_sort_order" value="{{ tracking_discount_sort_order }}" placeholder="2" id="input-sort-order" class="form-control" />
            </div>
          </div>		  
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }}
