{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-member-point" data-toggle="tooltip" 
        title="{{ button_save }}" class="btn btn-primary" 
       {% set currentDateTime = "now"|date("Y-m-d") %}
       {% if (member_point_id and expiry_date <=  currentDateTime) or is_cancelled %}
                disabled
       {% endif %}>
        <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-member-point" class="form-horizontal">
           <fieldset>
           <legend>Member Info</legend>
           <div class="form-group">
               <label class="col-sm-2 control-label">{{ entry_phone_no }}:</label>
               <div class="col-sm-10">
                  <label>{{phone_no}} </label>  
                  <input type="hidden" id="member_id" name="member_id" value={{member_id}}>
                   {% if member_point_id %}
                    <input type="hidden" id="member_point_id" name="member_point_id" value={{member_point_id}}>
                   {% endif %}
               </div>
           </div>
           <div class="form-group">
               <label class="col-sm-2 control-label">{{ entry_email }}:</label>
               <div class="col-sm-10">
                  <label>{{email}} </label>
               </div>
           </div>
           <div class="form-group">
              <label class="col-sm-2 control-label">{{ entry_tier_level }}:</label>
              <div class="col-sm-10">
              <label>  {{tier_level}} </label>
              </div>
            </div>
        </fieldset>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-order_no">{{ entry_order_no }}</label>
            <div class="col-sm-10">
             {% if member_point_id %}
               <label> {{order_no}} </label>
             {% else %}
                <input type="text" name="order_no" value="{{ order_no }}" placeholder="{{ entry_order_no }}" id="input-order_no" class="form-control" />
                {% if error_order_no %}
                <div class="text-danger">{{ error_order_no}}</div>
                {% endif %}
             {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-regular_price_amount">{{ entry_regular_price_amount}}</label>
            <div class="col-sm-10">
            {% if member_point_id %}
               <label> {{regular_price_amount}} </label>
            {% else %}
                <input type="text" name="regular_price_amount" value="{{ regular_price_amount }}" placeholder="{{ entry_regular_price_amount }}" id="input-regular_price_amount" class="form-control" />
                {% if error_regular_price_amount %}
                <div class="text-danger">{{ error_regular_price_amount }}</div>
                {% endif %}
            {% endif %}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-sales_price_amount">{{ entry_sales_price_amount}}</label>
            <div class="col-sm-10">
              {% if member_point_id %}
                <label> {{sales_price_amount}} </label>
              {% else %}
                <input type="text" name="sales_price_amount" value="{{ sales_price_amount }}" placeholder="{{ entry_sales_price_amount }}" id="input-regular_price_amount" class="form-control" />
                {% if error_sales_price_amount %}
                <div class="text-danger">{{ error_sales_price_amount }}</div>
                {% endif %}
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-expiry_date">{{ entry_expiry_date }}</label>
            <div class="col-sm-4 date" style="display: table">
              {% if member_point_id %}
                <label> {{expiry_date}} </label>
              {% else %}
                <input type="text" name="expiry_date" value="{{ expiry_date }}" placeholder="{{ entry_expiry_date }}" data-date-format="YYYY-MM-DD" id="input-expiry_date" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                {% if error_expiry_date %}
                <div class="text-danger">{{ error_expiry_date }}</div>
                {% endif %}
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-remark">{{ entry_remark }}</label>
            <div class="col-sm-4" >
              <input type="text" name="remark" value="{{ remark }}" placeholder="{{ entry_remark }}"  id="input-remark" class="form-control"
               {% if (member_point_id and expiry_date <=  currentDateTime) or is_cancelled  %}
                disabled
               {% endif %}
               />
              {% if error_remark %}
              <div class="text-danger">{{ error_remark }}</div>
              {% endif %}
            </div>
          </div>
           {% if member_point_id %}
           <div class="form-group">
            <label class="col-sm-2 control-label" for="input-is_cancelled"><span data-toggle="tooltip" title="{{ help_is_cancelled }}">{{ entry_is_cancelled }}</span></label>
            <div class="col-sm-2">
              <select name="is_cancelled" id="input-is_cancelled" class="form-control"
               {% if (member_point_id and expiry_date <=  currentDateTime) or is_cancelled  %}
                disabled
               {% endif %}
              >
                {% if is_cancelled %}
                <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">{{ entry_point}}</label>
            <div class="col-sm-2">
                <label>{{point}}</label>
            </div>
            </div>
            <div class="form-group">
            <label class="col-sm-2 control-label">{{ entry_available_point }}</label>
            <div class="col-sm-2">
                <label>{{available_point}}</label>
            </div>
            </div>
            <div class="form-group">
            <label class="col-sm-2 control-label">{{ entry_used_point }}</label>
            <div class="col-sm-2">
                <label>{{used_point}}</label>
            </div>
            </div>
          {% endif %}
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }} 
<style type="text/css">
label{
    display: block;
    width: 100%;
    height: 36px;
    padding: 8px 13px;
    font-size: 13px;
    color: #555;
}
</style>
  <script type="text/javascript">
    $('.date').datetimepicker({
		language: '{{ datepicker }}',
		pickTime: false
    });
</script>