<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* catalog/filter_group_list.twig */
class __TwigTemplate_f72d913ab2445f6ebdec4d2050d2a62c extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo ($context["header"] ?? null);
        echo ($context["column_left"] ?? null);
        echo "
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"pull-right\">
          ";
        // line 6
        if ((($context["config_filter_group_download"] ?? null) == 1)) {
            // line 7
            echo "          <a href=\"";
            echo ($context["download"] ?? null);
            echo "\" data-toggle=\"tooltip\" title=\"";
            echo ($context["button_download"] ?? null);
            echo "\" class=\"btn btn-warning\"><i class=\"fa fa-download\"></i></a>
          ";
        }
        // line 9
        echo "          <a href=\"";
        echo ($context["add"] ?? null);
        echo "\" data-toggle=\"tooltip\" title=\"";
        echo ($context["button_add"] ?? null);
        echo "\" class=\"btn btn-primary\"><i class=\"fa fa-plus\"></i></a>
        <button type=\"button\" data-toggle=\"tooltip\" title=\"";
        // line 10
        echo ($context["button_delete"] ?? null);
        echo "\" class=\"btn btn-danger\" onclick=\"confirm('";
        echo ($context["text_confirm"] ?? null);
        echo "') ? \$('#form-filter').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>
      </div>
      <h1>";
        // line 12
        echo ($context["heading_title"] ?? null);
        echo "</h1>
      <ul class=\"breadcrumb\">
        ";
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["breadcrumbs"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["breadcrumb"]) {
            // line 15
            echo "        <li><a href=\"";
            echo twig_get_attribute($this->env, $this->source, $context["breadcrumb"], "href", [], "any", false, false, false, 15);
            echo "\">";
            echo twig_get_attribute($this->env, $this->source, $context["breadcrumb"], "text", [], "any", false, false, false, 15);
            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 17
        echo "      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    ";
        // line 21
        if (($context["error_warning"] ?? null)) {
            // line 22
            echo "    <div class=\"alert alert-danger alert-dismissible\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo ($context["error_warning"] ?? null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 26
        echo "    ";
        if (($context["success"] ?? null)) {
            // line 27
            echo "    <div class=\"alert alert-success alert-dismissible\"><i class=\"fa fa-check-circle\"></i> ";
            echo ($context["success"] ?? null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 31
        echo "    
    <div id=\"ajax-success\" class=\"alert alert-success alert-dismissible\" style=\"display: none;\">
      <i class=\"fa fa-check-circle\"></i> <span class=\"message\"></span>
      <button type=\"button\" class=\"close\" onclick=\"\$('#ajax-success').hide();\">&times;</button>
    </div>
    
    <div class=\"panel panel-default\">
      <div class=\"panel-heading\">
        <h3 class=\"panel-title\"><i class=\"fa fa-list\"></i> ";
        // line 39
        echo ($context["text_group_list"] ?? null);
        echo "</h3>
        <div class=\"pull-right\">
            <div class=\"input-group\" style=\"top: -8px;\">
                <input type=\"text\" style=\"width: 55%; display: inline-block;\" name=\"filter_name\" value=\"";
        // line 42
        echo ($context["filter_name"] ?? null);
        echo "\" id=\"input-name\" class=\"form-control\" placeholder=\"Search...\" />
                <button type=\"button\" id=\"button-filter\" class=\"btn btn-primary\">
                    <i class=\"fa fa-filter\"></i> ";
        // line 44
        echo ($context["button_filter"] ?? null);
        echo "
                </button>
                <button type=\"button\" id=\"button-clear\" class=\"btn btn-danger\">
                    ";
        // line 47
        echo ($context["button_clear"] ?? null);
        echo "
                </button>
            </div>
        </div>
      </div>
      <div class=\"panel-body\">
        <form action=\"";
        // line 53
        echo ($context["delete"] ?? null);
        echo "\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-filter\">
          <div class=\"table-responsive\">
            <table class=\"table table-bordered table-hover\">
              <thead>
                <tr>
                  <td style=\"width: 1px;\" class=\"text-center\"><input type=\"checkbox\" onclick=\"\$('input[name*=\\'selected\\']').prop('checked', this.checked);\" /></td>
                  <td class=\"text-left\">";
        // line 59
        if ((($context["sort"] ?? null) == "fgd.name")) {
            // line 60
            echo "                    <a href=\"";
            echo ($context["sort_name"] ?? null);
            echo "\" class=\"";
            echo twig_lower_filter($this->env, ($context["order"] ?? null));
            echo "\">";
            echo ($context["column_group"] ?? null);
            echo "</a>
                    ";
        } else {
            // line 62
            echo "                    <a href=\"";
            echo ($context["sort_name"] ?? null);
            echo "\">";
            echo ($context["column_group"] ?? null);
            echo "</a>
                    ";
        }
        // line 63
        echo "</td>
                    <td class=\"text-left\">";
        // line 64
        echo ($context["column_products"] ?? null);
        echo "</td>
                    <td class=\"text-left\">";
        // line 65
        echo ($context["column_categories"] ?? null);
        echo "</td>
                    <td class=\"text-left\">";
        // line 66
        echo ($context["text_date_added"] ?? null);
        echo "</td>
                  <td class=\"text-right\">";
        // line 67
        if ((($context["sort"] ?? null) == "fg.sort_order")) {
            // line 68
            echo "                    <a href=\"";
            echo ($context["sort_sort_order"] ?? null);
            echo "\" class=\"";
            echo twig_lower_filter($this->env, ($context["order"] ?? null));
            echo "\">";
            echo ($context["column_sort_order"] ?? null);
            echo "</a>
                    ";
        } else {
            // line 70
            echo "                    <a href=\"";
            echo ($context["sort_sort_order"] ?? null);
            echo "\">";
            echo ($context["column_sort_order"] ?? null);
            echo "</a>
                    ";
        }
        // line 71
        echo "</td>
                  <td class=\"text-right\">";
        // line 72
        echo ($context["column_action"] ?? null);
        echo "</td>
                </tr>
              </thead>
              <tbody>
                ";
        // line 76
        if (($context["filters"] ?? null)) {
            // line 77
            echo "                ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(($context["filters"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["filter"]) {
                // line 78
                echo "                <tr>
                  <td class=\"text-center\">";
                // line 79
                if (twig_in_filter(twig_get_attribute($this->env, $this->source, $context["filter"], "filter_group_id", [], "any", false, false, false, 79), ($context["selected"] ?? null))) {
                    // line 80
                    echo "                    <input type=\"checkbox\" name=\"selected[]\" value=\"";
                    echo twig_get_attribute($this->env, $this->source, $context["filter"], "filter_group_id", [], "any", false, false, false, 80);
                    echo "\" checked=\"checked\" />
                    ";
                } else {
                    // line 82
                    echo "                    <input type=\"checkbox\" name=\"selected[]\" value=\"";
                    echo twig_get_attribute($this->env, $this->source, $context["filter"], "filter_group_id", [], "any", false, false, false, 82);
                    echo "\" />
                    ";
                }
                // line 83
                echo "</td>
                  <td class=\"text-left\">";
                // line 84
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "name", [], "any", false, false, false, 84);
                echo "</td>
                  <td class=\"text-left\"><a href=\"";
                // line 85
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "product_link", [], "any", false, false, false, 85);
                echo "\"><span style=\"background-color: #8378ff; padding: 5px 10px; color: #fff; border-radius: 10px;\">";
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "product_count", [], "any", false, false, false, 85);
                echo "</span></a></td>
                  <td class=\"text-left\"><a href=\"";
                // line 86
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "category_link", [], "any", false, false, false, 86);
                echo "\"><span style=\"background-color: #8378ff; padding: 5px 10px; color: #fff; border-radius: 10px;\">";
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "category_count", [], "any", false, false, false, 86);
                echo "</span></a></td>
                  <td class=\"text-left\">
\t\t\t\t\t\t<i class=\"fa fa-calendar\" data-toggle=\"tooltip\" title=\"";
                // line 88
                echo ($context["text_date_added"] ?? null);
                echo "\"></i> ";
                echo twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "date_added", [], "any", false, false, false, 88);
                echo " ";
                if (twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "added_by", [], "any", false, false, false, 88)) {
                    echo " (";
                    echo twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "added_by", [], "any", false, false, false, 88);
                    echo ") ";
                }
                echo " <br/>
\t\t\t\t\t\t<i class=\"fa fa-refresh\" data-toggle=\"tooltip\" title=\"";
                // line 89
                echo ($context["text_date_modified"] ?? null);
                echo "\"></i> ";
                echo twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "date_modified", [], "any", false, false, false, 89);
                echo " ";
                if (twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "updated_by", [], "any", false, false, false, 89)) {
                    echo " (";
                    echo twig_get_attribute($this->env, $this->source, ($context["category"] ?? null), "updated_by", [], "any", false, false, false, 89);
                    echo ") ";
                }
                // line 90
                echo "\t\t\t\t\t</td>
                  <td class=\"text-right\">
                      <input type=\"text\" value=\"";
                // line 92
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "sort_order", [], "any", false, false, false, 92);
                echo "\" data-filter-id=\"";
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "filter_group_id", [], "any", false, false, false, 92);
                echo "\" class=\"sort-order-input\" />
                  </td>
                  <td class=\"text-right\"><a href=\"";
                // line 94
                echo twig_get_attribute($this->env, $this->source, $context["filter"], "edit", [], "any", false, false, false, 94);
                echo "\" data-toggle=\"tooltip\" title=\"";
                echo ($context["button_edit"] ?? null);
                echo "\" class=\"btn btn-primary\"><i class=\"fa fa-pencil\"></i></a></td>
                </tr>
                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['filter'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 97
            echo "                ";
        } else {
            // line 98
            echo "                <tr>
                  <td class=\"text-center\" colspan=\"4\">";
            // line 99
            echo ($context["text_no_results"] ?? null);
            echo "</td>
                </tr>
                ";
        }
        // line 102
        echo "              </tbody>
            </table>
          </div>
        </form>
        <div class=\"row\">
          <div class=\"col-sm-6 text-left\">";
        // line 107
        echo ($context["pagination"] ?? null);
        echo "</div>
          <div class=\"col-sm-6 text-right\">";
        // line 108
        echo ($context["results"] ?? null);
        echo "</div>
        </div>
      </div>
    </div>
  </div>
</div>
<script type=\"text/javascript\"><!--
    \$('#button-filter').on('click', function() {
\t  var url = 'index.php?route=catalog/filter_group&user_token=";
        // line 116
        echo ($context["user_token"] ?? null);
        echo "';

\t  var filter_name = \$('input[name=\\'filter_name\\']').val();
\t\t\t
\t  if (filter_name) 
\t  {
\t\turl += '&filter_name=' + encodeURIComponent(filter_name);
\t  }
\t  location = url;
\t});
\t \$('#button-clear').on('click', function() {
\t location ='index.php?route=catalog/filter_group&user_token=";
        // line 127
        echo ($context["user_token"] ?? null);
        echo "';
\t});\t\t\t\t\t\t
\t// Category
\t\$('input[name=\\'filter_name\\']').autocomplete({
\t  'source': function(request, response) {
\t    \$.ajax({
\t      url: 'index.php?route=catalog/filter_group/autocomplete&user_token=";
        // line 133
        echo ($context["user_token"] ?? null);
        echo "&filter_name=' +  encodeURIComponent(request),
\t      dataType: 'json',
\t      success: function(json) {
\t\t    response(\$.map(json, function(item) {
\t          return {
\t            label: item['name'],
\t            value: item['filter_group_id']
\t          }
\t        }));
\t      }
\t    });
\t  },
\t  'select': function(item) {
\t    \$('input[name=\\'filter_name\\']').val(item['label']);
\t  }
\t});\t\t
\t//--></script>
<script type=\"text/javascript\">
\$(document).ready(function(){
    \$('.sort-order-input').on('change', function() {
        var filterId = \$(this).data('filter-id');
        var sortOrder = \$(this).val();

        \$.ajax({
            url: 'index.php?route=catalog/filter_group/updateSortOrder&user_token=";
        // line 157
        echo ($context["user_token"] ?? null);
        echo "',
            type: 'post',
            dataType: 'json',
            data: {
                filter_id: filterId,
                sort_order: sortOrder
            },
            success: function(json) {
            if (json.success) {
                \$('#ajax-success .message').text(json.success);
                \$('#ajax-success').fadeIn().delay(3000).fadeOut();
            } else if (json.error) {
                alert(json.error);
            }
        }
        });
    });
});
</script>
";
        // line 176
        echo ($context["footer"] ?? null);
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "catalog/filter_group_list.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  421 => 176,  399 => 157,  372 => 133,  363 => 127,  349 => 116,  338 => 108,  334 => 107,  327 => 102,  321 => 99,  318 => 98,  315 => 97,  304 => 94,  297 => 92,  293 => 90,  283 => 89,  271 => 88,  264 => 86,  258 => 85,  254 => 84,  251 => 83,  245 => 82,  239 => 80,  237 => 79,  234 => 78,  229 => 77,  227 => 76,  220 => 72,  217 => 71,  209 => 70,  199 => 68,  197 => 67,  193 => 66,  189 => 65,  185 => 64,  182 => 63,  174 => 62,  164 => 60,  162 => 59,  153 => 53,  144 => 47,  138 => 44,  133 => 42,  127 => 39,  117 => 31,  109 => 27,  106 => 26,  98 => 22,  96 => 21,  90 => 17,  79 => 15,  75 => 14,  70 => 12,  63 => 10,  56 => 9,  48 => 7,  46 => 6,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "catalog/filter_group_list.twig", "");
    }
}
