<?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;

/* grades/student.html.twig */
class __TwigTemplate_6e5c3548006415ca6a3b7230c94ed6d029cdcf334cbb2c5cd2ab22f326970709 extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->blocks = [
            'title' => [$this, 'block_title'],
            'body' => [$this, 'block_body'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "grades/student.html.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "grades/student.html.twig"));

        $this->parent = $this->loadTemplate("base.html.twig", "grades/student.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    // line 3
    public function block_title($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));

        // line 4
        echo "Známky
";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

    }

    // line 7
    public function block_body($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));

        // line 8
        echo "
    <h2>Známky</h2>

    <hr>

    ";
        // line 13
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 13, $this->source); })()), 'form_start');
        echo "

    <div class=\"input-group mb-3\">
        <div class=\"input-group-prepend\">
            ";
        // line 17
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 17, $this->source); })()), "vyber", [], "any", false, false, false, 17), 'widget');
        echo "
        </div>
        ";
        // line 19
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 19, $this->source); })()), "rok", [], "any", false, false, false, 19), 'widget');
        echo "
    </div>

    ";
        // line 22
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 22, $this->source); })()), 'form_end');
        echo "

    <hr>

    <div class=\"shadow\" style=\"width: max-content;\">
        <table id=\"table\" data-toggle=\"table\" data-height=\"500\"
               class=\"table table-bordered table-borderless\">
            <thead class=\"thead-light\">
            <tr>
                <th data-field=\"Predmet\">Předmět</th>

                ";
        // line 33
        $context["Max"] = 0;
        // line 34
        echo "
                ";
        // line 35
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["predmet"]) || array_key_exists("predmet", $context) ? $context["predmet"] : (function () { throw new RuntimeError('Variable "predmet" does not exist.', 35, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["p"]) {
            // line 36
            echo "                    ";
            $context["cnt"] = 0;
            // line 37
            echo "                    ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["p"], "znamka", [], "any", false, false, false, 37));
            foreach ($context['_seq'] as $context["_key"] => $context["zn"]) {
                // line 38
                echo "                        ";
                if (0 === twig_compare(twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["zn"], "datum", [], "any", false, false, false, 38), "Y"), (isset($context["rok"]) || array_key_exists("rok", $context) ? $context["rok"] : (function () { throw new RuntimeError('Variable "rok" does not exist.', 38, $this->source); })()))) {
                    // line 39
                    echo "                            ";
                    $context["cnt"] = ((isset($context["cnt"]) || array_key_exists("cnt", $context) ? $context["cnt"] : (function () { throw new RuntimeError('Variable "cnt" does not exist.', 39, $this->source); })()) + 1);
                    // line 40
                    echo "                        ";
                }
                // line 41
                echo "                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['zn'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 42
            echo "
                    ";
            // line 43
            if (1 === twig_compare((isset($context["cnt"]) || array_key_exists("cnt", $context) ? $context["cnt"] : (function () { throw new RuntimeError('Variable "cnt" does not exist.', 43, $this->source); })()), (isset($context["Max"]) || array_key_exists("Max", $context) ? $context["Max"] : (function () { throw new RuntimeError('Variable "Max" does not exist.', 43, $this->source); })()))) {
                // line 44
                echo "                        ";
                $context["Max"] = (isset($context["cnt"]) || array_key_exists("cnt", $context) ? $context["cnt"] : (function () { throw new RuntimeError('Variable "cnt" does not exist.', 44, $this->source); })());
                // line 45
                echo "                    ";
            }
            // line 46
            echo "                    ";
            $context["cnt"] = 0;
            // line 47
            echo "                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['p'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 48
        echo "
                ";
        // line 49
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(range(1, (isset($context["Max"]) || array_key_exists("Max", $context) ? $context["Max"] : (function () { throw new RuntimeError('Variable "Max" does not exist.', 49, $this->source); })())));
        foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
            // line 50
            echo "
                    <th> ";
            // line 51
            echo twig_escape_filter($this->env, $context["i"], "html", null, true);
            echo " </th>

                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 54
        echo "
                <th data-field=\"Prumer\">Průměr</th>

            </tr>
            </thead>
            <tbody>

            ";
        // line 61
        $context["prum"] = 0;
        // line 62
        echo "            ";
        $context["poc"] = 0;
        // line 63
        echo "            ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["predmet"]) || array_key_exists("predmet", $context) ? $context["predmet"] : (function () { throw new RuntimeError('Variable "predmet" does not exist.', 63, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["p"]) {
            // line 64
            echo "                    <tr>
                        <td style=\"background-color: #808080; color: #f2f2f2\">";
            // line 65
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["p"], "nazev", [], "any", false, false, false, 65), "html", null, true);
            echo "</td>

                        ";
            // line 67
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["zak"]) || array_key_exists("zak", $context) ? $context["zak"] : (function () { throw new RuntimeError('Variable "zak" does not exist.', 67, $this->source); })()), "znamka", [], "any", false, false, false, 67));
            foreach ($context['_seq'] as $context["_key"] => $context["zn"]) {
                // line 68
                echo "
                            ";
                // line 69
                if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, $context["zn"], "predmet", [], "any", false, false, false, 69), $context["p"]) && 0 === twig_compare(twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["zn"], "datum", [], "any", false, false, false, 69), "Y"), (isset($context["rok"]) || array_key_exists("rok", $context) ? $context["rok"] : (function () { throw new RuntimeError('Variable "rok" does not exist.', 69, $this->source); })())))) {
                    // line 70
                    echo "
                                ";
                    // line 71
                    $context["prum"] = ((isset($context["prum"]) || array_key_exists("prum", $context) ? $context["prum"] : (function () { throw new RuntimeError('Variable "prum" does not exist.', 71, $this->source); })()) + twig_get_attribute($this->env, $this->source, $context["zn"], "hodnota", [], "any", false, false, false, 71));
                    // line 72
                    echo "                                ";
                    $context["poc"] = ((isset($context["poc"]) || array_key_exists("poc", $context) ? $context["poc"] : (function () { throw new RuntimeError('Variable "poc" does not exist.', 72, $this->source); })()) + 1);
                    // line 73
                    echo "                                <td>
                                    <a style=\"color: black\" href=\"";
                    // line 74
                    echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("grades.show", ["id" => twig_get_attribute($this->env, $this->source, $context["zn"], "id", [], "any", false, false, false, 74)]), "html", null, true);
                    echo "\">";
                    echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["zn"], "hodnota", [], "any", false, false, false, 74), "html", null, true);
                    echo "</a>
                                </td>

                            ";
                }
                // line 78
                echo "
                        ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['zn'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 80
            echo "
                        ";
            // line 81
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(range(0, ((isset($context["Max"]) || array_key_exists("Max", $context) ? $context["Max"] : (function () { throw new RuntimeError('Variable "Max" does not exist.', 81, $this->source); })()) - (isset($context["poc"]) || array_key_exists("poc", $context) ? $context["poc"] : (function () { throw new RuntimeError('Variable "poc" does not exist.', 81, $this->source); })()))));
            $context['loop'] = [
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            ];
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                // line 82
                echo "
                            ";
                // line 83
                if (twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 83)) {
                    // line 84
                    echo "                                ";
                    if (0 !== twig_compare((isset($context["poc"]) || array_key_exists("poc", $context) ? $context["poc"] : (function () { throw new RuntimeError('Variable "poc" does not exist.', 84, $this->source); })()), 0)) {
                        // line 85
                        echo "
                                <th> ";
                        // line 86
                        echo twig_escape_filter($this->env, ((isset($context["prum"]) || array_key_exists("prum", $context) ? $context["prum"] : (function () { throw new RuntimeError('Variable "prum" does not exist.', 86, $this->source); })()) / (isset($context["poc"]) || array_key_exists("poc", $context) ? $context["poc"] : (function () { throw new RuntimeError('Variable "poc" does not exist.', 86, $this->source); })())), "html", null, true);
                        echo "</th>

                                ";
                    } else {
                        // line 89
                        echo "
                                <td>";
                        // line 90
                        echo twig_escape_filter($this->env, (isset($context["prum"]) || array_key_exists("prum", $context) ? $context["prum"] : (function () { throw new RuntimeError('Variable "prum" does not exist.', 90, $this->source); })()), "html", null, true);
                        echo "</td>

                                ";
                    }
                    // line 93
                    echo "                                ";
                } else {
                    // line 94
                    echo "                                <th></th>
                            ";
                }
                // line 96
                echo "                        ";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 97
            echo "
                        ";
            // line 98
            $context["prum"] = 0;
            // line 99
            echo "                        ";
            $context["poc"] = 0;
            // line 100
            echo "                    </tr>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['p'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 102
        echo "
            </tbody>
        </table>
    </div>

";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

    }

    public function getTemplateName()
    {
        return "grades/student.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  345 => 102,  338 => 100,  335 => 99,  333 => 98,  330 => 97,  316 => 96,  312 => 94,  309 => 93,  303 => 90,  300 => 89,  294 => 86,  291 => 85,  288 => 84,  286 => 83,  283 => 82,  266 => 81,  263 => 80,  256 => 78,  247 => 74,  244 => 73,  241 => 72,  239 => 71,  236 => 70,  234 => 69,  231 => 68,  227 => 67,  222 => 65,  219 => 64,  214 => 63,  211 => 62,  209 => 61,  200 => 54,  191 => 51,  188 => 50,  184 => 49,  181 => 48,  175 => 47,  172 => 46,  169 => 45,  166 => 44,  164 => 43,  161 => 42,  155 => 41,  152 => 40,  149 => 39,  146 => 38,  141 => 37,  138 => 36,  134 => 35,  131 => 34,  129 => 33,  115 => 22,  109 => 19,  104 => 17,  97 => 13,  90 => 8,  80 => 7,  69 => 4,  59 => 3,  36 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% extends 'base.html.twig' %}

{% block title %}
Známky
{% endblock %}

{% block body %}

    <h2>Známky</h2>

    <hr>

    {{ form_start(form) }}

    <div class=\"input-group mb-3\">
        <div class=\"input-group-prepend\">
            {{ form_widget(form.vyber) }}
        </div>
        {{ form_widget(form.rok) }}
    </div>

    {{ form_end(form) }}

    <hr>

    <div class=\"shadow\" style=\"width: max-content;\">
        <table id=\"table\" data-toggle=\"table\" data-height=\"500\"
               class=\"table table-bordered table-borderless\">
            <thead class=\"thead-light\">
            <tr>
                <th data-field=\"Predmet\">Předmět</th>

                {% set Max = 0 %}

                {% for p in predmet %}
                    {% set cnt = 0 %}
                    {% for zn in p.znamka %}
                        {% if zn.datum|date(\"Y\") == rok %}
                            {% set cnt = cnt + 1 %}
                        {% endif %}
                    {% endfor %}

                    {% if cnt > Max %}
                        {% set Max = cnt %}
                    {% endif %}
                    {% set cnt = 0 %}
                {% endfor %}

                {% for i in 1..Max  %}

                    <th> {{ i }} </th>

                {% endfor %}

                <th data-field=\"Prumer\">Průměr</th>

            </tr>
            </thead>
            <tbody>

            {% set prum = 0 %}
            {% set poc = 0 %}
            {% for p in predmet %}
                    <tr>
                        <td style=\"background-color: #808080; color: #f2f2f2\">{{ p.nazev }}</td>

                        {% for zn in zak.znamka %}

                            {% if zn.predmet == p and zn.datum|date(\"Y\") == rok %}

                                {% set prum = prum + zn.hodnota %}
                                {% set poc = poc + 1 %}
                                <td>
                                    <a style=\"color: black\" href=\"{{ path('grades.show', {id: zn.id}) }}\">{{ zn.hodnota }}</a>
                                </td>

                            {% endif %}

                        {% endfor %}

                        {% for i in 0..Max - poc %}

                            {% if loop.last %}
                                {% if poc != 0 %}

                                <th> {{ prum / poc}}</th>

                                {% else %}

                                <td>{{ prum }}</td>

                                {% endif %}
                                {% else %}
                                <th></th>
                            {% endif %}
                        {% endfor %}

                        {% set prum = 0 %}
                        {% set poc = 0 %}
                    </tr>
            {% endfor %}

            </tbody>
        </table>
    </div>

{% endblock %}

", "grades/student.html.twig", "C:\\Users\\JanVe\\Desktop\\BakalarskaPrace\\www\\Thesis\\templates\\grades\\student.html.twig");
    }
}
