<?php

/* products.variations.manage.tpl */
class __TwigTemplate_0d1d54d755f761bc99fb105a0b11288b extends Twig_Template
{
    public function display(array $context)
    {
        // line 1
        echo "\t<div class=\"row\">
\t\t<div class=\"col-sm-12\">
\t\t\t<h4 class=\"page-title\">";
        // line 3
        echo getLang("ViewProductVariations");
        echo "</h4>
\t\t\t<p>";
        // line 4
        echo getLang("ViewVariationsIntro");
        echo "</p>
\t\t\t<div id=\"PagesStatus\">";
        // line 5
        echo twig_safe_filter((isset($context['Message']) ? $context['Message'] : null));
        echo "</div>
\t\t</div>
\t</div>

\t<div class=\"row\">
\t\t<div class=\"col-sm-12\">
\t\t\t<input type=\"button\" name=\"IndexAddButton\" value=\"";
        // line 11
        echo getLang("AddProductVariation");
        echo "...\" id=\"IndexCreateButton\" class=\"btn btn-primary\" onclick=\"document.location.href='index.php?ToDo=addProductVariation'\" />
\t\t\t<input type=\"button\" name=\"IndexDeleteButton\" value=\"";
        // line 12
        echo getLang("DeleteSelected");
        echo "\" id=\"IndexDeleteButton\" class=\"btn btn-danger\" onclick=\"ConfirmDeleteSelected()\" ";
        echo twig_safe_filter((isset($context['DisableDelete']) ? $context['DisableDelete'] : null));
        echo " />
\t\t\t<input type=\"button\" name=\"IndexImportButton\" value=\"";
        // line 13
        echo getLang("ImportProductVariations");
        echo "\" id=\"IndexImportButton\" class=\"btn btn-success\" onclick=\"window.location='index.php?ToDo=importProductVariations';\" ";
        echo twig_safe_filter((isset($context['DisableImport']) ? $context['DisableImport'] : null));
        echo " />
\t\t</div>
\t</div>
\t<br />

\t<div class=\"panel panel-default\" style=\"display:";
        // line 18
        echo twig_safe_filter((isset($context['DisplayGrid']) ? $context['DisplayGrid'] : null));
        echo "\">
\t\t<div class=\"panel-body pn\">
\t\t\t<div class=\"table-responsive\">
\t\t\t\t<form name=\"frmVariations\" id=\"frmVariations\" method=\"post\" action=\"index.php?ToDo=deleteProductVariations\">
\t\t\t\t\t<div class=\"GridContainer\">
\t\t\t\t\t\t";
        // line 23
        echo twig_safe_filter((isset($context['VariationDataGrid']) ? $context['VariationDataGrid'] : null));
        echo "
\t\t\t\t\t</div>
\t\t\t\t</form>
\t\t\t</div>
\t\t</div>
\t</div>

\t<script type=\"text/javascript\">

\t\tvar variationForm = document.getElementById('frmVariations');

\t\tfunction ConfirmDeleteSelected() {
\t\t\tvar fp = variationForm.elements;
\t\t\tvar selected = [];

\t\t\tfor(i = 0; i < fp.length; i++) {
\t\t\t\tif(fp[i].type == \"checkbox\" && fp[i].checked)
\t\t\t\t\tselected[selected.length] = fp[i].value;
\t\t\t}

\t\t\tif(selected.length == 0) {
\t\t\t\talert(\"";
        // line 44
        echo Interspire_Template_Extension::jsFilter(getLang("ChooseVariations"), "'");
        echo "\");
\t\t\t\treturn;
\t\t\t}

\t\t\tif (!confirm(\"";
        // line 48
        echo Interspire_Template_Extension::jsFilter(getLang("ConfirmDeleteVariations"), "'");
        echo "\")) {
\t\t\t\treturn;
\t\t\t}

\t\t\t\$.post('remote.php?remoteSection=product_variations&w=getAffectedVariations&actionType=delete&variationIdx=' + selected.join(), null,
\t\t\t\tfunction(result) {
\t\t\t\t\tif (result == '0') {
\t\t\t\t\t\t// submit immediately if nothing is affected
\t\t\t\t\t\twindow.parent.variationForm.submit();
\t\t\t\t\t} else if (result == '1') {
\t\t\t\t\t\t// display a thickbox with all the affected products in it
\t\t\t\t\t\t// from there they can decide whether to proceed or cancel
\t\t\t\t\t\t\$.iModal({
\t\t\t\t\t\t\ttype: 'ajax',
\t\t\t\t\t\t\turl: 'remote.php?remoteSection=product_variations&w=viewAffectedVariations&actionType=delete&variationIdx=' + selected.join(),
\t\t\t\t\t\t\twidth: 600
\t\t\t\t\t\t});
\t\t\t\t\t}
\t\t\t\t}
\t\t\t);
\t\t}

\t\tfunction ToggleDeleteBoxes(Status) {
\t\t\tvar fp = document.getElementById(\"frmVariations\").elements;

\t\t\tfor(i = 0; i < fp.length; i++) {
\t\t\t\tfp[i].checked = Status;
\t\t\t}
\t\t}

\t\t";
        // line 78
        if ((isset($context['updateSessionId']) ? $context['updateSessionId'] : null)) {
            echo "\t\t\t\$.iModal({
\t\t\t\ttype: 'ajax',
\t\t\t\tmethod: 'post',
\t\t\t\turl: 'remote.php',
\t\t\t\turlData: {
\t\t\t\t\tremoteSection: 'product_variations',
\t\t\t\t\tw: 'initRebuildVariations',
\t\t\t\t\tsession: '";
            // line 86
            echo twig_escape_filter($this->env, (isset($context['updateSessionId']) ? $context['updateSessionId'] : null), "1");
            echo "'
\t\t\t\t},
\t\t\t\tclose: false,
\t\t\t\twidth: 400
\t\t\t});
\t\t";
        }
        // line 91
        echo "\t</script>
";
    }

}
