<?php

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

/* @App/TimeClock/tipopermiso/index.html.twig */
class __TwigTemplate_cffd2dd162b2411ff653ef5c19da77a9dfa03680b13190e70a1659103016ea24 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("@App/Layouts/layout.html.twig", "@App/TimeClock/tipopermiso/index.html.twig", 1);
        $this->blocks = [
            'content' => [$this, 'block_content'],
            'javascripts' => [$this, 'block_javascripts'],
        ];
    }

    protected function doGetParent(array $context)
    {
        return "@App/Layouts/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@App/TimeClock/tipopermiso/index.html.twig"));

        $this->parent->display($context, array_merge($this->blocks, $blocks));
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    // line 3
    public function block_content($context, array $blocks = [])
    {
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));

        // line 4
        echo "    <div class=\"container\">
        <h1>Permisos</h1>
        <div align=\"center\">
            <button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#myModal\">Crear Permiso
            </button>
            <div id=\"permisos_filas\"></div>
        </div>

        <div class=\"modal fade\" id=\"myModal\" role=\"dialog\">
            <div class=\"modal-dialog\">

                <div class=\"modal-content\">
                    <div class=\"modal-header\">
                        <button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>
                        <h4 class=\"modal-title\">Crear Permiso</h4>
                    </div>

                    <div class=\"modal-body\">
                        <div class=\"form-horizontal\">
                            <div class=\"form-group\">
                                ";
        // line 24
        echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "name", []), 'label', ["label_attr" => ["class" => "col-sm-2 control-label"], "label" => "Nombre Permiso"]);
        echo "
                                <div class=\"col-sm-5\">
                                    ";
        // line 26
        echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "name", []), 'widget');
        echo "
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=\"modal-footer\">
                        <a class=\"btn btn-primary\" id=\"submit\">Enviar</a>
                        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    // line 40
    public function block_javascripts($context, array $blocks = [])
    {
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        // line 41
        echo "    ";
        $this->displayParentBlock("javascripts", $context, $blocks);
        echo "
    <script type=\"text/javascript\">
        \$(document).ready(function () {

            \$('#submit').click(function () {
                let name = \$('#backendbundle_typeofpermitsrequired_name').val();

                \$.ajax(
                    {
                        type: 'POST',
                        url: '";
        // line 51
        echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getUrl("timeclock_permitsrequired_new");
        echo "',
                        data:
                            {
                                'name': name
                            },
                        dataType: 'json',
                        success: function (data) {
                            \$('.modal').modal('toggle');
                        }
                    }
                )
            });

            function permits() {
                \$.ajax
                (
                    {
                        url: '";
        // line 68
        echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getUrl("timeclock_permits_index");
        echo "',
                        dataType: 'json'
                    }
                )
                    .done(function (data) {
                        let permit = JSON.parse(data.data);
                        var html = \"\";

                        html += '<br>';
                        html += '<br>';
                        html += '<table class=\"table table-bordered\" id=\"mytable\">';
                        html += '<thead>';
                        html += '<tr class=\"text-center\">';
                        html += '<th>ID</th>';
                        html += '<th>Nombre Permiso</th>';
                        html += '<th>Accion</th>';
                        html += '</tr>';
                        html += '</thead>';
                        html += '<tbody>';

                        for (pp in permit)
                        {
                            let permits = permit[pp];
                            var url = '";
        // line 91
        echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath("timeclock_permitsrequired_edit", ["idTypeOfPermits" => "idTypeOfPermit"]);
        echo "';
                            url = url.replace(\"idTypeOfPermit\", permits['idTypeOfPermits']);

                            html += '<tr>';
                            html += '<td>' + permits['idTypeOfPermits'] + '</td>';
                            html += '<td>' + permits['name'] + '</td>';
                            html += '<td>' + '<a  href=\"' + url + '\" class=\"btn btn-warning\">Editar</a>' + '</td>';
                            html += '</tr>';
                        }
                        html += '</tbody>';
                        html += '</table>';

                        \$('#permisos_filas').html(html);
                    })
            }

            setInterval(function () {
                permits();
            }, 1000);
        });
    </script>
";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    public function getTemplateName()
    {
        return "@App/TimeClock/tipopermiso/index.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  166 => 91,  140 => 68,  120 => 51,  106 => 41,  100 => 40,  79 => 26,  74 => 24,  52 => 4,  46 => 3,  22 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Source("{% extends \"@App/Layouts/layout.html.twig\" %}

{% block content %}
    <div class=\"container\">
        <h1>Permisos</h1>
        <div align=\"center\">
            <button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#myModal\">Crear Permiso
            </button>
            <div id=\"permisos_filas\"></div>
        </div>

        <div class=\"modal fade\" id=\"myModal\" role=\"dialog\">
            <div class=\"modal-dialog\">

                <div class=\"modal-content\">
                    <div class=\"modal-header\">
                        <button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>
                        <h4 class=\"modal-title\">Crear Permiso</h4>
                    </div>

                    <div class=\"modal-body\">
                        <div class=\"form-horizontal\">
                            <div class=\"form-group\">
                                {{ form_label(form.name,'Nombre Permiso',{'label_attr':{'class':'col-sm-2 control-label'}}) }}
                                <div class=\"col-sm-5\">
                                    {{ form_widget(form.name) }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class=\"modal-footer\">
                        <a class=\"btn btn-primary\" id=\"submit\">Enviar</a>
                        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block javascripts %}
    {{ parent() }}
    <script type=\"text/javascript\">
        \$(document).ready(function () {

            \$('#submit').click(function () {
                let name = \$('#backendbundle_typeofpermitsrequired_name').val();

                \$.ajax(
                    {
                        type: 'POST',
                        url: '{{ url('timeclock_permitsrequired_new') }}',
                        data:
                            {
                                'name': name
                            },
                        dataType: 'json',
                        success: function (data) {
                            \$('.modal').modal('toggle');
                        }
                    }
                )
            });

            function permits() {
                \$.ajax
                (
                    {
                        url: '{{ url('timeclock_permits_index') }}',
                        dataType: 'json'
                    }
                )
                    .done(function (data) {
                        let permit = JSON.parse(data.data);
                        var html = \"\";

                        html += '<br>';
                        html += '<br>';
                        html += '<table class=\"table table-bordered\" id=\"mytable\">';
                        html += '<thead>';
                        html += '<tr class=\"text-center\">';
                        html += '<th>ID</th>';
                        html += '<th>Nombre Permiso</th>';
                        html += '<th>Accion</th>';
                        html += '</tr>';
                        html += '</thead>';
                        html += '<tbody>';

                        for (pp in permit)
                        {
                            let permits = permit[pp];
                            var url = '{{ path(\"timeclock_permitsrequired_edit\", {'idTypeOfPermits': 'idTypeOfPermit'}) }}';
                            url = url.replace(\"idTypeOfPermit\", permits['idTypeOfPermits']);

                            html += '<tr>';
                            html += '<td>' + permits['idTypeOfPermits'] + '</td>';
                            html += '<td>' + permits['name'] + '</td>';
                            html += '<td>' + '<a  href=\"' + url + '\" class=\"btn btn-warning\">Editar</a>' + '</td>';
                            html += '</tr>';
                        }
                        html += '</tbody>';
                        html += '</table>';

                        \$('#permisos_filas').html(html);
                    })
            }

            setInterval(function () {
                permits();
            }, 1000);
        });
    </script>
{% endblock %}
", "@App/TimeClock/tipopermiso/index.html.twig", "/home/newcolmoda/public_html/CMDA/src/AppBundle/Resources/views/TimeClock/tipopermiso/index.html.twig");
    }
}
