<?php

/* extension/module/discount_category.twig */
class __TwigTemplate_5d732637c67790811ed760a5473ba679576dc27c689cc645cfdcc065fa31e643 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_category_discount_status\" id=\"input-status\" class=\"setting form-control selectpicker\">
\t\t\t\t\t";
        // line 37
        if ((isset($context["category_discount_status"]) ? $context["category_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_category_discount_sort_order\" value=\"";
        // line 50
        echo (isset($context["category_discount_sort_order"]) ? $context["category_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
\t\t\t<form method=\"post\" enctype=\"multipart/form-data\" id=\"form-category-discount\" class=\"form-horizontal\">  \t
              <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\">";
        // line 61
        echo (isset($context["entry_category"]) ? $context["entry_category"] : null);
        echo "</td>\t
                      <td class=\"text-left col-md-2\">";
        // line 62
        echo (isset($context["entry_customer_group"]) ? $context["entry_customer_group"] : null);
        echo "</td>
                      <td class=\"text-right col-md-1\">";
        // line 63
        echo (isset($context["entry_priority"]) ? $context["entry_priority"] : null);
        echo "</td>
                      <td class=\"text-right col-md-1\">";
        // line 64
        echo (isset($context["entry_percentage"]) ? $context["entry_percentage"] : null);
        echo "</td>
                      <td class=\"text-center col-md-1\">";
        // line 65
        echo (isset($context["entry_affect"]) ? $context["entry_affect"] : null);
        echo "</td>
                      <td class=\"text-left col-md-1\">";
        // line 66
        echo (isset($context["entry_qty"]) ? $context["entry_qty"] : null);
        echo "</td>
                      <td class=\"text-left col-md-1\">";
        // line 67
        echo (isset($context["entry_date_start"]) ? $context["entry_date_start"] : null);
        echo "</td>
                      <td class=\"text-left col-md-2\">";
        // line 68
        echo (isset($context["entry_date_end"]) ? $context["entry_date_end"] : null);
        echo "</td>
                      <td></td>
                    </tr>
                  </thead>
                  <tbody>
                  ";
        // line 73
        $context["discount_row"] = 0;
        // line 74
        echo "                    ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["category_discounts"]) ? $context["category_discounts"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["category_discount"]) {
            // line 75
            echo "                    <tr id=\"discount-row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\">
                      <td>";
            // line 76
            if ($this->getAttribute($context["category_discount"], "status", array())) {
                // line 77
                echo "                      \t\t<a  id=\"active-";
                echo $this->getAttribute($context["category_discount"], "category_discount_id", array());
                echo "\" onclick=\"";
                if ((isset($context["permission"]) ? $context["permission"] : null)) {
                    echo "deactivate(";
                    echo $this->getAttribute($context["category_discount"], "category_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<i class=\"fa fa-minus-circle fa-rotate-90 fa-2x\"></i>
                      \t\t</a>
                      \t\t<input name=\"category_discount[";
                // line 80
                echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
                echo "][status]\" id=\"status";
                echo $this->getAttribute($context["category_discount"], "category_discount_id", array());
                echo "\" type=\"hidden\" value=\"1\">
                      \t\t";
            } else {
                // line 82
                echo "                      \t\t<a id=\"inactive-";
                echo $this->getAttribute($context["category_discount"], "category_discount_id", array());
                echo "\" onclick=\"";
                if ((isset($context["permission"]) ? $context["permission"] : null)) {
                    echo "activate(";
                    echo $this->getAttribute($context["category_discount"], "category_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<input name=\"category_discount[";
                // line 83
                echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
                echo "][status]\" id=\"status";
                echo $this->getAttribute($context["category_discount"], "category_discount_id", array());
                echo "\" type=\"hidden\" value=\"0\">
                      \t\t";
            }
            // line 85
            echo "                      </td>
                      <td class=\"text-left\"><select name=\"category_discount[";
            // line 86
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][category_id]\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo " selectpicker\" data-live-search=\"true\" data-width=\"270\">
                          ";
            // line 87
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable((isset($context["categories"]) ? $context["categories"] : null));
            foreach ($context['_seq'] as $context["key"] => $context["category"]) {
                // line 88
                echo "\t\t\t\t\t\t\t  <option value=\"";
                echo $this->getAttribute($context["category"], "category_id", array());
                echo "\"  ";
                echo ((($this->getAttribute($context["category"], "category_id", array()) == $this->getAttribute($context["category_discount"], "category_id", array()))) ? ("selected") : (""));
                echo " >";
                echo $this->getAttribute($context["category"], "name", array());
                echo "</option>
\t\t\t\t\t\t\t  ";
                // line 89
                if ( !twig_test_empty($this->getAttribute($context["category"], "children", array()))) {
                    // line 90
                    echo "\t\t\t\t\t\t\t\t<optgroup label=\"";
                    echo $this->getAttribute($context["category"], "name", array());
                    echo "\">
\t\t\t\t\t\t\t\t";
                    // line 91
                    $context['_parent'] = $context;
                    $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["category"], "children", array()));
                    foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
                        // line 92
                        echo "\t\t\t\t\t\t\t\t\t<option value=\"";
                        echo $this->getAttribute($context["child"], "category_id", array());
                        echo "\" ";
                        echo ((($this->getAttribute($context["child"], "category_id", array()) == $this->getAttribute($context["category_discount"], "category_id", array()))) ? ("selected") : (""));
                        echo " >";
                        echo $this->getAttribute($context["child"], "name", array());
                        echo "</option>
\t\t\t\t\t\t\t\t";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 94
                    echo "\t\t\t\t\t\t\t\t</optgroup>
\t\t\t\t\t\t\t  ";
                }
                // line 96
                echo "\t\t\t\t\t\t  ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['key'], $context['category'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 97
            echo "                        </select>
                      </td>\t
                      <td class=\"text-left\"><select name=\"category_discount[";
            // line 99
            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\">
                        ";
            // line 100
            $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 101
                echo "                          \t";
                if (($this->getAttribute($context["customer_group"], "customer_group_id", array()) == $this->getAttribute($context["category_discount"], "customer_group_id", array()))) {
                    // line 102
                    echo "                          <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>
                          ";
                } else {
                    // line 104
                    echo "                          <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  ";
                }
                // line 105
                echo " 
\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 107
            echo "                        </select></td>
                      <td class=\"text-right\"><input type=\"text\" name=\"category_discount[";
            // line 108
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][priority]\" value=\"";
            echo $this->getAttribute($context["category_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>
                      <td class=\"text-right\"><input type=\"text\" name=\"category_discount[";
            // line 109
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][percentage]\" value=\"";
            echo $this->getAttribute($context["category_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>
                      <td class=\"text-right\">
                      \t<select name=\"category_discount[";
            // line 111
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][affect]\" class=\"form-control selectpicker\">
\t\t\t\t\t\t\t";
            // line 112
            if (twig_test_empty($this->getAttribute($context["category_discount"], "affect", array()))) {
                // line 113
                echo "\t\t\t\t\t\t\t\t<option value=\"0\" selected=\"selected\">";
                echo (isset($context["entry_no"]) ? $context["entry_no"] : null);
                echo "</option>
\t\t\t\t\t\t\t";
            } else {
                // line 115
                echo "\t\t\t\t\t\t\t\t<option value=\"0\">";
                echo (isset($context["entry_no"]) ? $context["entry_no"] : null);
                echo "</option>
\t\t\t\t\t\t\t";
            }
            // line 117
            echo "\t\t\t\t\t\t\t";
            if ($this->getAttribute($context["category_discount"], "affect", array())) {
                echo "\t
\t\t\t\t\t\t\t\t<option value=\"1\" selected=\"selected\">";
                // line 118
                echo (isset($context["entry_yes"]) ? $context["entry_yes"] : null);
                echo "</option>
\t\t\t\t\t\t\t";
            } else {
                // line 120
                echo "\t\t\t\t\t\t\t\t<option value=\"1\">";
                echo (isset($context["entry_yes"]) ? $context["entry_yes"] : null);
                echo "</option>
\t\t\t\t\t\t\t";
            }
            // line 121
            echo "\t
\t\t\t\t\t\t</select> 
                      </td>
                      <td class=\"text-right\"><input type=\"text\" name=\"category_discount[";
            // line 124
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][qty]\" value=\"";
            echo $this->getAttribute($context["category_discount"], "qty", array());
            echo "\" placeholder=\"";
            echo (isset($context["entry_qty"]) ? $context["entry_qty"] : null);
            echo "\" class=\"form-control row";
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "\" /></td>
                      <td class=\"text-left\" style=\"width: 20%;\"><div class=\"input-group date\">
                          <input type=\"text\" name=\"category_discount[";
            // line 126
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][date_start]\" value=\"";
            echo $this->getAttribute($context["category_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 "\" />
                          <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=\"category_discount[";
            // line 131
            echo (isset($context["discount_row"]) ? $context["discount_row"] : null);
            echo "][date_end]\" value=\"";
            echo $this->getAttribute($context["category_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 "\" />
                          <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";
            // line 135
            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>
                    ";
            // line 137
            $context["discount_row"] = ((isset($context["discount_row"]) ? $context["discount_row"] : null) + 1);
            // line 138
            echo "\t\t\t\t  ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category_discount'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 139
        echo "                  </tbody>
                  <tfoot>
                    <tr>
                      <td colspan=\"9\"></td>
                      <td class=\"text-left\"><button type=\"button\" onclick=\"addDiscount();\" data-toggle=\"tooltip\" title=\"";
        // line 143
        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 149
        echo (isset($context["back_link"]) ? $context["back_link"] : null);
        echo "\"> < Back</a>
      </div>
    </div>
  </div>
  <script type=\"text/javascript\"><!--
\t
\tvar discount_row = ";
        // line 155
        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=\"category_discount[' + discount_row + '][status]\" id=\"status' + discount_row + '\" type=\"hidden\" value=\"1\"></td>';
\t\thtml += '  <td class=\"text-left\"><select name=\"category_discount[' + discount_row + '][category_id]\" class=\"form-control selectpicker\" data-live-search=\"true\">';
\t\t";
        // line 161
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["categories"]) ? $context["categories"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
            // line 162
            echo "\t\t\thtml += '    <option value=\"";
            echo $this->getAttribute($context["category"], "category_id", array());
            echo "\">";
            echo twig_escape_filter($this->env, $this->getAttribute($context["category"], "name", array()), "js");
            echo "</option>';
\t\t\t";
            // line 163
            if ( !twig_test_empty($this->getAttribute($context["category"], "children", array()))) {
                // line 164
                echo "\t\t\t\thtml += '    <optgroup label=";
                echo twig_escape_filter($this->env, $this->getAttribute($context["category"], "name", array()), "js");
                echo ">';
\t\t\t\t";
                // line 165
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["category"], "children", array()));
                foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
                    // line 166
                    echo "\t\t\t\t\thtml += '    <option value=\"";
                    echo $this->getAttribute($context["child"], "category_id", array());
                    echo "\">";
                    echo twig_escape_filter($this->env, $this->getAttribute($context["child"], "name", array()), "js");
                    echo "</option>';
\t\t\t\t";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 168
                echo "\t\t\t\thtml += '    </optgroup>';
\t\t\t";
            }
            // line 170
            echo "\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 171
        echo "\t\thtml += '  </select></td>';\t\t
\t\thtml += '  <td class=\"text-left\"><select name=\"category_discount[' + discount_row + '][customer_group_id]\" class=\"form-control selectpicker\" data-live-search=\"true\">';
\t\t";
        // line 173
        $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 174
            echo "\t\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 176
        echo "\t\thtml += '  </select></td>';\t\t
\t\thtml += '  <td class=\"text-right\"><input type=\"text\" name=\"category_discount[' + discount_row + '][priority]\" value=\"\" placeholder=\"";
        // line 177
        echo (isset($context["entry_priority"]) ? $context["entry_priority"] : null);
        echo "\" class=\"form-control\" /></td>';
\t\thtml += '  <td class=\"text-right\"><input type=\"text\" name=\"category_discount[' + discount_row + '][percentage]\" value=\"\" placeholder=\"";
        // line 178
        echo (isset($context["entry_percentage"]) ? $context["entry_percentage"] : null);
        echo "\" class=\"form-control\" /></td>';
\t\thtml += '  <td class=\"text-center\"><select name=\"category_discount[' + discount_row + '][affect]\" class=\"form-control selectpicker\">';
\t\thtml += '  <option value=\"0\">";
        // line 180
        echo (isset($context["entry_no"]) ? $context["entry_no"] : null);
        echo "</option>';
\t\thtml += '  <option value=\"1\">";
        // line 181
        echo (isset($context["entry_yes"]) ? $context["entry_yes"] : null);
        echo "</option>';
\t\thtml += '  </select></td>';
\t\thtml += '  <td class=\"text-right\"><input type=\"text\" name=\"category_discount[' + discount_row + '][qty]\" value=\"\" placeholder=\"";
        // line 183
        echo (isset($context["entry_qty"]) ? $context["entry_qty"] : null);
        echo "\" class=\"form-control\" /></td>';
\t\thtml += '  <td class=\"text-left\"><div class=\"input-group date\"><input type=\"text\" name=\"category_discount[' + discount_row + '][date_start]\" value=\"\" placeholder=\"";
        // line 184
        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=\"category_discount[' + discount_row + '][date_end]\" value=\"\" placeholder=\"";
        // line 185
        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 186
        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  dropupAuto: false,
\t\t  iconBase: 'fa',
\t\t  tickIcon: 'fa-check',
\t\t  selectedTextFormat: 'count > 3',
\t\t  showTick: true
\t\t});
\t\t
\t\tdiscount_row++;
\t}
\t
\t
\t";
        // line 210
        if ((isset($context["permission"]) ? $context["permission"] : null)) {
            // line 211
            echo "\t\$('#save-button').click(function(){
\t\t
\t\t\$.ajax({
\t\t\turl:'index.php?route=extension/module/discounts_pack/discount_category/saveDiscount&user_token=";
            // line 214
            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\tcategory_discount: \$('#form-category-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
\t
\t";
        } else {
            // line 237
            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 240
            echo (isset($context["error_permission"]) ? $context["error_permission"] : null);
            echo "</div>');
\t\t});
\t
\t";
        }
        // line 244
        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
\tfunction activate(row) {
\t\t
\t\t\$.ajax({
\t\t\turl:'index.php?route=extension/module/discounts_pack/discount_category/activate&user_token=";
        // line 259
        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 267
        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_category/deactivate&user_token=";
        // line 280
        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 288
        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  dropupAuto: false,
\t  iconBase: 'fa',
\t  tickIcon: 'fa-check',
\t  selectedTextFormat: 'count > 3',
\t  showTick: true
\t});

\t
//--></script>
</div>
";
        // line 324
        echo (isset($context["footer"]) ? $context["footer"] : null);
    }

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

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  758 => 324,  715 => 288,  704 => 280,  684 => 267,  673 => 259,  656 => 244,  649 => 240,  644 => 237,  618 => 214,  613 => 211,  611 => 210,  584 => 186,  580 => 185,  576 => 184,  572 => 183,  567 => 181,  563 => 180,  558 => 178,  554 => 177,  551 => 176,  540 => 174,  536 => 173,  532 => 171,  526 => 170,  522 => 168,  511 => 166,  507 => 165,  502 => 164,  500 => 163,  493 => 162,  489 => 161,  480 => 155,  471 => 149,  462 => 143,  456 => 139,  450 => 138,  448 => 137,  441 => 135,  428 => 131,  414 => 126,  403 => 124,  398 => 121,  392 => 120,  387 => 118,  382 => 117,  376 => 115,  370 => 113,  368 => 112,  364 => 111,  353 => 109,  343 => 108,  340 => 107,  333 => 105,  325 => 104,  317 => 102,  314 => 101,  310 => 100,  304 => 99,  300 => 97,  294 => 96,  290 => 94,  277 => 92,  273 => 91,  268 => 90,  266 => 89,  257 => 88,  253 => 87,  247 => 86,  244 => 85,  237 => 83,  224 => 82,  217 => 80,  202 => 77,  200 => 76,  195 => 75,  190 => 74,  188 => 73,  180 => 68,  176 => 67,  172 => 66,  168 => 65,  164 => 64,  160 => 63,  156 => 62,  152 => 61,  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_category_discount_status" id="input-status" class="setting form-control selectpicker">*/
/* 					{% if category_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_category_discount_sort_order" value="{{ category_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-category-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_category }}</td>	*/
/*                       <td class="text-left col-md-2">{{ entry_customer_group }}</td>*/
/*                       <td class="text-right col-md-1">{{ entry_priority }}</td>*/
/*                       <td class="text-right col-md-1">{{ entry_percentage }}</td>*/
/*                       <td class="text-center col-md-1">{{ entry_affect }}</td>*/
/*                       <td class="text-left col-md-1">{{ entry_qty }}</td>*/
/*                       <td class="text-left col-md-1">{{ entry_date_start }}</td>*/
/*                       <td class="text-left col-md-2">{{ entry_date_end }}</td>*/
/*                       <td></td>*/
/*                     </tr>*/
/*                   </thead>*/
/*                   <tbody>*/
/*                   {% set discount_row=  0 %}*/
/*                     {% for category_discount in category_discounts %}*/
/*                     <tr id="discount-row{{ discount_row }}">*/
/*                       <td>{% if category_discount.status %}*/
/*                       		<a  id="active-{{ category_discount.category_discount_id }}" onclick="{% if permission %}deactivate({{ category_discount.category_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="category_discount[{{ discount_row }}][status]" id="status{{ category_discount.category_discount_id }}" type="hidden" value="1">*/
/*                       		{% else %}*/
/*                       		<a id="inactive-{{ category_discount.category_discount_id }}" onclick="{% if permission %}activate({{ category_discount.category_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="category_discount[{{ discount_row }}][status]" id="status{{ category_discount.category_discount_id }}" type="hidden" value="0">*/
/*                       		{% endif %}*/
/*                       </td>*/
/*                       <td class="text-left"><select name="category_discount[{{ discount_row }}][category_id]" class="form-control row{{ discount_row }} selectpicker" data-live-search="true" data-width="270">*/
/*                           {% for key, category in categories %}*/
/* 							  <option value="{{ category.category_id }}"  {{ category.category_id == category_discount.category_id ? 'selected' : '' }} >{{ category.name }}</option>*/
/* 							  {% if category.children is not empty %}*/
/* 								<optgroup label="{{ category.name }}">*/
/* 								{% for child in category.children %}*/
/* 									<option value="{{ child.category_id }}" {{ child.category_id == category_discount.category_id ? 'selected' : '' }} >{{ child.name }}</option>*/
/* 								{% endfor %}*/
/* 								</optgroup>*/
/* 							  {% endif %}*/
/* 						  {% endfor %}*/
/*                         </select>*/
/*                       </td>	*/
/*                       <td class="text-left"><select name="category_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  == category_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="category_discount[{{ discount_row }}][priority]" value="{{ category_discount.priority }}" placeholder="{{ entry_priority }}" class="form-control row{{ discount_row }}" /></td>*/
/*                       <td class="text-right"><input type="text" name="category_discount[{{ discount_row }}][percentage]" value="{{ category_discount.percentage }}" placeholder="{{ entry_percentage }}" class="form-control row{{ discount_row }}" /></td>*/
/*                       <td class="text-right">*/
/*                       	<select name="category_discount[{{ discount_row }}][affect]" class="form-control selectpicker">*/
/* 							{% if category_discount.affect is empty%}*/
/* 								<option value="0" selected="selected">{{ entry_no }}</option>*/
/* 							{% else %}*/
/* 								<option value="0">{{ entry_no }}</option>*/
/* 							{% endif %}*/
/* 							{% if category_discount.affect %}	*/
/* 								<option value="1" selected="selected">{{ entry_yes }}</option>*/
/* 							{% else %}*/
/* 								<option value="1">{{ entry_yes }}</option>*/
/* 							{% endif %}	*/
/* 						</select> */
/*                       </td>*/
/*                       <td class="text-right"><input type="text" name="category_discount[{{ discount_row }}][qty]" value="{{ category_discount.qty }}" placeholder="{{ entry_qty }}" class="form-control row{{ discount_row }}" /></td>*/
/*                       <td class="text-left" style="width: 20%;"><div class="input-group date">*/
/*                           <input type="text" name="category_discount[{{ discount_row }}][date_start]" value="{{ category_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="category_discount[{{ discount_row }}][date_end]" value="{{ category_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="9"></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="category_discount[' + discount_row + '][status]" id="status' + discount_row + '" type="hidden" value="1"></td>';*/
/* 		html += '  <td class="text-left"><select name="category_discount[' + discount_row + '][category_id]" class="form-control selectpicker" data-live-search="true">';*/
/* 		{% for category in categories %}*/
/* 			html += '    <option value="{{ category.category_id }}">{{ category.name|e('js') }}</option>';*/
/* 			{% if category.children is not empty %}*/
/* 				html += '    <optgroup label={{ category.name|e('js') }}>';*/
/* 				{% for child in category.children %}*/
/* 					html += '    <option value="{{ child.category_id }}">{{ child.name|e('js') }}</option>';*/
/* 				{% endfor %}*/
/* 				html += '    </optgroup>';*/
/* 			{% endif %}*/
/* 		{% endfor %}*/
/* 		html += '  </select></td>';		*/
/* 		html += '  <td class="text-left"><select name="category_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-right"><input type="text" name="category_discount[' + discount_row + '][priority]" value="" placeholder="{{ entry_priority }}" class="form-control" /></td>';*/
/* 		html += '  <td class="text-right"><input type="text" name="category_discount[' + discount_row + '][percentage]" value="" placeholder="{{ entry_percentage }}" class="form-control" /></td>';*/
/* 		html += '  <td class="text-center"><select name="category_discount[' + discount_row + '][affect]" class="form-control selectpicker">';*/
/* 		html += '  <option value="0">{{ entry_no }}</option>';*/
/* 		html += '  <option value="1">{{ entry_yes }}</option>';*/
/* 		html += '  </select></td>';*/
/* 		html += '  <td class="text-right"><input type="text" name="category_discount[' + discount_row + '][qty]" value="" placeholder="{{ entry_qty }}" class="form-control" /></td>';*/
/* 		html += '  <td class="text-left"><div class="input-group date"><input type="text" name="category_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="category_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',*/
/* 		  dropupAuto: false,*/
/* 		  iconBase: 'fa',*/
/* 		  tickIcon: 'fa-check',*/
/* 		  selectedTextFormat: 'count > 3',*/
/* 		  showTick: true*/
/* 		});*/
/* 		*/
/* 		discount_row++;*/
/* 	}*/
/* 	*/
/* 	*/
/* 	{% if permission %}*/
/* 	$('#save-button').click(function(){*/
/* 		*/
/* 		$.ajax({*/
/* 			url:'index.php?route=extension/module/discounts_pack/discount_category/saveDiscount&user_token={{ user_token }}',*/
/* 			type: 'post',*/
/* 			dataType: 'json',*/
/* 			beforeSend: function() {*/
/* 				$('.alert').remove();*/
/* 			},*/
/* 			data: {*/
/* 				setting: $("#form-settings").serialize(),*/
/* 				category_discount: $('#form-category-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_category/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_category/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',*/
/* 	  dropupAuto: false,*/
/* 	  iconBase: 'fa',*/
/* 	  tickIcon: 'fa-check',*/
/* 	  selectedTextFormat: 'count > 3',*/
/* 	  showTick: true*/
/* 	});*/
/* */
/* 	*/
/* //--></script>*/
/* </div>*/
/* {{ footer }}*/
