<?php

/* extension/module/discount_customer_group.twig */
class __TwigTemplate_59ae4353637f2dbc143890d71393ff6aa7d2cc4e69dd0e007a7a9e3cbc143663 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo (isset($context["header"]) ? $context["header"] : null);
        echo (isset($context["column_left"]) ? $context["column_left"] : null);
        echo "
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"pull-right\">
        <a type=\"submit\" form=\"\" data-toggle=\"tooltip\" title=\"";
        // line 6
        echo (isset($context["button_save"]) ? $context["button_save"] : null);
        echo "\" class=\"btn btn-primary\" id=\"save-button\"><i class=\"fa fa-save\"></i></a>
        <a href=\"";
        // line 7
        echo (isset($context["cancel"]) ? $context["cancel"] : null);
        echo "\" data-toggle=\"tooltip\" title=\"";
        echo (isset($context["button_cancel"]) ? $context["button_cancel"] : null);
        echo "\" class=\"btn btn-default\"><i class=\"fa fa-reply\"></i></a></div>
      <h1>";
        // line 8
        echo (isset($context["heading_title"]) ? $context["heading_title"] : null);
        echo "</h1>
      <ul class=\"breadcrumb\">
        ";
        // line 10
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["breadcrumbs"]) ? $context["breadcrumbs"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["breadcrumb"]) {
            // line 11
            echo "        <li><a href=\"";
            echo $this->getAttribute($context["breadcrumb"], "href", array());
            echo "\">";
            echo $this->getAttribute($context["breadcrumb"], "text", array());
            echo "</a></li>
        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['breadcrumb'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 13
        echo "      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    ";
        // line 17
        if ((isset($context["error_warning"]) ? $context["error_warning"] : null)) {
            // line 18
            echo "    <div class=\"alert alert-danger\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo (isset($context["error_warning"]) ? $context["error_warning"] : null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 22
        echo "    ";
        if ((isset($context["success"]) ? $context["success"] : null)) {
            // line 23
            echo "    <div class=\"alert alert-success\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo (isset($context["success"]) ? $context["success"] : null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 27
        echo "    <div class=\"panel panel-default\">
      <div class=\"panel-heading\">
        <h3 class=\"panel-title\"><i class=\"fa fa-pencil\"></i> ";
        // line 29
        echo (isset($context["heading_title"]) ? $context["heading_title"] : null);
        echo "</h3>
      </div>
      <div class=\"panel-body\">
\t\t  \t<form method=\"post\" enctype=\"multipart/form-data\" id=\"form-settings\" class=\"form-horizontal\"> 
\t\t\t<div class=\"form-group\">
\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"input-status\">";
        // line 34
        echo (isset($context["entry_status"]) ? $context["entry_status"] : null);
        echo "</label>
\t\t\t\t<div class=\"col-sm-10\">
\t\t\t\t  <select name=\"total_customer_group_discount_status\" id=\"input-status\" class=\"setting form-control selectpicker\">
\t\t\t\t\t";
        // line 37
        if ((isset($context["customer_group_discount_status"]) ? $context["customer_group_discount_status"] : null)) {
            // line 38
            echo "\t\t\t\t\t<option value=\"1\" selected=\"selected\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
\t\t\t\t\t<option value=\"0\">";
            // line 39
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
\t\t\t\t\t";
        } else {
            // line 41
            echo "\t\t\t\t\t<option value=\"1\">";
            echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
            echo "</option>
\t\t\t\t\t<option value=\"0\" selected=\"selected\">";
            // line 42
            echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
            echo "</option>
\t\t\t\t\t";
        }
        // line 44
        echo "\t\t\t\t  </select>
\t\t\t\t</div>
\t\t\t</div>
\t\t\t<div class=\"form-group\">
\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"input-sort-order\">";
        // line 48
        echo (isset($context["entry_sort_order"]) ? $context["entry_sort_order"] : null);
        echo "</label>
\t\t\t\t<div class=\"col-sm-10\">
\t\t\t\t  <input type=\"text\" name=\"total_customer_group_discount_sort_order\" value=\"";
        // line 50
        echo (isset($context["customer_group_discount_sort_order"]) ? $context["customer_group_discount_sort_order"] : null);
        echo "\" placeholder=\"";
        echo (isset($context["entry_sort_order"]) ? $context["entry_sort_order"] : null);
        echo "\" id=\"input-sort-order\" class=\"setting form-control\" />
\t\t\t\t</div>
\t\t\t</div>
\t\t\t</form>
\t\t\t<form method=\"post\" enctype=\"multipart/form-data\" id=\"form-customer_group-discount\" class=\"form-horizontal\">  \t
              <div class=\"table-responsive\">
                <table id=\"discount\" class=\"table table-striped table-bordered table-hover\">
                  <thead>
                    <tr>
                      <td></td>\t
                      <td class=\"text-left col-md-2\">";
        // line 60
        echo (isset($context["entry_customer_group"]) ? $context["entry_customer_group"] : null);
        echo "</td>
                      <td class=\"text-left col-md-1\">";
        // line 61
        echo (isset($context["entry_priority"]) ? $context["entry_priority"] : null);
        echo "</td>
                      <td class=\"text-left col-md-2\">";
        // line 62
        echo (isset($context["entry_percentage"]) ? $context["entry_percentage"] : null);
        echo "</td>
                      <td class=\"text-left col-md-3\">";
        // line 63
        echo (isset($context["entry_date_start"]) ? $context["entry_date_start"] : null);
        echo "</td>
                      <td class=\"text-left col-md-3\">";
        // line 64
        echo (isset($context["entry_date_end"]) ? $context["entry_date_end"] : null);
        echo "</td>
                      <td class=\"text-left col-md-1\"></td>
                    </tr>
                  </thead>
                  <tbody>
                    ";
        // line 69
        $context["discount_row"] = 0;
        // line 70
        echo "                    ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["customer_group_discounts"]) ? $context["customer_group_discounts"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["customer_group_discount"]) {
            // line 71
            echo "                      <tr id=\"discount-row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\">
\t\t\t\t\t\t  <td>";
            // line 72
            if ($this->getAttribute($context["customer_group_discount"], "status", array())) {
                // line 73
                echo "\t\t\t\t\t\t\t\t<a  id=\"active-";
                echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                echo "\" onclick=\"";
                if ((isset($context["permission"]) ? $context["permission"] : null)) {
                    echo "deactivate(";
                    echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                    echo ");";
                }
                echo "\" class=\"btn btn-sm btn-success\" data-toggle=\"tooltip\" title=\"";
                echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
                echo "\">
\t\t\t\t\t\t\t\t<i class=\"fa fa-minus-circle fa-rotate-90 fa-2x\"></i>
\t\t\t\t\t\t\t\t</a>
\t\t\t\t\t\t\t\t<input name=\"customer_group_discount[";
                // line 76
                echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
                echo "][status]\" id=\"status";
                echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                echo "\" type=\"hidden\" value=\"1\">
\t\t\t\t\t\t\t\t";
            } else {
                // line 78
                echo "\t\t\t\t\t\t\t\t<a id=\"inactive-";
                echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                echo "\" onclick=\"";
                if ((isset($context["permission"]) ? $context["permission"] : null)) {
                    echo "activate(";
                    echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                    echo ");";
                }
                echo "\" class=\"btn btn-sm btn-danger\" data-toggle=\"tooltip\" title=\"";
                echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
                echo "\"><i class=\"fa fa-minus-circle fa-rotate-90 fa-2x\"></i></a>
\t\t\t\t\t\t\t\t<input name=\"customer_group_discount[";
                // line 79
                echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
                echo "][status]\" id=\"status";
                echo $this->getAttribute($context["customer_group_discount"], "customer_group_discount_id", array());
                echo "\" type=\"hidden\" value=\"0\">
\t\t\t\t\t\t\t\t";
            }
            // line 81
            echo "\t\t\t\t\t\t  </td>
\t\t\t\t\t\t  
\t\t\t\t\t\t  <td class=\"text-left\"><select name=\"customer_group_discount[";
            // line 83
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][customer_group_id]\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo " selectpicker\" data-live-search=\"true\">
\t\t\t\t\t\t\t  ";
            // line 84
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable((isset($context["customer_groups"]) ? $context["customer_groups"] : null));
            foreach ($context['_seq'] as $context["_key"] => $context["customer_group"]) {
                // line 85
                echo "\t\t\t\t\t\t\t  \t";
                if (($this->getAttribute($context["customer_group"], "customer_group_id", array()) == $this->getAttribute($context["customer_group_discount"], "customer_group_id", array()))) {
                    // line 86
                    echo "\t\t\t\t\t\t\t  <option value=\"";
                    echo $this->getAttribute($context["customer_group"], "customer_group_id", array());
                    echo "\" selected=\"selected\">";
                    echo $this->getAttribute($context["customer_group"], "name", array());
                    echo "</option>
\t\t\t\t\t\t\t  \t";
                } else {
                    // line 88
                    echo "\t\t\t\t\t\t\t  <option value=\"";
                    echo $this->getAttribute($context["customer_group"], "customer_group_id", array());
                    echo "\">";
                    echo $this->getAttribute($context["customer_group"], "name", array());
                    echo "</option>
\t\t\t\t\t\t\t \t";
                }
                // line 90
                echo "\t\t\t\t\t\t\t  ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customer_group'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 91
            echo "\t\t\t\t\t\t  </select></td>                     
\t\t\t\t\t\t  <td class=\"text-right\"><input type=\"text\" name=\"customer_group_discount[";
            // line 92
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][priority]\" value=\"";
            echo $this->getAttribute($context["customer_group_discount"], "priority", array());
            echo "\" placeholder=\"";
            echo (isset($context["entry_priority"]) ? $context["entry_priority"] : null);
            echo "\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\" /></td>
\t\t\t\t\t\t  <td class=\"text-left\"><input type=\"text\" name=\"customer_group_discount[";
            // line 93
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][percentage]\" value=\"";
            echo $this->getAttribute($context["customer_group_discount"], "percentage", array());
            echo "\" placeholder=\"";
            echo (isset($context["entry_percentage"]) ? $context["entry_percentage"] : null);
            echo "\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\" /></td>
\t\t\t\t\t\t  <td class=\"text-left\" style=\"width: 20%;\"><div class=\"input-group date\">
\t\t\t\t\t\t\t  <input type=\"text\" name=\"customer_group_discount[";
            // line 95
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][date_start]\" value=\"";
            echo $this->getAttribute($context["customer_group_discount"], "date_start", array());
            echo "\" placeholder=\"";
            echo (isset($context["entry_date_start"]) ? $context["entry_date_start"] : null);
            echo "\" data-date-format=\"YYYY-MM-DD\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\" />
\t\t\t\t\t\t\t  <span class=\"input-group-btn\">
\t\t\t\t\t\t\t  <button class=\"btn btn-default\" type=\"button\"><i class=\"fa fa-calendar\"></i></button>
\t\t\t\t\t\t\t  </span></div></td>
\t\t\t\t\t\t  <td class=\"text-left\" style=\"width: 20%;\"><div class=\"input-group date\">
\t\t\t\t\t\t\t  <input type=\"text\" name=\"customer_group_discount[";
            // line 100
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][date_end]\" value=\"";
            echo $this->getAttribute($context["customer_group_discount"], "date_end", array());
            echo "\" placeholder=\"";
            echo (isset($context["entry_date_end"]) ? $context["entry_date_end"] : null);
            echo "\" data-date-format=\"YYYY-MM-DD\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\" />
\t\t\t\t\t\t\t  <span class=\"input-group-btn\">
\t\t\t\t\t\t\t  <button class=\"btn btn-default\" type=\"button\"><i class=\"fa fa-calendar\"></i></button>
\t\t\t\t\t\t\t  </span></div></td>
\t\t\t\t\t\t  <td class=\"text-left\"><button type=\"button\" onclick=\"\$('#discount-row";
            // line 104
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "').remove();\" data-toggle=\"tooltip\" title=\"";
            echo (isset($context["button_remove"]) ? $context["button_remove"] : null);
            echo "\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button></td>
                      </tr>
                    \t";
            // line 106
            $context["discount_row"] = ((isset($context["discount_row"]) ? $context["discount_row"] : null) + 1);
            // line 107
            echo "\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customer_group_discount'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 108
        echo "                  </tbody>
                  <tfoot>
                    <tr>
                      <td colspan=\"6\"></td>
                      <td class=\"text-left\"><button type=\"button\" onclick=\"addDiscount();\" data-toggle=\"tooltip\" title=\"";
        // line 112
        echo (isset($context["button_add"]) ? $context["button_add"] : null);
        echo "\" class=\"btn btn-primary\"><i class=\"fa fa-plus-circle\"></i></button></td>
                    </tr>
                  </tfoot>
                </table>
              </div>
        </form>
        <a class=\"btn btn-default\" id=\"back-btn\" href=\"";
        // line 118
        echo (isset($context["back_link"]) ? $context["back_link"] : null);
        echo "\"> < Back</a>
      </div>
    </div>
  </div>
  <script type=\"text/javascript\"><!--
\t
\tvar discount_row = ";
        // line 124
        echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
        echo ";

\tfunction addDiscount() {
\t\thtml  = '<tr id=\"discount-row' + discount_row + '\">';
\t\thtml += '  <td><input name=\"customer_group_discount[' + discount_row + '][status]\" id=\"status' + discount_row + '\" type=\"hidden\" value=\"1\"></td>';
\t\thtml += '  <td class=\"text-left\"><select name=\"customer_group_discount[' + discount_row + '][customer_group_id]\" class=\"form-control selectpicker\" data-live-search=\"true\">';
\t\t";
        // line 130
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["customer_groups"]) ? $context["customer_groups"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["customer_group"]) {
            // line 131
            echo "\t\thtml += '    <option value=\"";
            echo $this->getAttribute($context["customer_group"], "customer_group_id", array());
            echo "\">";
            echo twig_escape_filter($this->env, $this->getAttribute($context["customer_group"], "name", array()), "js");
            echo "</option>';
\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customer_group'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 133
        echo "\t\thtml += '  </select></td>';\t\t\t
\t\thtml += '  <td class=\"text-left\"><input type=\"text\" name=\"customer_group_discount[' + discount_row + '][priority]\" value=\"\" placeholder=\"";
        // line 134
        echo (isset($context["entry_priority"]) ? $context["entry_priority"] : null);
        echo "\" class=\"form-control\" /></td>';
\t\thtml += '  <td class=\"text-left\"><input type=\"text\" name=\"customer_group_discount[' + discount_row + '][percentage]\" value=\"\" placeholder=\"";
        // line 135
        echo (isset($context["entry_percentage"]) ? $context["entry_percentage"] : null);
        echo "\" class=\"form-control\" /></td>';
\t\thtml += '  <td class=\"text-left\"><div class=\"input-group date\"><input type=\"text\" name=\"customer_group_discount[' + discount_row + '][date_start]\" value=\"\" placeholder=\"";
        // line 136
        echo (isset($context["entry_date_start"]) ? $context["entry_date_start"] : null);
        echo "\" data-date-format=\"YYYY-MM-DD\" class=\"form-control\" /><span class=\"input-group-btn\"><button type=\"button\" class=\"btn btn-default\"><i class=\"fa fa-calendar\"></i></button></span></div></td>';
\t\thtml += '  <td class=\"text-left\"><div class=\"input-group date\"><input type=\"text\" name=\"customer_group_discount[' + discount_row + '][date_end]\" value=\"\" placeholder=\"";
        // line 137
        echo (isset($context["entry_date_end"]) ? $context["entry_date_end"] : null);
        echo "\" data-date-format=\"YYYY-MM-DD\" class=\"form-control\" /><span class=\"input-group-btn\"><button type=\"button\" class=\"btn btn-default\"><i class=\"fa fa-calendar\"></i></button></span></div></td>';
\t\thtml += '  <td class=\"text-left\"><button type=\"button\" onclick=\"\$(\\'#discount-row' + discount_row + '\\').remove();\" data-toggle=\"tooltip\" title=\"";
        // line 138
        echo (isset($context["button_remove"]) ? $context["button_remove"] : null);
        echo "\" class=\"btn btn-danger\"><i class=\"fa fa-minus-circle\"></i></button></td>';
\t\thtml += '</tr>';\t
\t
\t\t\$('#discount tbody').append(html);

\t\t\$('.date').datetimepicker({
\t\t\tpickTime: false
\t\t});
\t\t
\t\t\$('.selectpicker').selectpicker({
\t\t  size: 'auto',
\t\t  container : 'body',
\t\t  dropdownAlignRight: 'auto',
\t\t  iconBase: 'fa',
      \t  tickIcon: 'fa-check',
\t\t  showTick: true
\t\t});
\t\t
\t\tdiscount_row++;
\t}
\t
\t
\t";
        // line 160
        if ((isset($context["permission"]) ? $context["permission"] : null)) {
            // line 161
            echo "\t\$('#save-button').click(function(){
\t\t
\t\t\$.ajax({
\t\t\turl:'index.php?route=extension/module/discounts_pack/discount_customer_group/saveDiscount&user_token=";
            // line 164
            echo (isset($context["user_token"]) ? $context["user_token"] : null);
            echo "',
\t\t\ttype: 'post',
\t\t\tdataType: 'json',
\t\t\tbeforeSend: function() {
\t\t\t\t\$('.alert').remove();
\t\t\t},
\t\t\tdata: {
\t\t\t\tsetting: \$(\"#form-settings\").serialize(),
\t\t\t\tcustomer_group_discount: \$('#form-customer_group-discount').serialize(),
\t\t\t},
\t\t\tsuccess: function(json) {
\t\t\t\talertJson('alert alert-success', json);
\t\t\t},
\t\t\terror: function(json) {
\t\t\t\talertJson('alert alert-warning', json);
\t\t\t}
\t\t});
\t\t
\t\treturn false;
\t});
\t";
        } else {
            // line 185
            echo "\t\t\$('#save-button').click(function(){
\t\t\t\$('.alert').remove();
\t\t\t
\t\t\t\$(\".panel\").before('<div class=\"alert alert-warning\">";
            // line 188
            echo (isset($context["error_permission"]) ? $context["error_permission"] : null);
            echo "</div>');
\t\t});
\t";
        }
        // line 191
        echo "\t
\tfunction alertJson(action, json) {
\t\t
\t\t\$('.alert').remove();
\t\t
\t\tif (json['success']) {
\t\t\t\$(\".panel\").before('<div class=\"' + action + '\">' + json['success'] + '</div>');
\t\t} else if (json['error']) {
\t\t\t\$(\".panel\").before('<div class=\"' + action + '\">' + json['error'] + '</div>');
\t\t}
\t\t
\t}
\t
\tfunction activate(row) {
\t\t
\t\t\$.ajax({
\t\t\turl:'index.php?route=extension/module/discounts_pack/discount_customer_group/activate&user_token=";
        // line 207
        echo (isset($context["user_token"]) ? $context["user_token"] : null);
        echo "',
\t\t\ttype: 'post',
\t\t\tdataType: 'json',
\t\t\tdata: {
\t\t\t\trow: row,
\t\t\t},
\t\t\tsuccess: function(json) {
\t\t\t\talertJson('alert alert-success', json);
\t\t\t\t\$('#inactive-' + row).replaceWith('<a  id=\"active-' + row + '\" onclick=\"";
        // line 215
        if ((isset($context["permission"]) ? $context["permission"] : null)) {
            echo "deactivate(' + row + ');";
        }
        echo "\" class=\"btn btn-sm btn-success\" data-toggle=\"tooltip\" title=\"";
        echo (isset($context["text_enabled"]) ? $context["text_enabled"] : null);
        echo "\"><i class=\"fa fa-minus-circle fa-rotate-90 fa-2x\"></i></a>');
\t\t\t\t\$('#status' + row).val(1);
\t\t\t},
\t\t\terror: function(json) {
\t\t\t\talertJson('alert alert-warning', json);
\t\t\t}
\t\t});
\t
\t}
\t
\tfunction deactivate(row) {
\t\t
\t\t\$.ajax({
\t\t\turl:'index.php?route=extension/module/discounts_pack/discount_customer_group/deactivate&user_token=";
        // line 228
        echo (isset($context["user_token"]) ? $context["user_token"] : null);
        echo "',
\t\t\ttype: 'post',
\t\t\tdataType: 'json',
\t\t\tdata: {
\t\t\t\trow: row,
\t\t\t},
\t\t\tsuccess: function(json) {
\t\t\t\talertJson('alert alert-success', json);
\t\t\t\t\$('#active-' + row).replaceWith('<a id=\"inactive-' + row + '\" onclick=\"";
        // line 236
        if ((isset($context["permission"]) ? $context["permission"] : null)) {
            echo "activate(' + row + ');";
        }
        echo "\" class=\"btn btn-sm btn-danger\" data-toggle=\"tooltip\" title=\"";
        echo (isset($context["text_disabled"]) ? $context["text_disabled"] : null);
        echo "\"><i class=\"fa fa-minus-circle fa-rotate-90 fa-2x\"></i></a>');
\t\t\t\t\$('#status' + row).val(0);
\t\t\t},
\t\t\terror: function(json) {
\t\t\t\talertJson('alert alert-warning', json);
\t\t\t}
\t\t});
\t
\t}
\t\$('.date').datetimepicker({
\t\tpickTime: false
\t});

\t\$('.time').datetimepicker({
\t\tpickDate: false
\t});

\t\$('.datetime').datetimepicker({
\t\tpickDate: true,
\t\tpickTime: true
\t});
\t
\t\$('.selectpicker').selectpicker({
\t  size: 'auto',
\t  container : 'body',
\t  dropdownAlignRight: 'auto',
\t  iconBase: 'fa',
      tickIcon: 'fa-check',
\t  showTick: true
\t});
//--></script></div>
";
        // line 267
        echo (isset($context["footer"]) ? $context["footer"] : null);
    }

    public function getTemplateName()
    {
        return "extension/module/discount_customer_group.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  568 => 267,  530 => 236,  519 => 228,  499 => 215,  488 => 207,  470 => 191,  464 => 188,  459 => 185,  435 => 164,  430 => 161,  428 => 160,  403 => 138,  399 => 137,  395 => 136,  391 => 135,  387 => 134,  384 => 133,  373 => 131,  369 => 130,  360 => 124,  351 => 118,  342 => 112,  336 => 108,  330 => 107,  328 => 106,  321 => 104,  308 => 100,  294 => 95,  283 => 93,  273 => 92,  270 => 91,  264 => 90,  256 => 88,  248 => 86,  245 => 85,  241 => 84,  235 => 83,  231 => 81,  224 => 79,  211 => 78,  204 => 76,  189 => 73,  187 => 72,  182 => 71,  177 => 70,  175 => 69,  167 => 64,  163 => 63,  159 => 62,  155 => 61,  151 => 60,  136 => 50,  131 => 48,  125 => 44,  120 => 42,  115 => 41,  110 => 39,  105 => 38,  103 => 37,  97 => 34,  89 => 29,  85 => 27,  77 => 23,  74 => 22,  66 => 18,  64 => 17,  58 => 13,  47 => 11,  43 => 10,  38 => 8,  32 => 7,  28 => 6,  19 => 1,);
    }
}
/* {{ header }}{{ column_left }}*/
/* <div id="content">*/
/*   <div class="page-header">*/
/*     <div class="container-fluid">*/
/*       <div class="pull-right">*/
/*         <a type="submit" form="" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary" id="save-button"><i class="fa fa-save"></i></a>*/
/*         <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 %}*/
/*     {% if success %}*/
/*     <div class="alert alert-success"><i class="fa fa-exclamation-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"><i class="fa fa-pencil"></i> {{ heading_title }}</h3>*/
/*       </div>*/
/*       <div class="panel-body">*/
/* 		  	<form method="post" enctype="multipart/form-data" id="form-settings" class="form-horizontal"> */
/* 			<div class="form-group">*/
/* 				<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>*/
/* 				<div class="col-sm-10">*/
/* 				  <select name="total_customer_group_discount_status" id="input-status" class="setting form-control selectpicker">*/
/* 					{% if customer_group_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="total_customer_group_discount_sort_order" value="{{ customer_group_discount_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="setting form-control" />*/
/* 				</div>*/
/* 			</div>*/
/* 			</form>*/
/* 			<form method="post" enctype="multipart/form-data" id="form-customer_group-discount" class="form-horizontal">  	*/
/*               <div class="table-responsive">*/
/*                 <table id="discount" class="table table-striped table-bordered table-hover">*/
/*                   <thead>*/
/*                     <tr>*/
/*                       <td></td>	*/
/*                       <td class="text-left col-md-2">{{ entry_customer_group }}</td>*/
/*                       <td class="text-left col-md-1">{{ entry_priority }}</td>*/
/*                       <td class="text-left col-md-2">{{ entry_percentage }}</td>*/
/*                       <td class="text-left col-md-3">{{ entry_date_start }}</td>*/
/*                       <td class="text-left col-md-3">{{ entry_date_end }}</td>*/
/*                       <td class="text-left col-md-1"></td>*/
/*                     </tr>*/
/*                   </thead>*/
/*                   <tbody>*/
/*                     {% set discount_row= 0 %}*/
/*                     {% for customer_group_discount in customer_group_discounts %}*/
/*                       <tr id="discount-row{{ discount_row }}">*/
/* 						  <td>{% if customer_group_discount.status %}*/
/* 								<a  id="active-{{ customer_group_discount.customer_group_discount_id }}" onclick="{% if permission %}deactivate({{ customer_group_discount.customer_group_discount_id }});{% endif %}" class="btn btn-sm btn-success" data-toggle="tooltip" title="{{ text_enabled }}">*/
/* 								<i class="fa fa-minus-circle fa-rotate-90 fa-2x"></i>*/
/* 								</a>*/
/* 								<input name="customer_group_discount[{{ discount_row }}][status]" id="status{{ customer_group_discount.customer_group_discount_id }}" type="hidden" value="1">*/
/* 								{% else %}*/
/* 								<a id="inactive-{{ customer_group_discount.customer_group_discount_id }}" onclick="{% if permission %}activate({{ customer_group_discount.customer_group_discount_id }});{% endif %}" class="btn btn-sm btn-danger" data-toggle="tooltip" title="{{ text_disabled }}"><i class="fa fa-minus-circle fa-rotate-90 fa-2x"></i></a>*/
/* 								<input name="customer_group_discount[{{ discount_row }}][status]" id="status{{ customer_group_discount.customer_group_discount_id }}" type="hidden" value="0">*/
/* 								{% endif %}*/
/* 						  </td>*/
/* 						  */
/* 						  <td class="text-left"><select name="customer_group_discount[{{ discount_row }}][customer_group_id]" class="form-control row{{ discount_row }} selectpicker" data-live-search="true">*/
/* 							  {% for customer_group in customer_groups %}*/
/* 							  	{% if customer_group.customer_group_id  ==  customer_group_discount.customer_group_id %}*/
/* 							  <option value="{{ customer_group.customer_group_id }}" selected="selected">{{ customer_group.name }}</option>*/
/* 							  	{% else %}*/
/* 							  <option value="{{ customer_group.customer_group_id }}">{{ customer_group.name }}</option>*/
/* 							 	{% endif %}*/
/* 							  {% endfor %}*/
/* 						  </select></td>                     */
/* 						  <td class="text-right"><input type="text" name="customer_group_discount[{{ discount_row }}][priority]" value="{{ customer_group_discount.priority }}" placeholder="{{ entry_priority }}" class="form-control row{{ discount_row }}" /></td>*/
/* 						  <td class="text-left"><input type="text" name="customer_group_discount[{{ discount_row }}][percentage]" value="{{ customer_group_discount.percentage }}" placeholder="{{ entry_percentage }}" class="form-control row{{ discount_row }}" /></td>*/
/* 						  <td class="text-left" style="width: 20%;"><div class="input-group date">*/
/* 							  <input type="text" name="customer_group_discount[{{ discount_row }}][date_start]" value="{{ customer_group_discount.date_start }}" placeholder="{{ entry_date_start }}" data-date-format="YYYY-MM-DD" class="form-control row{{ discount_row }}" />*/
/* 							  <span class="input-group-btn">*/
/* 							  <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>*/
/* 							  </span></div></td>*/
/* 						  <td class="text-left" style="width: 20%;"><div class="input-group date">*/
/* 							  <input type="text" name="customer_group_discount[{{ discount_row }}][date_end]" value="{{ customer_group_discount.date_end }}" placeholder="{{ entry_date_end }}" data-date-format="YYYY-MM-DD" class="form-control row{{ discount_row }}" />*/
/* 							  <span class="input-group-btn">*/
/* 							  <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>*/
/* 							  </span></div></td>*/
/* 						  <td class="text-left"><button type="button" onclick="$('#discount-row{{ discount_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>*/
/*                       </tr>*/
/*                     	{% set discount_row = discount_row + 1 %}*/
/* 					{% endfor %}*/
/*                   </tbody>*/
/*                   <tfoot>*/
/*                     <tr>*/
/*                       <td colspan="6"></td>*/
/*                       <td class="text-left"><button type="button" onclick="addDiscount();" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>*/
/*                     </tr>*/
/*                   </tfoot>*/
/*                 </table>*/
/*               </div>*/
/*         </form>*/
/*         <a class="btn btn-default" id="back-btn" href="{{ back_link }}"> < Back</a>*/
/*       </div>*/
/*     </div>*/
/*   </div>*/
/*   <script type="text/javascript"><!--*/
/* 	*/
/* 	var discount_row = {{ discount_row }};*/
/* */
/* 	function addDiscount() {*/
/* 		html  = '<tr id="discount-row' + discount_row + '">';*/
/* 		html += '  <td><input name="customer_group_discount[' + discount_row + '][status]" id="status' + discount_row + '" type="hidden" value="1"></td>';*/
/* 		html += '  <td class="text-left"><select name="customer_group_discount[' + discount_row + '][customer_group_id]" class="form-control selectpicker" data-live-search="true">';*/
/* 		{% for customer_group in customer_groups %}*/
/* 		html += '    <option value="{{ customer_group.customer_group_id }}">{{ customer_group.name|e('js') }}</option>';*/
/* 		{% endfor %}*/
/* 		html += '  </select></td>';			*/
/* 		html += '  <td class="text-left"><input type="text" name="customer_group_discount[' + discount_row + '][priority]" value="" placeholder="{{ entry_priority }}" class="form-control" /></td>';*/
/* 		html += '  <td class="text-left"><input type="text" name="customer_group_discount[' + discount_row + '][percentage]" value="" placeholder="{{ entry_percentage }}" class="form-control" /></td>';*/
/* 		html += '  <td class="text-left"><div class="input-group date"><input type="text" name="customer_group_discount[' + discount_row + '][date_start]" value="" placeholder="{{ entry_date_start }}" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';*/
/* 		html += '  <td class="text-left"><div class="input-group date"><input type="text" name="customer_group_discount[' + discount_row + '][date_end]" value="" placeholder="{{ entry_date_end }}" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';*/
/* 		html += '  <td class="text-left"><button type="button" onclick="$(\'#discount-row' + discount_row + '\').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';*/
/* 		html += '</tr>';	*/
/* 	*/
/* 		$('#discount tbody').append(html);*/
/* */
/* 		$('.date').datetimepicker({*/
/* 			pickTime: false*/
/* 		});*/
/* 		*/
/* 		$('.selectpicker').selectpicker({*/
/* 		  size: 'auto',*/
/* 		  container : 'body',*/
/* 		  dropdownAlignRight: 'auto',*/
/* 		  iconBase: 'fa',*/
/*       	  tickIcon: 'fa-check',*/
/* 		  showTick: true*/
/* 		});*/
/* 		*/
/* 		discount_row++;*/
/* 	}*/
/* 	*/
/* 	*/
/* 	{% if permission %}*/
/* 	$('#save-button').click(function(){*/
/* 		*/
/* 		$.ajax({*/
/* 			url:'index.php?route=extension/module/discounts_pack/discount_customer_group/saveDiscount&user_token={{ user_token }}',*/
/* 			type: 'post',*/
/* 			dataType: 'json',*/
/* 			beforeSend: function() {*/
/* 				$('.alert').remove();*/
/* 			},*/
/* 			data: {*/
/* 				setting: $("#form-settings").serialize(),*/
/* 				customer_group_discount: $('#form-customer_group-discount').serialize(),*/
/* 			},*/
/* 			success: function(json) {*/
/* 				alertJson('alert alert-success', json);*/
/* 			},*/
/* 			error: function(json) {*/
/* 				alertJson('alert alert-warning', json);*/
/* 			}*/
/* 		});*/
/* 		*/
/* 		return false;*/
/* 	});*/
/* 	{% else %}*/
/* 		$('#save-button').click(function(){*/
/* 			$('.alert').remove();*/
/* 			*/
/* 			$(".panel").before('<div class="alert alert-warning">{{ error_permission }}</div>');*/
/* 		});*/
/* 	{% endif %}*/
/* 	*/
/* 	function alertJson(action, json) {*/
/* 		*/
/* 		$('.alert').remove();*/
/* 		*/
/* 		if (json['success']) {*/
/* 			$(".panel").before('<div class="' + action + '">' + json['success'] + '</div>');*/
/* 		} else if (json['error']) {*/
/* 			$(".panel").before('<div class="' + action + '">' + json['error'] + '</div>');*/
/* 		}*/
/* 		*/
/* 	}*/
/* 	*/
/* 	function activate(row) {*/
/* 		*/
/* 		$.ajax({*/
/* 			url:'index.php?route=extension/module/discounts_pack/discount_customer_group/activate&user_token={{ user_token }}',*/
/* 			type: 'post',*/
/* 			dataType: 'json',*/
/* 			data: {*/
/* 				row: row,*/
/* 			},*/
/* 			success: function(json) {*/
/* 				alertJson('alert alert-success', json);*/
/* 				$('#inactive-' + row).replaceWith('<a  id="active-' + row + '" onclick="{% if permission %}deactivate(' + row + ');{% endif %}" class="btn btn-sm btn-success" data-toggle="tooltip" title="{{ text_enabled }}"><i class="fa fa-minus-circle fa-rotate-90 fa-2x"></i></a>');*/
/* 				$('#status' + row).val(1);*/
/* 			},*/
/* 			error: function(json) {*/
/* 				alertJson('alert alert-warning', json);*/
/* 			}*/
/* 		});*/
/* 	*/
/* 	}*/
/* 	*/
/* 	function deactivate(row) {*/
/* 		*/
/* 		$.ajax({*/
/* 			url:'index.php?route=extension/module/discounts_pack/discount_customer_group/deactivate&user_token={{ user_token }}',*/
/* 			type: 'post',*/
/* 			dataType: 'json',*/
/* 			data: {*/
/* 				row: row,*/
/* 			},*/
/* 			success: function(json) {*/
/* 				alertJson('alert alert-success', json);*/
/* 				$('#active-' + row).replaceWith('<a id="inactive-' + row + '" onclick="{% if permission %}activate(' + row + ');{% endif %}" class="btn btn-sm btn-danger" data-toggle="tooltip" title="{{ text_disabled }}"><i class="fa fa-minus-circle fa-rotate-90 fa-2x"></i></a>');*/
/* 				$('#status' + row).val(0);*/
/* 			},*/
/* 			error: function(json) {*/
/* 				alertJson('alert alert-warning', json);*/
/* 			}*/
/* 		});*/
/* 	*/
/* 	}*/
/* 	$('.date').datetimepicker({*/
/* 		pickTime: false*/
/* 	});*/
/* */
/* 	$('.time').datetimepicker({*/
/* 		pickDate: false*/
/* 	});*/
/* */
/* 	$('.datetime').datetimepicker({*/
/* 		pickDate: true,*/
/* 		pickTime: true*/
/* 	});*/
/* 	*/
/* 	$('.selectpicker').selectpicker({*/
/* 	  size: 'auto',*/
/* 	  container : 'body',*/
/* 	  dropdownAlignRight: 'auto',*/
/* 	  iconBase: 'fa',*/
/*       tickIcon: 'fa-check',*/
/* 	  showTick: true*/
/* 	});*/
/* //--></script></div>*/
/* {{ footer }}*/
