{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-reward" 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-reward" class="form-horizontal">
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-reward-type"><span data-toggle="tooltip" title="{{ help_reward_type }}">{{ entry_reward_type }}</span></label>
            <div class="col-sm-10">
              <select name="reward_type_id" id="input-reward-type" class="form-control">
                {% for reward_type in reward_types %}
                {% if reward_type.reward_type_id == reward_type_id %}
                <option value="{{ reward_type.reward_type_id }}" selected="selected">{{ reward_type.reward_type_name }}</option>
                {% else %}
                <option value="{{ reward_type.reward_type_id }}">{{ reward_type.reward_type_name }}</option>
                {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
          <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">
            <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" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-image">{{ entry_image }}</label>
            <div class="col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="{{ thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
              <input type="hidden" name="image" value="{{ image }}" id="input-image" />
            </div>
          </div>
          <div class="form-group">
            <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>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-point"><span data-toggle="tooltip" title="{{ help_point }}">{{ entry_point }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="point" value="{{ point }}" placeholder="{{ entry_point }}" id="input-point" class="form-control" />
              {% if error_point %}
              <div class="text-danger">{{ error_point }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-value"><span data-toggle="tooltip" title="{{ help_value }}">{{ entry_value }}</span></label>
            <div class="col-sm-10">
              <input type="text" name="value" value="{{ value }}" placeholder="{{ entry_value }}" id="input-value" class="form-control" />
              {% if error_value %}
              <div class="text-danger">{{ error_value }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-min-tier"><span data-toggle="tooltip" title="{{ help_min_tier }}">{{ entry_min_tier }}</span></label>
            <div class="col-sm-10">
              <select name="min_tier" id="input-min-tier" class="form-control">
                {% for min_tier in min_tiers %}
                {% if min_tier.tier_setting_id == min_tier %}
                <option value="{{ min_tier.tier_setting_id }}" selected="selected">{{ min_tier.tier_setting_name }}</option>
                {% else %}
                <option value="{{ min_tier.tier_setting_id }}">{{ min_tier.tier_setting_name }}</option>
                {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-value">{{ entry_expiry }}</label>
            <div class="col-sm-10">
              <input type="text" name="expiry" value="{{ expiry }}" placeholder="{{ entry_expiry }}" id="input-expiry" class="form-control" />
              {% if error_expiry %}
              <div class="text-danger">{{ error_expiry }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-redemption-environment"><span data-toggle="tooltip" title="{{ help_redemption_env }}">{{ entry_redemption_env }}</span></label>
            <div class="col-sm-10">
              <select name="redemption_environment_id" id="input-redemption-environment" class="form-control">
                {% for redemption_environment in redemption_environments %}
                {% if redemption_environment.redemption_environment_id == redemption_environment_id %}
                <option value="{{ redemption_environment.redemption_environment_id }}" selected="selected">{{ redemption_environment.redemption_environment_name }}</option>
                {% else %}
                <option value="{{ redemption_environment.redemption_environment_id }}">{{ redemption_environment.redemption_environment_name }}</option>
                {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-start-date">{{ entry_start_date }}</label>
            <div class="col-sm-3">
              <div class="input-group date">
                <input type="text" name="start_date" value="{{ start_date }}" 
                placeholder="{{ entry_start_date }}" data-date-format="YYYY-MM-DD" 
                id="input-date-start" class="form-control"
                {% set currentDateTime = "now"|date("Y-m-d") %}
                {% if reward_setting_id and start_date <=   currentDateTime %}
                readonly
                {% endif %}
                 />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"
                {% if reward_setting_id and start_date <=   currentDateTime %}
                disabled
                {% endif %}
                ><i class="fa fa-calendar"></i></button>
                </span></div>
                {% if error_start_date %}
                <div class="text-danger">{{ error_start_date }}</div>
                {% endif %}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-end-date">{{ entry_end_date }}</label>
            <div class="col-sm-3">
              <div class="input-group date">
                <input type="text" name="end_date" value="{{ end_date }}" placeholder="{{ entry_end_date }}" data-date-format="YYYY-MM-DD" id="input-end_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>
                {% if error_end_date %}
                <div class="text-danger">{{ error_end_date }}</div>
                {% endif %}
            </div>
          </div>
           <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-assignment_type"><span data-toggle="tooltip" title="{{ help_assignment_type }}">{{ entry_assignment_type }}</span></label>
            <div class="col-sm-10">
              <select name="assignment_type_id" id="input-assignment_type_id" class="form-control">
                {% for assignment_type in assignment_types %}
                {% if assignment_type.assignment_type_id == assignment_type_id %}
                <option value="{{ assignment_type.assignment_type_id }}" selected="selected">{{ assignment_type.assignment_type_name }}</option>
                {% else %}
                <option value="{{ assignment_type.assignment_type_id }}">{{ assignment_type.assignment_type_name }}</option>
                {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
          <div class="form-group required">
            <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>
  <script type="text/javascript"><!--
$('.date').datetimepicker({
	language: '{{ datepicker }}',
	pickTime: false
});
//--></script>
</div>
{{ footer }} 