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

/* setting/programm_list.html.twig */
class __TwigTemplate_6a9902985d26f8a9e6539944c6de04b4 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 11
        return $this->load((isset($context["extendedTemplate"]) || array_key_exists("extendedTemplate", $context) ? $context["extendedTemplate"] : (function () { throw new RuntimeError('Variable "extendedTemplate" does not exist.', 11, $this->source); })()), 11);
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "setting/programm_list.html.twig"));

        // line 1
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 1, $this->source); })()), "session", [], "any", false, false, false, 1), "get", ["_application"], "method", false, false, false, 1) == 0)) {
            // line 2
            $context["extendedTemplate"] = "@AdminLTE/layout/mesodd-layout.html.twig";
        }
        // line 4
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4, $this->source); })()), "session", [], "any", false, false, false, 4), "get", ["_application"], "method", false, false, false, 4) == 1)) {
            // line 5
            $context["extendedTemplate"] = "@AdminLTE/layout/suiodd-layout.html.twig";
        }
        // line 7
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 7, $this->source); })()), "session", [], "any", false, false, false, 7), "get", ["_application"], "method", false, false, false, 7) == 2)) {
            // line 8
            $context["extendedTemplate"] = "@AdminLTE/layout/cfgodd-layout.html.twig";
        }
        // line 11
        yield from $this->getParent($context)->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 13
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_title"));

        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("programm.title", [], "messages");
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 16
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));

        // line 17
        yield "
";
        // line 18
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD"))) {
            // line 19
            yield "                        

        <session class=\"content\"/>
            <div class=\"container-fluid card card-default\">
                <div class=\"card-body\">
                <div class=\"text-right mb-3\">
                             <a href=\"";
            // line 25
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_programm_new");
            yield "\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> ";
            // line 26
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("programm.add", [], "messages");
            // line 27
            yield "                            </a>
                        </div>
                        
                    ";
            // line 30
            yield             $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.', 30, $this->source); })()), 'form_start');
            yield "
                        <div class=\"form-group row\">
                            ";
            // line 32
            if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 33
                yield "                                <div class=\"col-sm-4\">
                                    <label class=\"col-form-label\">Type</label>
                                    ";
                // line 35
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 35, $this->source); })()), "type", [], "any", false, false, false, 35), 'widget');
                yield "
                                </div>
                                <div class=\"col-sm-8\">
                                    <label class=\"col-form-label\">Liste Ministères/Communes</label>
                                    ";
                // line 39
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 39, $this->source); })()), "entite", [], "any", false, false, false, 39), 'widget');
                yield "
                                </div>
                                ";
            } else {
                // line 42
                yield "                                    <div class=\"col-sm-12\">
                                        <label class=\"col-form-label\">Communes</label>
                                        ";
                // line 44
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 44, $this->source); })()), "entite", [], "any", false, false, false, 44), 'widget');
                yield "
                                    </div>
                                ";
            }
            // line 46
            yield " 
                        </div>
                    ";
            // line 48
            yield             $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.', 48, $this->source); })()), 'form_end');
            yield "  
                    
                
                </div>
            </div>
        </session>
    ";
        } else {
            // line 55
            yield "                        <div class=\"text-right mb-3\">
                             <a href=\"";
            // line 56
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_programm_new");
            yield "\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> ";
            // line 57
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("programm.add", [], "messages");
            // line 58
            yield "                            </a>
                        </div>
    ";
        }
        // line 61
        yield "
";
        // line 62
        if ((($tmp = (isset($context["entite"]) || array_key_exists("entite", $context) ? $context["entite"] : (function () { throw new RuntimeError('Variable "entite" does not exist.', 62, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 63
            yield "    ";
            yield from $this->load("setting/programm_list.html.twig", 63, "5635134")->unwrap()->yield($context);
        } else {
            // line 125
            yield "    <div class=\"alert alert-info\" role=\"alert\">
        Veuillez sélectionner ";
            // line 126
            if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield " un ministère ou ";
            }
            yield " une commune pour afficher ces directions
    </div>
";
        }
        // line 129
        yield "

";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 133
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        // line 134
        yield "    <script>
        let \$type = \$('#ministry_commune_sel_type');

        \$type.change(function() {
            let \$form = \$type.closest('form');

            let data = {};
            data[\$type.attr('name')] = \$type.val();

            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    \$('#ministry_commune_sel_entite').replaceWith(
                        \$(html).find('#ministry_commune_sel_entite')
                    );
                    \$form.submit();
                }
            });
        });
    </script>
    <script src=\"";
        // line 156
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"></script>
    <script>
        \$(function () {
            \$(\"#programmTable\").DataTable({
                \"pageLength\": 25,
                \"language\": {
                    \"url\": \"";
        // line 162
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"
                }
            });
        });
    </script>

    <script src=\"";
        // line 168
        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 169
        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>
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 172
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));

        // line 173
        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 "\">
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  294 => 173,  284 => 172,  274 => 169,  270 => 168,  261 => 162,  252 => 156,  228 => 134,  218 => 133,  208 => 129,  200 => 126,  197 => 125,  193 => 63,  191 => 62,  188 => 61,  183 => 58,  181 => 57,  177 => 56,  174 => 55,  164 => 48,  160 => 46,  154 => 44,  150 => 42,  144 => 39,  137 => 35,  133 => 33,  131 => 32,  126 => 30,  121 => 27,  119 => 26,  115 => 25,  107 => 19,  105 => 18,  102 => 17,  92 => 16,  75 => 13,  68 => 11,  65 => 8,  63 => 7,  60 => 5,  58 => 4,  55 => 2,  53 => 1,  43 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% if app.session.get('_application') == 0 %}
    {% set extendedTemplate = '@AdminLTE/layout/mesodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 1 %}
    {% set extendedTemplate = '@AdminLTE/layout/suiodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 2 %}
    {% set extendedTemplate = '@AdminLTE/layout/cfgodd-layout.html.twig' %}
{% endif %}

{% extends extendedTemplate %}

{% block page_title %}{% trans %}programm.title{% endtrans %}{% endblock %}


{% block page_content %}

{% if (is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD')) %}
                        

        <session class=\"content\"/>
            <div class=\"container-fluid card card-default\">
                <div class=\"card-body\">
                <div class=\"text-right mb-3\">
                             <a href=\"{{ path('app_programm_new') }}\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> {% trans %}programm.add{% endtrans %}
                            </a>
                        </div>
                        
                    {{ form_start(form) }}
                        <div class=\"form-group row\">
                            {% if is_granted('ROLE_MANAGER') %}
                                <div class=\"col-sm-4\">
                                    <label class=\"col-form-label\">Type</label>
                                    {{ form_widget(form.type) }}
                                </div>
                                <div class=\"col-sm-8\">
                                    <label class=\"col-form-label\">Liste Ministères/Communes</label>
                                    {{ form_widget(form.entite) }}
                                </div>
                                {%  else %}
                                    <div class=\"col-sm-12\">
                                        <label class=\"col-form-label\">Communes</label>
                                        {{ form_widget(form.entite) }}
                                    </div>
                                {% endif %} 
                        </div>
                    {{ form_end(form) }}  
                    
                
                </div>
            </div>
        </session>
    {% else %}
                        <div class=\"text-right mb-3\">
                             <a href=\"{{ path('app_programm_new') }}\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> {% trans %}programm.add{% endtrans %}
                            </a>
                        </div>
    {% endif %}

{% if entite %}
    {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
        {% block box_body %}
            <table id=\"programmTable\" class=\"table table-striped\">
            <thead>
                <th>{% trans %}basics.code{% endtrans %}</th>
                <th>{% trans %}basics.name{% endtrans %}</th>
                <th>{% trans %}basics.year{% endtrans %}</th>
                <th style=\"width: 80px\">{% trans %}basics.uploadkey{% endtrans %}</th>
                <th style=\"width: 100px\"></th>
            </thead>
            <tbody>
            {% for programm in programms %}
                <tr>
                    <td>{{ programm.code }}</td>
                    <td>{{ programm.name }}</td>
                    <td>{{ programm.years ? max(programm.years) : ''  }}</td>
                    {% if programm.ministry %}
                        <td>M{{ \"%02d\"|format(programm.ministry.id) }}-P{{ \"%05d\"|format(programm.id) }}</td>
                    {% else %}
                        <td>C{{ \"%02d\"|format(programm.commune.id) }}-P{{ \"%05d\"|format(programm.id) }}</td>
                    {% endif %}
                    <td class=\"text-center\">
                        <div class=\"btn-group\">
                            <a href=\"{{ path('app_programm', { 'id': programm.id }) }}\" class=\"btn btn-sm btn-default\" role=\"button\" aria-pressed=\"true\">{% trans %}basics.update{% endtrans %}</a>
                            <button type=\"button\" class=\"btn btn-sm btn-default dropdown-toggle\" data-toggle=\"dropdown\">
                                <span class=\"caret\"></span>
                                <span class=\"sr-only\">Toggle Dropdown</span>
                            </button>
                            <div class=\"dropdown-menu\" role=\"menu\">
                                <a class=\"dropdown-item\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-{{ programm.id }}\">{% trans %}basics.delete{% endtrans %}</a>
                            </div>

                            <div class=\"modal fade\" id=\"modal-delete-{{ programm.id }}\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">{% trans %}basics.delete.title{% endtrans %}</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>{% trans %}programm.delete.message{% endtrans %}</p>
                                            <b>{{ programm.code }}<br>{{ programm.name }}</b>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{% trans %}basics.no{% endtrans %}</button>
                                            <a href=\"{{ path('app_programm_delete', { 'id': programm.id }) }}\" class=\"btn btn-danger\">{% trans %}basics.yes{% endtrans %}</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
            </table>
        {% endblock %}
    {% endembed %}
{% else %}
    <div class=\"alert alert-info\" role=\"alert\">
        Veuillez sélectionner {% if is_granted('ROLE_MANAGER') %} un ministère ou {% endif %} une commune pour afficher ces directions
    </div>
{% endif %}


{% endblock %}

{% block javascripts %}
    <script>
        let \$type = \$('#ministry_commune_sel_type');

        \$type.change(function() {
            let \$form = \$type.closest('form');

            let data = {};
            data[\$type.attr('name')] = \$type.val();

            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    \$('#ministry_commune_sel_entite').replaceWith(
                        \$(html).find('#ministry_commune_sel_entite')
                    );
                    \$form.submit();
                }
            });
        });
    </script>
    <script src=\"{{ asset('plugins/datatables/French.json') }}\"></script>
    <script>
        \$(function () {
            \$(\"#programmTable\").DataTable({
                \"pageLength\": 25,
                \"language\": {
                    \"url\": \"{{ asset('plugins/datatables/French.json') }}\"
                }
            });
        });
    </script>

    <script src=\"{{ asset('plugins/datatables/jquery.dataTables.js') }}\"></script>
    <script src=\"{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.js') }}\"></script>
{% endblock %}

{% block stylesheets %}
    <link rel=\"stylesheet\" href=\"{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.css') }}\">
{% endblock %}", "setting/programm_list.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/setting/programm_list.html.twig");
    }
}


/* setting/programm_list.html.twig */
class __TwigTemplate_6a9902985d26f8a9e6539944c6de04b4___5635134 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 63
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "setting/programm_list.html.twig"));

        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 63);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 64
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "box_body"));

        // line 65
        yield "            <table id=\"programmTable\" class=\"table table-striped\">
            <thead>
                <th>";
        // line 67
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.code", [], "messages");
        yield "</th>
                <th>";
        // line 68
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.name", [], "messages");
        yield "</th>
                <th>";
        // line 69
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.year", [], "messages");
        yield "</th>
                <th style=\"width: 80px\">";
        // line 70
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.uploadkey", [], "messages");
        yield "</th>
                <th style=\"width: 100px\"></th>
            </thead>
            <tbody>
            ";
        // line 74
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable((isset($context["programms"]) || array_key_exists("programms", $context) ? $context["programms"] : (function () { throw new RuntimeError('Variable "programms" does not exist.', 74, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["programm"]) {
            // line 75
            yield "                <tr>
                    <td>";
            // line 76
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "code", [], "any", false, false, false, 76), "html", null, true);
            yield "</td>
                    <td>";
            // line 77
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "name", [], "any", false, false, false, 77), "html", null, true);
            yield "</td>
                    <td>";
            // line 78
            yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "years", [], "any", false, false, false, 78)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(max(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "years", [], "any", false, false, false, 78)), "html", null, true)) : (""));
            yield "</td>
                    ";
            // line 79
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "ministry", [], "any", false, false, false, 79)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 80
                yield "                        <td>M";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%02d", CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "ministry", [], "any", false, false, false, 80), "id", [], "any", false, false, false, 80)), "html", null, true);
                yield "-P";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%05d", CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 80)), "html", null, true);
                yield "</td>
                    ";
            } else {
                // line 82
                yield "                        <td>C";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%02d", CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "commune", [], "any", false, false, false, 82), "id", [], "any", false, false, false, 82)), "html", null, true);
                yield "-P";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%05d", CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 82)), "html", null, true);
                yield "</td>
                    ";
            }
            // line 84
            yield "                    <td class=\"text-center\">
                        <div class=\"btn-group\">
                            <a href=\"";
            // line 86
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_programm", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 86)]), "html", null, true);
            yield "\" class=\"btn btn-sm btn-default\" role=\"button\" aria-pressed=\"true\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.update", [], "messages");
            yield "</a>
                            <button type=\"button\" class=\"btn btn-sm btn-default dropdown-toggle\" data-toggle=\"dropdown\">
                                <span class=\"caret\"></span>
                                <span class=\"sr-only\">Toggle Dropdown</span>
                            </button>
                            <div class=\"dropdown-menu\" role=\"menu\">
                                <a class=\"dropdown-item\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-";
            // line 92
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 92), "html", null, true);
            yield "\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete", [], "messages");
            yield "</a>
                            </div>

                            <div class=\"modal fade\" id=\"modal-delete-";
            // line 95
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 95), "html", null, true);
            yield "\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">";
            // line 99
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete.title", [], "messages");
            yield "</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>";
            // line 105
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("programm.delete.message", [], "messages");
            yield "</p>
                                            <b>";
            // line 106
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "code", [], "any", false, false, false, 106), "html", null, true);
            yield "<br>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "name", [], "any", false, false, false, 106), "html", null, true);
            yield "</b>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">";
            // line 109
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.no", [], "messages");
            yield "</button>
                                            <a href=\"";
            // line 110
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_programm_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["programm"], "id", [], "any", false, false, false, 110)]), "html", null, true);
            yield "\" class=\"btn btn-danger\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.yes", [], "messages");
            yield "</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </td>
                </tr>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['programm'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 120
        yield "            </tbody>
            </table>
        ";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  691 => 120,  673 => 110,  669 => 109,  661 => 106,  657 => 105,  648 => 99,  641 => 95,  633 => 92,  622 => 86,  618 => 84,  610 => 82,  602 => 80,  600 => 79,  596 => 78,  592 => 77,  588 => 76,  585 => 75,  581 => 74,  574 => 70,  570 => 69,  566 => 68,  562 => 67,  558 => 65,  548 => 64,  531 => 63,  294 => 173,  284 => 172,  274 => 169,  270 => 168,  261 => 162,  252 => 156,  228 => 134,  218 => 133,  208 => 129,  200 => 126,  197 => 125,  193 => 63,  191 => 62,  188 => 61,  183 => 58,  181 => 57,  177 => 56,  174 => 55,  164 => 48,  160 => 46,  154 => 44,  150 => 42,  144 => 39,  137 => 35,  133 => 33,  131 => 32,  126 => 30,  121 => 27,  119 => 26,  115 => 25,  107 => 19,  105 => 18,  102 => 17,  92 => 16,  75 => 13,  68 => 11,  65 => 8,  63 => 7,  60 => 5,  58 => 4,  55 => 2,  53 => 1,  43 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% if app.session.get('_application') == 0 %}
    {% set extendedTemplate = '@AdminLTE/layout/mesodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 1 %}
    {% set extendedTemplate = '@AdminLTE/layout/suiodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 2 %}
    {% set extendedTemplate = '@AdminLTE/layout/cfgodd-layout.html.twig' %}
{% endif %}

{% extends extendedTemplate %}

{% block page_title %}{% trans %}programm.title{% endtrans %}{% endblock %}


{% block page_content %}

{% if (is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD')) %}
                        

        <session class=\"content\"/>
            <div class=\"container-fluid card card-default\">
                <div class=\"card-body\">
                <div class=\"text-right mb-3\">
                             <a href=\"{{ path('app_programm_new') }}\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> {% trans %}programm.add{% endtrans %}
                            </a>
                        </div>
                        
                    {{ form_start(form) }}
                        <div class=\"form-group row\">
                            {% if is_granted('ROLE_MANAGER') %}
                                <div class=\"col-sm-4\">
                                    <label class=\"col-form-label\">Type</label>
                                    {{ form_widget(form.type) }}
                                </div>
                                <div class=\"col-sm-8\">
                                    <label class=\"col-form-label\">Liste Ministères/Communes</label>
                                    {{ form_widget(form.entite) }}
                                </div>
                                {%  else %}
                                    <div class=\"col-sm-12\">
                                        <label class=\"col-form-label\">Communes</label>
                                        {{ form_widget(form.entite) }}
                                    </div>
                                {% endif %} 
                        </div>
                    {{ form_end(form) }}  
                    
                
                </div>
            </div>
        </session>
    {% else %}
                        <div class=\"text-right mb-3\">
                             <a href=\"{{ path('app_programm_new') }}\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> {% trans %}programm.add{% endtrans %}
                            </a>
                        </div>
    {% endif %}

{% if entite %}
    {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
        {% block box_body %}
            <table id=\"programmTable\" class=\"table table-striped\">
            <thead>
                <th>{% trans %}basics.code{% endtrans %}</th>
                <th>{% trans %}basics.name{% endtrans %}</th>
                <th>{% trans %}basics.year{% endtrans %}</th>
                <th style=\"width: 80px\">{% trans %}basics.uploadkey{% endtrans %}</th>
                <th style=\"width: 100px\"></th>
            </thead>
            <tbody>
            {% for programm in programms %}
                <tr>
                    <td>{{ programm.code }}</td>
                    <td>{{ programm.name }}</td>
                    <td>{{ programm.years ? max(programm.years) : ''  }}</td>
                    {% if programm.ministry %}
                        <td>M{{ \"%02d\"|format(programm.ministry.id) }}-P{{ \"%05d\"|format(programm.id) }}</td>
                    {% else %}
                        <td>C{{ \"%02d\"|format(programm.commune.id) }}-P{{ \"%05d\"|format(programm.id) }}</td>
                    {% endif %}
                    <td class=\"text-center\">
                        <div class=\"btn-group\">
                            <a href=\"{{ path('app_programm', { 'id': programm.id }) }}\" class=\"btn btn-sm btn-default\" role=\"button\" aria-pressed=\"true\">{% trans %}basics.update{% endtrans %}</a>
                            <button type=\"button\" class=\"btn btn-sm btn-default dropdown-toggle\" data-toggle=\"dropdown\">
                                <span class=\"caret\"></span>
                                <span class=\"sr-only\">Toggle Dropdown</span>
                            </button>
                            <div class=\"dropdown-menu\" role=\"menu\">
                                <a class=\"dropdown-item\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-{{ programm.id }}\">{% trans %}basics.delete{% endtrans %}</a>
                            </div>

                            <div class=\"modal fade\" id=\"modal-delete-{{ programm.id }}\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">{% trans %}basics.delete.title{% endtrans %}</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>{% trans %}programm.delete.message{% endtrans %}</p>
                                            <b>{{ programm.code }}<br>{{ programm.name }}</b>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{% trans %}basics.no{% endtrans %}</button>
                                            <a href=\"{{ path('app_programm_delete', { 'id': programm.id }) }}\" class=\"btn btn-danger\">{% trans %}basics.yes{% endtrans %}</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
            </table>
        {% endblock %}
    {% endembed %}
{% else %}
    <div class=\"alert alert-info\" role=\"alert\">
        Veuillez sélectionner {% if is_granted('ROLE_MANAGER') %} un ministère ou {% endif %} une commune pour afficher ces directions
    </div>
{% endif %}


{% endblock %}

{% block javascripts %}
    <script>
        let \$type = \$('#ministry_commune_sel_type');

        \$type.change(function() {
            let \$form = \$type.closest('form');

            let data = {};
            data[\$type.attr('name')] = \$type.val();

            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    \$('#ministry_commune_sel_entite').replaceWith(
                        \$(html).find('#ministry_commune_sel_entite')
                    );
                    \$form.submit();
                }
            });
        });
    </script>
    <script src=\"{{ asset('plugins/datatables/French.json') }}\"></script>
    <script>
        \$(function () {
            \$(\"#programmTable\").DataTable({
                \"pageLength\": 25,
                \"language\": {
                    \"url\": \"{{ asset('plugins/datatables/French.json') }}\"
                }
            });
        });
    </script>

    <script src=\"{{ asset('plugins/datatables/jquery.dataTables.js') }}\"></script>
    <script src=\"{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.js') }}\"></script>
{% endblock %}

{% block stylesheets %}
    <link rel=\"stylesheet\" href=\"{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.css') }}\">
{% endblock %}", "setting/programm_list.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/setting/programm_list.html.twig");
    }
}
