var/cache/dev/twig/aa/aaebc2ff6ece9d8f6be218a882aa8dfdefc29a777376322bbb04586e49e509a7.php line 39

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* pages/Operario/index.html.twig */
  14. class __TwigTemplate_b454112c627e05954a6007e15e591ca46f9f3db581574d30b9268bac42ee0c78 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'body' => [$this'block_body'],
  24.             'javascripts' => [$this'block_javascripts'],
  25.         ];
  26.     }
  27.     protected function doGetParent(array $context)
  28.     {
  29.         // line 1
  30.         return "base_operario.html.twig";
  31.     }
  32.     protected function doDisplay(array $context, array $blocks = [])
  33.     {
  34.         $macros $this->macros;
  35.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  36.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""pages/Operario/index.html.twig"));
  37.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  38.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""pages/Operario/index.html.twig"));
  39.         $this->parent $this->loadTemplate("base_operario.html.twig""pages/Operario/index.html.twig"1);
  40.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  41.         
  42.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  43.         
  44.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  45.     }
  46.     // line 2
  47.     public function block_body($context, array $blocks = [])
  48.     {
  49.         $macros $this->macros;
  50.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  51.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  52.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  53.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  54.         // line 3
  55.         echo "
  56. <div class=\"d-flex flex-center flex-column-fluid\">
  57.     <!--begin::Signin-->
  58.     <div class=\"login-form login-signin\">
  59.         <!--begin::Form-->
  60.         <div class=\"bg-white rounded p-10\">
  61.             <div class=\"d-flex flex-column h-100 justify-content-center text-center\">
  62.                 <div class=\"pt-lg-0 pt-5 text-center\">
  63.                     <div class=\"text-center mb-10\" >
  64.                         <img class=\"p-3\" width=\"100%\" src=\"/imagenes/logos/logo-javier-ramos-ret.png\" alt=\"\" />
  65.                     </div>
  66.                 </div>
  67.             </div>
  68.             <!--begin::Card-->
  69.             <div class=\"card card-custom card-fit card-border\">
  70.                 <div class=\"card-body mt-5\">
  71.                     <div class=\"form-group\">
  72.                         <label for=\"codigo\" class=\"required\">
  73.                             Código de producción:
  74.                         </label>
  75.                         <input type=\"text\" id=\"codigo\" name=\"codigo\" required=\"required\" maxlength=\"255\" class=\"form-control codigo\">
  76.                     </div>
  77.                     <!--end::Form group-->
  78.                     <!--begin::Action-->
  79.                     <div class=\"pb-lg-0 pb-5 text-center\">
  80.                         <button id=\"buscar_cod\" name=\"buscar_cod\" class=\"btn btn-twitter btn buscar_cod\" data_icon_before=\"fas fa-search\">
  81.                             <span class=\"fas fa-search\"></span> 
  82.                             Buscar
  83.                         </button>
  84.                     </div>
  85.                 </div>
  86.             </div>
  87.             <!--end::Card-->
  88.         </div>
  89.         <!--end::Form-->
  90.     </div>
  91.     <!--end::Signin-->
  92. </div>
  93. ";
  94.         // line 43
  95.         echo "<div class=\"modal fade\" id=\"exampleModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\" data-backdrop=\"false\" data-keyboard=\"false\">
  96.     <div class=\"modal-dialog modal-xl\" role=\"document\">
  97.         <div class=\"modal-content\">
  98.             <div class=\"modal-body\">
  99.             </div>
  100.         </div>
  101.     </div>
  102. </div>
  103. ";
  104.         
  105.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  106.         
  107.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  108.     }
  109.     // line 54
  110.     public function block_javascripts($context, array $blocks = [])
  111.     {
  112.         $macros $this->macros;
  113.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  114.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  115.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  116.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  117.         // line 55
  118.         $this->displayParentBlock("javascripts"$context$blocks);
  119.         echo "
  120. <script>
  121. var modal_loader = '";
  122.         // line 58
  123.         echo twig_include($this->env$context"includes/partials/_loader_css_js.html.twig", ["loader_id" => "loader_animation""loader_text" => "Cargando...""loader_class" => "text-center m-4"]);
  124.         echo "';
  125. \$(document).ready(function(){
  126.     // Capturar el cambio de código
  127.     \$('.buscar_cod').on('click', function(e){
  128.         e.preventDefault();
  129.         var codigo = \$('.codigo').val();
  130.         //console.log('Código del proceso: '+codigo);
  131.         \$.ajax({
  132.             type        : \"POST\",
  133.             url         : Routing.generate('ajax_regprofase_search_code', {'codigo' : codigo}),
  134.             data        : \$(this).serialize(),
  135.             dataType    : \"json\",
  136.             cache       : false,
  137.             beforeSend  : function (obj) {
  138.                 \$('#exampleModal .modal-header').remove();
  139.                 \$('#exampleModal .modal_footer').remove();
  140.                 \$('#loader_animation').removeClass('d-none');
  141.                 \$('#exampleModal').modal('show');
  142.                 \$('#exampleModal .modal-body').html(modal_loader);
  143.             },
  144.             success     : function (obj) {
  145.                 //console.log(obj);
  146.                 \$('#loader_animation').addClass('d-none');
  147.                 \$('#exampleModal').html(obj.html);
  148.                 updateMinutosFase();
  149.             },
  150.             error       : function (req, status, error) {
  151.                 \$('#loader_animation').addClass('d-none');
  152.                 \$('#exampleModal .modal-body').html('<div class=\"bg-danger p-3\"><h5 class=\"text-justify align-middle text-center\"> El código introducido no existe o no es válido. </h5></div>');
  153.             }
  154.         });
  155.     });
  156. });
  157. // Enviar el formulario al guardar
  158. function enviarAjaxProceso(formulario, RegFase, codigo, fase){
  159.     \$.ajax({
  160.         type        : \"POST\",
  161.         url         : Routing.generate('ajax_regprofase_search_code', {'codigo' : codigo, 'fase' : fase, 'RegFase' : RegFase}),
  162.         data        : formulario.serialize(),
  163.         dataType    : \"json\",
  164.         cache       : false,
  165.         success     : function (obj) {
  166.             if(obj.cerrar_modal){
  167.                 PNotify.success({
  168.                     title: 'Éxito!',
  169.                     text: 'Se han registrado correctamente las fases del proceso.'
  170.                 });
  171.                 \$(\"#exampleModal .close\").click();
  172.                 \$('.fase_min').val(0);
  173.                 location.reload();
  174.             }else{
  175.                 \$('#exampleModal').html(obj.html);
  176.                 \$('.fase_min').val(0);
  177.             }
  178.         },
  179.         error       : function (req, status, error) {
  180.             //console.log(error);
  181.             //console.log(req);
  182.         }
  183.     });
  184. }
  185. // Contador de minutos
  186. function updateMinutosFase() {
  187.     var fase = \$('.registro_fase_id').val();
  188.     console.log(fase);
  189.     var minutos = Number(\$('.fase_min').val());
  190.     var min = minutos +1;
  191.     \$('.fase_min').val(min);
  192.     // Descontar del temporizador
  193.     var temp = Number(\$('.temp_top').val());
  194.     var new_temp = temp - 1;
  195.     \$('.temp_top').val(new_temp);
  196.     console.log(new_temp);
  197.     // Cambiar el color del input
  198.     if(new_temp <= 0){
  199.         \$('.temp_top').removeClass('bg-success');
  200.         \$('.temp_top').addClass('bg-danger');
  201.     }
  202.     \$.ajax({
  203.         type     : \"POST\",
  204.         url     : Routing.generate('ajax_regprofase_update_minutes', {'fase' : fase, 'minutos' : min}),
  205.         data    : \$(this).serialize(),
  206.         dataType: \"json\",
  207.         cache   : false,
  208.         timeout : 60000,
  209.         complete : function (obj) {
  210.             setTimeout(updateMinutosFase, 60000);
  211.         },
  212.         error   : function (req, status, error) {
  213.             //console.log(error + req + status);
  214.             setTimeout(updateMinutosFase, 60000);
  215.         }
  216.     });
  217. };
  218. </script>
  219. ";
  220.         
  221.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  222.         
  223.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  224.     }
  225.     public function getTemplateName()
  226.     {
  227.         return "pages/Operario/index.html.twig";
  228.     }
  229.     public function isTraitable()
  230.     {
  231.         return false;
  232.     }
  233.     public function getDebugInfo()
  234.     {
  235.         return array (  145 => 58,  139 => 55,  129 => 54,  110 => 43,  69 => 3,  59 => 2,  36 => 1,);
  236.     }
  237.     public function getSourceContext()
  238.     {
  239.         return new Source("{% extends 'base_operario.html.twig' %}
  240. {% block body %}
  241. <div class=\"d-flex flex-center flex-column-fluid\">
  242.     <!--begin::Signin-->
  243.     <div class=\"login-form login-signin\">
  244.         <!--begin::Form-->
  245.         <div class=\"bg-white rounded p-10\">
  246.             <div class=\"d-flex flex-column h-100 justify-content-center text-center\">
  247.                 <div class=\"pt-lg-0 pt-5 text-center\">
  248.                     <div class=\"text-center mb-10\" >
  249.                         <img class=\"p-3\" width=\"100%\" src=\"/imagenes/logos/logo-javier-ramos-ret.png\" alt=\"\" />
  250.                     </div>
  251.                 </div>
  252.             </div>
  253.             <!--begin::Card-->
  254.             <div class=\"card card-custom card-fit card-border\">
  255.                 <div class=\"card-body mt-5\">
  256.                     <div class=\"form-group\">
  257.                         <label for=\"codigo\" class=\"required\">
  258.                             Código de producción:
  259.                         </label>
  260.                         <input type=\"text\" id=\"codigo\" name=\"codigo\" required=\"required\" maxlength=\"255\" class=\"form-control codigo\">
  261.                     </div>
  262.                     <!--end::Form group-->
  263.                     <!--begin::Action-->
  264.                     <div class=\"pb-lg-0 pb-5 text-center\">
  265.                         <button id=\"buscar_cod\" name=\"buscar_cod\" class=\"btn btn-twitter btn buscar_cod\" data_icon_before=\"fas fa-search\">
  266.                             <span class=\"fas fa-search\"></span> 
  267.                             Buscar
  268.                         </button>
  269.                     </div>
  270.                 </div>
  271.             </div>
  272.             <!--end::Card-->
  273.         </div>
  274.         <!--end::Form-->
  275.     </div>
  276.     <!--end::Signin-->
  277. </div>
  278. {#} Modal {#}
  279. <div class=\"modal fade\" id=\"exampleModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\" data-backdrop=\"false\" data-keyboard=\"false\">
  280.     <div class=\"modal-dialog modal-xl\" role=\"document\">
  281.         <div class=\"modal-content\">
  282.             <div class=\"modal-body\">
  283.             </div>
  284.         </div>
  285.     </div>
  286. </div>
  287. {% endblock %}
  288. {% block javascripts %}
  289. {{ parent() }}
  290. <script>
  291. var modal_loader = '{{ include('includes/partials/_loader_css_js.html.twig', {'loader_id' : 'loader_animation','loader_text' : 'Cargando...', 'loader_class' : 'text-center m-4'}) }}';
  292. \$(document).ready(function(){
  293.     // Capturar el cambio de código
  294.     \$('.buscar_cod').on('click', function(e){
  295.         e.preventDefault();
  296.         var codigo = \$('.codigo').val();
  297.         //console.log('Código del proceso: '+codigo);
  298.         \$.ajax({
  299.             type        : \"POST\",
  300.             url         : Routing.generate('ajax_regprofase_search_code', {'codigo' : codigo}),
  301.             data        : \$(this).serialize(),
  302.             dataType    : \"json\",
  303.             cache       : false,
  304.             beforeSend  : function (obj) {
  305.                 \$('#exampleModal .modal-header').remove();
  306.                 \$('#exampleModal .modal_footer').remove();
  307.                 \$('#loader_animation').removeClass('d-none');
  308.                 \$('#exampleModal').modal('show');
  309.                 \$('#exampleModal .modal-body').html(modal_loader);
  310.             },
  311.             success     : function (obj) {
  312.                 //console.log(obj);
  313.                 \$('#loader_animation').addClass('d-none');
  314.                 \$('#exampleModal').html(obj.html);
  315.                 updateMinutosFase();
  316.             },
  317.             error       : function (req, status, error) {
  318.                 \$('#loader_animation').addClass('d-none');
  319.                 \$('#exampleModal .modal-body').html('<div class=\"bg-danger p-3\"><h5 class=\"text-justify align-middle text-center\"> El código introducido no existe o no es válido. </h5></div>');
  320.             }
  321.         });
  322.     });
  323. });
  324. // Enviar el formulario al guardar
  325. function enviarAjaxProceso(formulario, RegFase, codigo, fase){
  326.     \$.ajax({
  327.         type        : \"POST\",
  328.         url         : Routing.generate('ajax_regprofase_search_code', {'codigo' : codigo, 'fase' : fase, 'RegFase' : RegFase}),
  329.         data        : formulario.serialize(),
  330.         dataType    : \"json\",
  331.         cache       : false,
  332.         success     : function (obj) {
  333.             if(obj.cerrar_modal){
  334.                 PNotify.success({
  335.                     title: 'Éxito!',
  336.                     text: 'Se han registrado correctamente las fases del proceso.'
  337.                 });
  338.                 \$(\"#exampleModal .close\").click();
  339.                 \$('.fase_min').val(0);
  340.                 location.reload();
  341.             }else{
  342.                 \$('#exampleModal').html(obj.html);
  343.                 \$('.fase_min').val(0);
  344.             }
  345.         },
  346.         error       : function (req, status, error) {
  347.             //console.log(error);
  348.             //console.log(req);
  349.         }
  350.     });
  351. }
  352. // Contador de minutos
  353. function updateMinutosFase() {
  354.     var fase = \$('.registro_fase_id').val();
  355.     console.log(fase);
  356.     var minutos = Number(\$('.fase_min').val());
  357.     var min = minutos +1;
  358.     \$('.fase_min').val(min);
  359.     // Descontar del temporizador
  360.     var temp = Number(\$('.temp_top').val());
  361.     var new_temp = temp - 1;
  362.     \$('.temp_top').val(new_temp);
  363.     console.log(new_temp);
  364.     // Cambiar el color del input
  365.     if(new_temp <= 0){
  366.         \$('.temp_top').removeClass('bg-success');
  367.         \$('.temp_top').addClass('bg-danger');
  368.     }
  369.     \$.ajax({
  370.         type     : \"POST\",
  371.         url     : Routing.generate('ajax_regprofase_update_minutes', {'fase' : fase, 'minutos' : min}),
  372.         data    : \$(this).serialize(),
  373.         dataType: \"json\",
  374.         cache   : false,
  375.         timeout : 60000,
  376.         complete : function (obj) {
  377.             setTimeout(updateMinutosFase, 60000);
  378.         },
  379.         error   : function (req, status, error) {
  380.             //console.log(error + req + status);
  381.             setTimeout(updateMinutosFase, 60000);
  382.         }
  383.     });
  384. };
  385. </script>
  386. {% endblock %}""pages/Operario/index.html.twig""/var/www/vhosts/apunts.es/jramos.apunts.es/templates/pages/Operario/index.html.twig");
  387.     }
  388. }