{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-tier" 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 alert-dismissible"><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_form }}</h3>
      </div>
      <div class="panel-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-tier" class="form-horizontal">
            <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-title">{{ entry_title }}</label>
            <div class="col-sm-10">
              <input type="text" name="title" value="{{ title }}" placeholder="{{ entry_title }}" id="input-title" class="form-control" />
              {% if error_title %}
              <div class="text-danger">{{ error_title }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-description">{{ entry_description }}</label>
            <div class="col-sm-10">
              <input type="text" name="description" value="{{ description }}" placeholder="{{ entry_description }}" id="input-description" class="form-control" />
              {% if error_description %}
              <div class="text-danger">{{ error_description }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-bg_image">{{ entry_bg_image }}</label>
            <div class="col-sm-10"><a href="" id="thumb-bg_image" data-toggle="image" class="img-thumbnail"><img src="{{ bg_thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
              <input type="hidden" name="bg_image" value="{{ bg_image }}" id="input-bg_image" />
            </div>
          </div>
          <div class="form-group">
          <label class="col-sm-2 control-label" for="input-bg_color">{{ entry_bg_color }}</label>
            <div class="col-sm-10">
              <input type="text" id="bgColor" name="bg_color" value="{{ bg_color }}" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-card_image">{{ entry_card_image }}</label>
            <div class="col-sm-10"><a href="" id="thumb-card_image" data-toggle="image" class="img-thumbnail"><img src="{{ card_thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
              <input type="hidden" name="card_image" value="{{ card_image }}" id="input-card_image" />
            </div>
          </div>
          <div class="form-group">
          <label class="col-sm-2 control-label" for="input-font_color">{{ entry_font_color }}</label>
            <div class="col-sm-10">
              <input type="text" id="fontColor" name="font_color" value="{{ font_color }}" />
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-term_and_condition">{{ entry_tnc }}</label>
            <div class="col-sm-10">
              <textarea rows="5" cols="40" name="term_and_condition" 
              value="{{ term_and_condition }}" placeholder="{{ entry_tnc }}"
               id="input-term_and_condition" class="form-control">{{term_and_condition}}</textarea>         
              {% if error_tnc %}
              <div class="text-danger">{{ error_tnc }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-achieve_tier_amount"><span data-toggle="tooltip" title="{{ help_achieve_tier_amount }}">{{ entry_achieve_tier_amount }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="achieve_tier_amount" value="{{ achieve_tier_amount }}" placeholder="{{ entry_achive_tier_amount }}" id="input-achieve_tier_amount" class="form-control" />
              {% if error_achieve_tier_amount %}
              <div class="text-danger">{{ error_achieve_tier_amount }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-maintain_tier_type"><span data-toggle="tooltip" title="{{ help_maintain_tier_type }}">{{ entry_maintain_tier_type }}</span></label>
            <div class="col-sm-10">
                <select name="maintain_tier_type_id" id="input-maintain_tier_type" class="form-control">
                {% if maintain_tier_type_id == 2 %}
                <option value="1">{{ text_cash }}</option>
                <option value="2" selected="selected">{{ text_point }}</option>
                {% else %}
                <option value="1" selected="selected">{{ text_cash }}</option>
                <option value="2">{{ text_point }}</option>
                {% endif %}
              </select>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-maintain_tier_amount"><span data-toggle="tooltip" title="{{ help_maintain_tier_amount }}">{{ entry_maintain_tier_amount }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="maintain_tier_amount" value="{{ maintain_tier_amount }}" placeholder="{{ entry_maintain_tier_amount }}" id="input-maintain_tier_amount" class="form-control" />
              {% if error_maintain_tier_amount %}
              <div class="text-danger">{{ error_maintain_tier_amount}}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-multiply_regular_item"><span data-toggle="tooltip" title="{{ help_multiply_regular_item }}">{{ entry_multiply_regular_item }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="multiply_regular_item" value="{{ multiply_regular_item }}" placeholder="{{ entry_multiply_regular_item }}" id="input-multiply_regular_item" class="form-control" />
              {% if error_multiply_regular_item %}
              <div class="text-danger">{{ error_multiply_regular_item}}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-multiply_sales_item"><span data-toggle="tooltip" title="{{ help_multiply_sales_item }}">{{ entry_multiply_sales_item }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="multiply_sales_item" value="{{ multiply_sales_item }}" placeholder="{{ entry_multiply_sales_item }}" id="input-multiply_sales_item" class="form-control" />
              {% if error_multiply_sales_item %}
              <div class="text-danger">{{ error_multiply_sales_item}}</div>
              {% endif %}
            </div>
          </div>
           <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-point_expiry">{{ entry_point_expiry}}</label>
            <div class="col-sm-10">
              <input type="text" name="point_expiry" value="{{ point_expiry }}" placeholder="{{ entry_point_expiry }}" id="input-point_expiry" class="form-control" />
              {% if error_point_expiry %}
              <div class="text-danger">{{ error_point_expiry}}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-tier_expiry">{{ entry_tier_expiry}}</label>
            <div class="col-sm-10">
              <input type="text" name="tier_expiry" value="{{ tier_expiry }}" placeholder="{{ entry_tier_expiry }}" id="input-tier_expiry" class="form-control" />
              {% if error_tier_expiry %}
              <div class="text-danger">{{ error_tier_expiry}}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-is_hidden"><span data-toggle="tooltip" title="{{ help_is_hidden }}">{{ entry_is_hidden }}</span></label>
            <div class="col-sm-10">
              <select name="is_hidden" id="input-is_hidden" class="form-control">
                {% if is_hidden %}
                <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-status">{{ entry_status }}</label>
            <div class="col-sm-10">
              <select name="status" id="input-status" class="form-control">
                {% if status %}
                <option value="0">{{ text_disabled }}</option>
                <option value="1" selected="selected">{{ text_enabled }}</option>
                {% else %}
                <option value="0" selected="selected">{{ text_disabled }}</option>
                <option value="1">{{ text_enabled }}</option>
                {% endif %}
              </select>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }} 

<script>
$(document).ready(function() {
    $('#bgColor').spectrum({
        preferredFormat: 'hex',
        showInput: true,
        showInitial: true,
        showPalette: true,
        palette: [
            ['#ff0000', '#00ff00', '#0000ff'],
            ['#000000', '#ffffff']
        ],
        allowEmpty: true, // Allow an empty value (transparent)
        showAlpha: true, // Show alpha channel (transparency)
        emptyText: 'Transparent' // Text to display for empty value
    });

     $('#fontColor').spectrum({
        preferredFormat: 'hex',
        showInput: true,
        showInitial: true,
        showPalette: true,
        palette: [
            ['#ff0000', '#00ff00', '#0000ff'],
            ['#000000', '#ffffff']
        ],
        allowEmpty: true, // Allow an empty value (transparent)
        showAlpha: true, // Show alpha channel (transparency)
        emptyText: 'Transparent' // Text to display for empty value
    });
});
</script>