<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;
use Twig\TemplateWrapper;

/* suivi_ind/suivi_list.html.twig */
class __TwigTemplate_afaef22a199db7bb441dc6d68b78e1d3 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'page_title' => [$this, 'block_page_title'],
            'page_content' => [$this, 'block_page_content'],
            'javascripts' => [$this, 'block_javascripts'],
            'stylesheets' => [$this, 'block_stylesheets'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@AdminLTE/layout/suiodd-layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/layout/suiodd-layout.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("suivi.indicateur.title", [], "messages");
        yield from [];
    }

    // line 6
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 7
        yield "    ";
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 8
            yield "
    ";
        } elseif ((($tmp =         // line 9
($context["etat"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 10
            yield "            <div class=\"row\">
                <div class=\"col-sm-12\">
                    <div class=\"text-right\">
                        <button type=\"button\" class=\"mb-2 mr-2 btn-shadow  btn btn-danger text-right\" data-toggle=\"modal\" data-target=\"#valideModal\">
                            <i class=\"fa fa-check\"></i> ";
            // line 14
            yield (((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_FOCAL")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("Soumettre") : ("Valider"));
            yield "
                        </button>
                    </div>
                </div>
            </div>
    ";
        }
        // line 20
        yield "    

    ";
        // line 22
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 23
            yield "    ";
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
            ";
            // line 24
            yield from $this->load("suivi_ind/suivi_list.html.twig", 24, 1046144461)->unwrap()->yield($context);
            // line 29
            yield "    ";
        }
        // line 30
        yield "     
        ";
        // line 31
        if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["indicators"] ?? null)) > 0)) {
            // line 32
            yield "        ";
            yield from $this->load("suivi_ind/suivi_list.html.twig", 32, 2121990601)->unwrap()->yield($context);
            // line 78
            yield "  
        ";
        }
        // line 80
        yield "
    ";
        // line 81
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield "          
    ";
            // line 82
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "
    ";
        }
        // line 84
        yield "
        <!-- Valide Modal -->
        <div class=\"modal fade\" id=\"valideModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myLargeModalLabel\" aria-hidden=\"true\">
            <div class=\"modal-dialog modal-lg\">
                <div class=\"modal-content\">
                    <div class=\"modal-header\">
                        <h5 class=\"modal-title h4\" id=\"myLargeModalLabel\">";
        // line 90
        yield (((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_FOCAL")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("Soumission") : ("Validation"));
        yield " des données de ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 90), "get", ["_year"], "method", false, false, false, 90), "html", null, true);
        yield "</h5>
                        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                        <span aria-hidden=\"true\">&times;</span>
                        </button>
                    </div>
                    <form action=\"";
        // line 95
        yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_ministere_validation");
        yield "\" method=\"post\" enctype=\"multipart/form-data\">
                    <div class=\"modal-body\">
                           Vous êtes sur le point de ";
        // line 97
        yield (((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_FOCAL")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("soumettre") : ("valider"));
        yield " vos données. Vous ne pouvez plus les modifier.
                    </div>
                    <div class=\"modal-footer\">
                        <button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Annuler</button>
                        <button type=\"submit\" class=\"btn btn-success\">";
        // line 101
        yield (((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_FOCAL")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("Soumettre") : ("Valider"));
        yield "</button>
                    </div>
                    </form>
                </div>
            </div>   
        </div>

";
        yield from [];
    }

    // line 110
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 111
        yield "    <script>
        
        \$(document).on('change', '#evaluation_ministry, #evaluation_programm', function () {
            let \$ministry = \$('#evaluation_ministry')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$ministry.attr('name')] = \$ministry.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_ministry') {
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );

    </script>

    <script src=\"";
        // line 204
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/jquery.dataTables.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 205
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/js/dataTables.bootstrap4.js"), "html", null, true);
        yield "\"></script>

";
        yield from [];
    }

    // line 209
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 210
        yield "    <link rel=\"stylesheet\" href=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/css/dataTables.bootstrap4.css"), "html", null, true);
        yield "\">
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "suivi_ind/suivi_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  299 => 210,  292 => 209,  284 => 205,  280 => 204,  185 => 111,  178 => 110,  165 => 101,  158 => 97,  153 => 95,  143 => 90,  135 => 84,  130 => 82,  126 => 81,  123 => 80,  119 => 78,  116 => 32,  114 => 31,  111 => 30,  108 => 29,  106 => 24,  101 => 23,  99 => 22,  95 => 20,  86 => 14,  80 => 10,  78 => 9,  75 => 8,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "suivi_ind/suivi_list.html.twig", "/var/www/html/templates/suivi_ind/suivi_list.html.twig");
    }
}


/* suivi_ind/suivi_list.html.twig */
class __TwigTemplate_afaef22a199db7bb441dc6d68b78e1d3___1046144461 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 24
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 24);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 25
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 26
        yield "                    ";
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(($context["form"] ?? null), 'widget');
        yield "
                ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "suivi_ind/suivi_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  378 => 26,  371 => 25,  360 => 24,  299 => 210,  292 => 209,  284 => 205,  280 => 204,  185 => 111,  178 => 110,  165 => 101,  158 => 97,  153 => 95,  143 => 90,  135 => 84,  130 => 82,  126 => 81,  123 => 80,  119 => 78,  116 => 32,  114 => 31,  111 => 30,  108 => 29,  106 => 24,  101 => 23,  99 => 22,  95 => 20,  86 => 14,  80 => 10,  78 => 9,  75 => 8,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "suivi_ind/suivi_list.html.twig", "/var/www/html/templates/suivi_ind/suivi_list.html.twig");
    }
}


/* suivi_ind/suivi_list.html.twig */
class __TwigTemplate_afaef22a199db7bb441dc6d68b78e1d3___2121990601 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 32
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 32);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 33
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 34
        yield "                <table id=\"suiviIndicateurTable\" class=\"table table-striped\">
                <thead>
                    <th>
                        <div class=\"row mt-2 mb-2\">
                            <div class=\"col-2\">Cible</div>
                            <div class=\"col-3\">Indicateur</div>
                            <div class=\"col-6\">
                                ";
        // line 41
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(range(4, 0));
        foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
            // line 42
            yield "                                <div class=\"col-2 float-left text-center\">";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($context["year"] ?? null) - $context["i"]), "html", null, true);
            yield "</div>
                                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['i'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 44
        yield "                                <div class=\"col-2 float-left text-center\">Val. cible</div>
                            </div>
                            
                            <div class=\"col-1 text-center\"></div>
                        </div>
                    </th>
                </thead>

                ";
        // line 52
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["indicators"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["indicator"]) {
            // line 53
            yield "                <tr>
                    <td>
                        <div class=\"row mt-2 mb-2\">
                            <div class=\"col-2\">";
            // line 56
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "target", [], "any", false, false, false, 56), "html", null, true);
            yield "</div>
                            <div class=\"col-3\">";
            // line 57
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["indicator"], "html", null, true);
            yield "</div>
                            <div class=\"col-6\">
                                ";
            // line 59
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(range(4, 0));
            foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                // line 60
                yield "                                <div class=\"col-2 float-left text-center\">";
                yield (((($tmp = (($_v0 = (($_v1 = ($context["suivis"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "id", [], "any", false, false, false, 60)] ?? null) : null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0[(($context["year"] ?? null) - $context["i"])] ?? null) : null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v2 = (($_v3 = ($context["suivis"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "id", [], "any", false, false, false, 60)] ?? null) : null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2[(($context["year"] ?? null) - $context["i"])] ?? null) : null), "html", null, true)) : ("-"));
                yield "</div>
                                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['i'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 62
            yield "                                <div class=\"col-2 float-left text-center\"><b>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "maxValue", [], "any", false, false, false, 62), "html", null, true);
            yield "</b></div>
                                
                                <div class=\"col-12 float-left\"><hr>";
            // line 64
            yield (($_v4 = (($_v5 = ($context["suivis"] ?? null)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5[CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "id", [], "any", false, false, false, 64)] ?? null) : null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["observation"] ?? null) : null);
            yield "</div>
                            </div>
                            
                            <div class=\"col-1 text-center\">
                            ";
            // line 69
            yield "                                <a href=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_indice_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["indicator"], "id", [], "any", false, false, false, 69)]), "html", null, true);
            yield "\" class=\"btn btn-sm btn-secondary\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.update", [], "messages");
            yield "</a>
                            ";
            // line 71
            yield "                            </div>
                        </div>
                    </td>
                </tr>
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['indicator'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 76
        yield "                </table>
            ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "suivi_ind/suivi_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  550 => 76,  540 => 71,  533 => 69,  526 => 64,  520 => 62,  511 => 60,  507 => 59,  502 => 57,  498 => 56,  493 => 53,  489 => 52,  479 => 44,  470 => 42,  466 => 41,  457 => 34,  450 => 33,  439 => 32,  378 => 26,  371 => 25,  360 => 24,  299 => 210,  292 => 209,  284 => 205,  280 => 204,  185 => 111,  178 => 110,  165 => 101,  158 => 97,  153 => 95,  143 => 90,  135 => 84,  130 => 82,  126 => 81,  123 => 80,  119 => 78,  116 => 32,  114 => 31,  111 => 30,  108 => 29,  106 => 24,  101 => 23,  99 => 22,  95 => 20,  86 => 14,  80 => 10,  78 => 9,  75 => 8,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "suivi_ind/suivi_list.html.twig", "/var/www/html/templates/suivi_ind/suivi_list.html.twig");
    }
}
