/
var
/
www
/
html
/
mixchief_app
/
var
/
cache
/
prod
/
twig
/
b7
/
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; /* Stock/index.html.twig */ class __TwigTemplate_7b862dbaff6e7079629394b269fe4d4b52ad26dfc70054727d36d6d209a1f587 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", "Stock/index.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=\"row\"> \t\t\t<div class=\"col-sm-6\"> \t\t\t\t<div class=\"card\"> \t\t\t\t\t<div class=\"card-header\"> \t\t\t\t\t\t<h3>Inventory</h3> \t\t\t\t\t</div> \t\t\t\t\t<div class=\"card-body\"> \t\t\t\t\t\t<table class=\"table table-striped\" id=\"rowSelection\"> \t\t\t\t\t\t\t<thead> \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>Quantity</th> \t\t\t\t\t\t\t\t\t<th>Actions</th> \t\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t\t</thead> \t\t\t\t\t\t\t<tbody> \t\t\t\t\t\t\t\t"; // line 21 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(($context["stock"] ?? null)); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 22 echo "\t\t\t\t\t\t\t\t\t<tr class=\"clickable-row\" data-href=\""; echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("stock", ["id" => twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 22)]), "html", null, true); echo "\"> \t\t\t\t\t\t\t\t\t\t<td>"; // line 23 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 23), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td>"; // line 24 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "quantity", [], "any", false, false, false, 24), "html", null, true); echo " "; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["item"], "unit", [], "any", false, false, false, 24), "html", null, true); echo "</td> \t\t\t\t\t\t\t\t\t\t<td> \t\t\t\t\t\t\t\t\t\t\t<a class=\"btn btn-primary\" href=\""; // line 26 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("stocksupplyitems", ["id" => twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 26)]), "html", null, true); echo "\">Supplies</a> \t\t\t\t\t\t\t\t\t\t\t<a class=\"btn btn-danger\" href=\""; // line 27 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("removeinventoryitem", ["id" => twig_get_attribute($this->env, $this->source, $context["item"], "id", [], "any", false, false, false, 27)]), "html", null, true); echo "\"><i class=\"fa fa-times\"></i></a> \t\t\t\t\t\t\t\t\t\t</td> \t\t\t\t\t\t\t\t\t</tr> \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 31 echo "\t\t\t\t\t\t\t</tbody> \t\t\t\t\t\t</table> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</div> \t\t\t<div class=\"col-sm-6\"> \t\t\t\t<div class=\"card\"> \t\t\t\t\t<div class=\"card-header\"> \t\t\t\t\t\t<h3>"; // line 39 if (($context["stockitem"] ?? null)) { echo "<a href=\""; echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("stock"); echo "\" class=\"btn btn-primary\" style=\"margin-right: 20px;\">New Inventory</a> Edit "; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "name", [], "any", false, false, false, 39), "html", null, true); } else { echo "Add Inventory Item"; } echo " </h3> \t\t\t\t\t</div> \t\t\t\t\t<div class=\"card-body\"> \t\t\t\t\t\t<form action=\""; // line 42 echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("stock"); echo "\" method=\"POST\" name=\"edit\"> \t\t\t\t\t\t\t"; // line 43 if (($context["stockitem"] ?? null)) { echo "<input type=\"hidden\" name=\"edit\" value=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "id", [], "any", false, false, false, 43), "html", null, true); echo "\">"; } // line 44 echo "\t\t\t\t\t\t\t<div id=\"stockform\"> \t\t\t\t\t\t\t\t<div class=\"row\"> \t\t\t\t\t\t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"name[]\" class=\"form-control\" placeholder=\"Name\" value=\""; // line 47 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "name", [], "any", true, true, false, 47)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "name", [], "any", false, false, false, 47), "")) : ("")), "html", null, true); echo "\" required> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t<div class=\"col-sm-3\"> \t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"quantity[]\" class=\"form-control\" placeholder=\"Quantity\" value=\""; // line 50 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "quantity", [], "any", true, true, false, 50)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "quantity", [], "any", false, false, false, 50), "")) : ("")), "html", null, true); echo "\" required> \t\t\t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t\t\t<div class=\"col-sm-3\"> \t\t\t\t\t\t\t\t\t\t<select name=\"unit[]\" id=\"unit\" style=\"padding: 3px;\" class=\"form-control\" required> \t\t\t\t\t\t\t\t\t\t\t<option value=\"\">Select Unit</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"pieces\">pieces</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"packets\">packets</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"bags\">bags</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"cups\">cups</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"ml\">ml</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"cl\">cl</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"l\">l</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"g\">g</option> \t\t\t\t\t\t\t\t\t\t\t<option value=\"kg\">kg</option> \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</div> \t\t\t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Save\" class=\"btn btn-primary\"> \t\t\t\t\t\t</form> \t\t\t\t\t\t"; // line 70 if (($context["stockitem"] ?? null)) { // line 71 echo "\t\t\t\t\t\t \t\t\t\t\t\t"; } else { // line 73 echo "\t\t\t\t\t\t\t<button type=\"button\" id=\"add-more-button\" class=\"btn btn-primary pull-right\">Add More</button> \t\t\t\t\t\t"; } // line 75 echo "\t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</div> \t\t</div> \t\t \t</div> \t "; } // line 84 public function block_javascripts($context, array $blocks = []) { $macros = $this->macros; // line 85 echo "\t"; $this->displayParentBlock("javascripts", $context, $blocks); echo " \t<script> \t\tvar units = { \t\t pieces: 'pieces', \t\t bags: 'bags', \t\t packets: 'packets', \t\t cups: 'cups', \t\t sachet: 'sachet', \t\t g: 'g', \t\t kg: ['kg', 'g'], \t\t ml: 'ml', \t\t cl: ['cl', 'ml'], \t\t l: ['cl', 'ml'], \t\t} \t\tconst options = () => { \t\t\treturn Object.keys(units).map(unit => `<option value=\"\${unit}\">\${unit}</option>`).join(\"\"); \t\t} \t\tvar unit = \""; // line 104 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "unit", [], "any", true, true, false, 104)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["stockitem"] ?? null), "unit", [], "any", false, false, false, 104), "")) : ("")), "html", null, true); echo "\"; \t\tif(unit) { \t\t\tdocument.forms.edit.unit.value = unit; \t\t} \t\t// \$('#unit').append(options()) \t\tconst addTemplate = () => ` \t\t\t<hr> \t\t\t<div class=\"row\"> \t\t\t\t<div class=\"col-sm-5\"> \t\t\t\t\t<input type=\"text\" name=\"name[]\" class=\"form-control\" placeholder=\"Name\" required> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-3\"> \t\t\t\t\t<input type=\"text\" name=\"quantity[]\" class=\"form-control\" placeholder=\"Quantity\" required> \t\t\t\t</div> \t\t\t\t<div class=\"col-sm-2\"> \t\t\t\t\t<select name=\"unit[]\" id=\"unit\" class=\"form-control\" style=\"padding: 3px;\" required> \t\t\t\t\t\t<option value=\"\">Unit</option> \t\t\t\t\t\t\${options()} \t\t\t\t\t</select> \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\tvar addMore = document.getElementById('add-more-button'); \t\tif (addMore) { \t\t\taddMore.addEventListener('click', addItem); \t\t\tfunction addItem(){ \t\t\t\t\$('.cancel-button').hide(); \t\t\t\t\$('#stockform').append(addTemplate()); \t\t\t} \t\t\t\$('#stockform').on('click', '.cancel-button', function(e){ \t\t\t\te.preventDefault(); \t\t\t\tconst \$target = \$(e.currentTarget) \t\t\t\tconst parent = \$target.closest('.row').remove() \t\t\t\t\$('#stockform .row').last().find('.cancel-button').show() \t\t\t}); \t\t} \t\t// function removeItem(){ \t\t// \tvar parent = document.getElementById('stockform'); \t\t// \tparent.removeChild(parent.lastChild); \t\t// \t\$(parent.lastChild).append(cancelTemplate()) \t\t// } \t</script> "; } public function getTemplateName() { return "Stock/index.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 219 => 104, 196 => 85, 192 => 84, 181 => 75, 177 => 73, 173 => 71, 171 => 70, 148 => 50, 142 => 47, 137 => 44, 131 => 43, 127 => 42, 114 => 39, 104 => 31, 94 => 27, 90 => 26, 83 => 24, 79 => 23, 74 => 22, 70 => 21, 51 => 4, 47 => 3, 36 => 1,); } public function getSourceContext() { return new Source("", "Stock/index.html.twig", "/var/www/html/mixchief_app/templates/Stock/index.html.twig"); } }