{{ header }}{{ column_left }}
<div id="content">
  {# <div class="page-header">
   <div class="container-fluid">
           <div class="pull-right touragain">
            <a data-toggle="tooltip" title="Display Promotions Using Add Offers Page" class="btn btn-primary addoffers" target="_blank" href="{{ addoffers }}"><i class="fa fa-star"></i> {{ text_addoffers }}</a>
            <a data-toggle="tooltip" title="Learn how to use this combination" class="btn btn-primary documentation" target="_blank" href="http://blog.cartbinder.com/documentation/buy-x-products-and-get-y-offer-on-same-products/"><i class="fa fa-book"></i> Documentation</a>
            <a data-toggle="tooltip" title="Need help, create a ticket" class="btn btn-primary support" target="_blank" href="http://support.cartbinder.com/open.php"><i class="fa fa-life-ring"></i> Support Center</a>
         </div>
    </div>
    </div>#}
  <div class="page-header">
    <div class="container-fluid">
          <h2>{{ heading_title }}</h2><br>
          <medium><i>{{ headerinfo2 }}</i></medium>
    </div>
  </div>
    <div class="page-header">
   <div class="container-fluid">
      <div class="pull-right">
         
       {% if licensed_md5 == 'd9a22d7a8178d5b42a8750123cbfe5b1' %}
       <a href="{{ insert }}" class="btn btn-success newoffer"><i class="fa fa-plus"></i> Insert New Offer</a>
        {% endif %}
        
        <a onclick="$('#form').submit();" class="btn btn-danger delete"><i class="fa fa-trash-o"></i> Delete</a>
         
      </div>
    </div>
  </div>
  <div class="container-fluid">
    <!-- {% if support_status == 'enabled' %}
        <div class="table-responsive">
          <table id="order_details" class="table table-bordered table-striped">
            <tbody>
            <tr>
              <td style="width:7%;background: #8e8e8e;color: white;">License Info</td>
              <td style="width:5%;background: #efefef;">Order Id</td>
              <td>{{ support_order_id }}</td>
              <td style="width:4%;background: #efefef;">Domain</td>
              <td>{{ domain }}</td>
              <td style="width:8%;background: #efefef;">Registered To</td>
              <td>{{ support_email }}</td>
              <td style="width:7%;background: #efefef;">Registered</td>
              <td>{{ support_registered_date }}</td>
              <td style="width:7%;background: #efefef;">Support Ends</td>
              <td>{{ support_order_date }}</td>
            </tr>
            </tbody>
            <tfooter>
              <tr>
                <td colspan="11" class="text-center">{{ text_free_support_remaining }}</td>
              </tr>
            </tfooter>
          </table>
        </div>
      {% else %}
       <div class="table-responsive">
          <table id="order_details" class="table table-bordered table-striped">
            <tfooter>
              <tr>
                <td class="text-center">{{ text_free_support_remaining }}</td>
              </tr>
            </tfooter>
          </table>
        </div>
        {% endif %} -->
    {% 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 %}
    {% if success %}
    <div class="alert alert-success"><i class="fa fa-check-circle"></i> {{ success }}
      <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 offerlist"><i class="fa fa-list"></i> {{ headerinfo }}</h3>
        </div>
           <div class="panel-body">
              <div class="well">
              <div class="row">
                <div class="col-sm-12">
                  <div class="col-sm-4">
                    <div class="form-group">
                      <label class="control-label" for="input-name">{{ text_name }}</label>
                      <input type="text" name="filter_name" value="{{ filter_name }}" class="form-control" />
                    </div>
                  </div>
                  <div class="col-sm-4">
                    <div class="form-group">
                      <label class="control-label" for="input-status">{{ text_status }}</label>
                      <select name="filter_status" id="input-status" class="form-control">
                        <option value="*"></option>
                        {% if filter_status == '1' %}
                        <option value="1" selected="selected">{{ text_enabled }}</option>
                        {% else %}
                        <option value="1">{{ text_enabled }}</option>
                        {% endif %}
                        {% if filter_status == '0' %}
                        <option value="0" selected="selected">{{ text_disabled }}</option>
                        {% else %}
                        <option value="0">{{ text_disabled }}</option>
                        {% endif %}
                      </select>
                    </div>
                  </div>
                </div>
                <div class="col-sm-12">
                    <div class="col-sm-4 pull-right">
                    <button type="button" id="button-filter" onclick="filter();" class="btn btn-primary pull-right filter"><i class="fa fa-search"></i> {{ button_filter }}</button>
                  </div>
                </div>
              </div>
            </div>

       {% if licensed_md5 == 'd9a22d7a8178d5b42a8750123cbfe5b1' %}
        
             <form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form">
            <div class="table-responsive">
            <table class="table table-bordered table-hover">
            <thead>
            <tr>
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\').attr('checked', this.checked);" /></td>
              <td class="text-center offername">{% if sort == 'name' %}
                <a href="{{ sort_name }}" class="<?php echo order|lower }}">{{ text_name }}</a>
                {% else %}
                <a href="{{ sort_name }}">{{ text_name }}</a>
                {% endif %}</td>
              <td class="text-center productstoadd">{{ text_productstoadd }}</td>
              <td class="text-center primaryquantity">{{ text_primaryquantity }}</td>
              <td class="text-center secondaryquantity">{{ text_secondaryquantity }}</td>
              <td class="text-center type">{{ text_type }}</td>
              <td class="text-center discountlist">{{ text_discountlist }}</td>
              <td class="text-center multidiscount">Multi Discount</td>
              <td class="text-center total">{{ text_total }}</td>
              <td class="text-center offersapplied">{{ text_offersapplied }}</td>
              <td class="text-center status">{% if sort == 'status' %}
                <a href="{{ sort_status }}" class="<?php echo order|lower }}">{{ text_status }}</a>
                {% else %}
                <a href="{{ sort_status }}">{{ text_status }}</a>
                {% endif %}</td>
              <td class="text-center action">{{ column_action }}</td>
            </tr>
          </thead>
        <tbody>

          {% if cartbindercombo1as %}
          {% for cartbindercombo1a in cartbindercombo1as %}
          <tr>
            <td style="text-align: center;">
              <input type="checkbox" name="selected[]" value="{{ cartbindercombo1a.id }}"/>
             </td>
            <td class="text-center"><h4><b>{{ cartbindercombo1a.name }}</b></h4></td>
            <td class="text-center">{{ cartbindercombo1a.primaryproducts }}</td>
            <td class="text-center">{{ cartbindercombo1a.primaryquant }}</td>
            <td class="text-center">{{ cartbindercombo1a.secondaryquant }}</td>
            <td class="text-center">{{ cartbindercombo1a.type }}</td>
            <td class="text-center">{{ cartbindercombo1a.discount }}</td>
            <td class="text-center">{{ cartbindercombo1a.multidiscount }}</td>
            <td class="text-center">{{ cartbindercombo1a.total }}</td>
            <td class="text-center">{{ cartbindercombo1a.offersapplied }}</td>
            <td class="text-center">{{ cartbindercombo1a.status }}</td>
            <td class="text-center">{% for action in cartbindercombo1a.action %}
            <a href="{{ action.href }}" class="btn btn-primary"><i class="fa fa-pencil"></i> {{ action.text }}</a>
              {% endfor %}</td>
          </tr>
          {% endfor %}
          {% else %}
          <tr>
            <td class="text-center" colspan="12">{{ text_no_results }}</td>
          </tr>
          {% endif %}
        </tbody>
      </table>
    </div>
      </form>

        {% endif %}
        {% if licensed=='none' %}
    {{ license_purchase_thanks }}
    {% if regerror is defined and regerror %} {{ regerror_quote_msg }} {% endif %}
    {% if regerror is defined and regerror %} <p style="color:red;">Error msg: {{ regerror }}</p>{% endif %}
      <h2>{{ license_registration }}</h2>
      <form name="reg" method="post" action="{{ oc_licensing_home }}register.php" id="reg" class="form-horizontal">
          <div class="form-group">
              <label class="col-sm-2 control-label" for="opencart_email">{{ license_opencart_email }}</label>
              <div class="col-sm-10">
                <input name="opencart_email" type="text" autofocus required id="opencart_email" form="reg" class="form-control">
              </div>
            {% if emailmal is defined and emailmal and regerror == 'emailmal' %}<p style="color:red;">{{ check_email }}</p>{% endif %}
          <div class="form-group">
              <label class="col-sm-2 control-label" for="order_id">{{ license_opencart_orderid }}</label>
              <div class="col-sm-10">
                <input name="order_id" type="text" autofocus required id="order_id" form="reg" class="form-control">
              </div>
            </div>
            {% if regerror is defined and regerror == 'orderid' %}<p style="color:red;">{{ check_orderid }}</p>{% endif %}
          <div class="form-group">
            <div class="col-sm-12">
              <button type="submit" form="reg" data-toggle="tooltip" title="{{ license_registration }}" class="btn btn-primary"><i class="fa fa-save"></i></button><input name="extension_id" type="hidden" id="extension_id" form="reg" value="{{ extension_id }}"><input type="hidden" name="aurl" value="{{ aurl }}" form="reg"><input type="hidden" name="auri" value="{{ auri }}"></div>
          </div>
    </form>
    {% endif %}
    {% if licensed == 'curl' %}
    {{ server_error_curl }}
    {% endif %}
        
  <div class="pagination">{{ pagination }}</div>
  </div>
</div>
<script type="text/javascript"><!--
function filter() {
  url = 'index.php?route=extension/module/cartbindercombo1a&user_token={{ user_token }}';

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

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

  var filter_status = $('select[name=\'filter_status\']').val();

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


  location = url;
}
</script>
<script type="text/javascript"><!--
$('.well input').keydown(function(e) {
  if (e.keyCode == 13) {
    filter();
  }
});</script>

<script type="text/javascript">
$('input[name=\'filter_name\']').autocomplete({
  'source': function(request, response) {
    $.ajax({
      url: 'index.php?route=extension/module/cartbindercombo1a/autocomplete&user_token={{ user_token }}&filter_name=' +  encodeURIComponent(request),
      dataType: 'json',
      success: function(json) {
        response($.map(json, function(item) {
          return {
            label: item.name,
            value: item.id
          }
        }));
      }
    });
  },
  'select': function(item) {
    $('input[name=\'filter_name\']').val(item.label);
  }
});
</script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' async rel='stylesheet' type='text/css'>
{{ footer }}
