/
home
/
obinna
/
html
/
mixchief_app
/
var
/
cache
/
prod
/
twig
/
d6
/
Upload File
HOME
<?php use Twig\Environment; use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Extension\SandboxExtension; use Twig\Markup; use Twig\Sandbox\SecurityError; use Twig\Sandbox\SecurityNotAllowedTagError; use Twig\Sandbox\SecurityNotAllowedFilterError; use Twig\Sandbox\SecurityNotAllowedFunctionError; use Twig\Source; use Twig\Template; /* Inventory/edititem.html.twig */ class __TwigTemplate_240acc12e0a3b6ab7c72176b6207a7d8fa3de80cb1427158cd852d74352850ab extends Template { private $source; private $macros = []; public function __construct(Environment $env) { parent::__construct($env); $this->source = $this->getSourceContext(); $this->blocks = [ 'content' => [$this, 'block_content'], 'javascripts' => [$this, 'block_javascripts'], ]; } protected function doGetParent(array $context) { // line 1 return "base1.html.twig"; } protected function doDisplay(array $context, array $blocks = []) { $macros = $this->macros; $this->parent = $this->loadTemplate("base1.html.twig", "Inventory/edititem.html.twig", 1); $this->parent->display($context, array_merge($this->blocks, $blocks)); } // line 3 public function block_content($context, array $blocks = []) { $macros = $this->macros; // line 4 echo "\t<div class=\"content\"> \t\t<div class=\"card\"> \t\t\t<div class=\"card-body\"> \t\t\t\t<form action=\""; // line 7 echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("editItem"); echo "\" method=\"POST\" name=\"edit\" enctype=\"multipart/form-data\"> \t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\""; // line 8 echo twig_escape_filter($this->env, ($context["id"] ?? null), "html", null, true); echo "\"> \t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"name\" class=\"form-control\" placeholder=\"Item Name\" value=\""; // line 12 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "name", [], "any", true, true, false, 12)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "name", [], "any", false, false, false, 12), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"selling\" class=\"form-control\" placeholder=\"Price\" value=\""; // line 15 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "sellingPrice", [], "any", true, true, false, 15)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "sellingPrice", [], "any", false, false, false, 15), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"text\" name=\"description\" class=\"form-control\" placeholder=\"Description\" value=\""; // line 18 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "description", [], "any", true, true, false, 18)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "description", [], "any", false, false, false, 18), "")) : ("")), "html", null, true); echo "\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<select class=\"form-control ajaxSelect\" name=\"category\"> \t\t\t\t\t\t\t\t\t<option value=\"-1\">Select Category</option> \t\t\t\t\t\t\t\t\t"; // line 24 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(($context["category"] ?? null)); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 25 echo "\t\t\t\t\t\t\t\t\t\t<option value=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 25), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_upper_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 25)), "html", null, true); echo "</option> \t\t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 27 echo "\t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<!-- image input --> \t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t<input type=\"file\" name=\"image\" class=\"form-control\"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t \t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t<h3>Item Parts</h3> \t\t\t\t\t\t\t<table class=\"table\"> \t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t<th>Name</th> \t\t\t\t\t\t\t\t\t<th>Portions</th> \t\t\t\t\t\t\t\t\t<th>Delete</th> \t\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t\t\t"; // line 44 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(($context["itempart"] ?? null)); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 45 echo "\t\t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t\t<td>"; // line 46 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 46), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td>"; // line 47 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "portions", [], "any", false, false, false, 47), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td><a href=\""; // line 48 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("removeStockItem", ["id" => twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 48)]), "html", null, true); echo "\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></a></td> \t\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t \t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 51 echo "\t\t\t\t\t\t\t</table> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t\t \t\t\t\t\t<div class=\"col-sm-7\"> \t\t\t\t\t\t<h4>Add Item Parts <small>(Optional)</small></h4> \t\t\t\t\t\t<div id=\"stockitems\"> \t\t\t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\t\t\t\t<select class=\"form-control select-list ajaxSelect\" name=\"stock[]\"> \t\t\t\t\t\t\t\t\t\t\t<option value=\"\">Select Inventory Item</option> \t\t\t\t\t\t\t\t\t\t\t"; // line 63 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(($context["stock"] ?? null)); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 64 echo "\t\t\t\t\t\t\t\t\t\t\t\t<option value=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 64), "html", null, true); echo "|"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "unit", [], "any", false, false, false, 64), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_upper_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 64)), "html", null, true); echo "</option> \t\t\t\t\t\t\t\t\t\t\t"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 66 echo "\t\t\t\t\t\t\t\t\t\t</select> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\"> \t\t\t\t\t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<button type=\"button\" class=\"btn btn-warning pull-right\" id=\"add-item\">+</button> \t\t\t\t\t</div> \t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Save\" class=\"btn btn-primary\"> \t\t\t\t</form> \t\t\t\t \t\t\t</div> \t\t</div> \t</div> "; } // line 90 public function block_javascripts($context, array $blocks = []) { $macros = $this->macros; // line 91 echo "\t"; $this->displayParentBlock("javascripts", $context, $blocks); echo " \t<script src=\""; // line 92 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("js/itemselect.js"), "html", null, true); echo "\"></script> \t<script> \t\t// var units = { \t\t// kg: ['kg', 'g'], \t\t// g: 'g', \t\t// l: ['cl', 'ml'], \t\t// cl: ['cl', 'ml'], \t\t// ml: 'ml', \t\t// cups: 'cups', \t\t// bags: 'bags', \t\t// packets: 'packets', \t\t// dozen: ['dozen', 'piece'], \t\t// sachet: 'sachet' \t\t// } \t\tvar cat = \""; // line 108 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "cId", [], "any", true, true, false, 108)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["item"] ?? null), "cId", [], "any", false, false, false, 108), "")) : ("")), "html", null, true); echo "\"; \t\tif(cat) { \t\t\tdocument.forms.edit.category.value = cat; \t\t} \t\t\$('#stockitems').on('change', '.select-list', function(e){ \t\t\tvar \$target = \$(e.currentTarget) \t\t\tconsole.log(\$target.val()) \t\t\tvar split = \$target.val().split(\"|\") \t\t\tvar unit = split[1]; \t\t\t\$target.closest('.row').find('.input-group-text').html(unit); \t\t}) \t\tvar itemRow = (items) => ` \t\t\t<div class=\"row\"> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"form-group\"> \t\t\t\t\t\t\${selectTemplate(items)} \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<div class=\"input-group\"> \t\t\t\t\t\t<input type=\"text\" name=\"portion[]\" placeholder=\"Portion\" class=\"form-control\" required> \t\t\t\t\t\t<div class=\"input-group-append\"> \t\t\t\t\t\t\t<span class=\"input-group-text\">unit</span> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-1 cancel-button\" style=\"display: flex;\"> \t\t\t\t\t<button style=\"margin:auto;\" type=\"button\" class=\"btn btn-danger\"><i class=\"fa fa-times\"></i></button> \t\t\t\t</div> \t\t\t</div> \t\t`; \t\t\$('#stockitems').on('click', '.cancel-button', function(e){ \t\t\te.preventDefault(); \t\t\tconst \$target = \$(e.currentTarget) \t\t\tconst parent = \$target.closest('.row').remove() \t\t\t\$('#stockitems .row').last().find('.cancel-button').show() \t\t}); \t</script> "; } public function getTemplateName() { return "Inventory/edititem.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 231 => 108, 212 => 92, 207 => 91, 203 => 90, 177 => 66, 164 => 64, 160 => 63, 146 => 51, 137 => 48, 133 => 47, 129 => 46, 126 => 45, 122 => 44, 103 => 27, 92 => 25, 88 => 24, 79 => 18, 73 => 15, 67 => 12, 60 => 8, 56 => 7, 51 => 4, 47 => 3, 36 => 1,); } public function getSourceContext() { return new Source("", "Inventory/edititem.html.twig", "/var/www/html/mixchief_app/templates/Inventory/edititem.html.twig"); } }