<?php

/* shippingzone.method.form.tpl */
class __TwigTemplate_431db79022886fabfbd76bc476f8bbc0 extends Twig_Template
{
    public function display(array $context)
    {
        // line 1
        echo "<form action=\"index.php?ToDo=";
        echo twig_safe_filter((isset($context['FormAction']) ? $context['FormAction'] : null));
        echo "\" method=\"post\" onsubmit=\"return ValidateForm(CheckMethodForm)\" class=\"form-horizontal\">
\t<input type=\"hidden\" name=\"methodId\" id=\"methodId\" value=\"";
        // line 2
        echo twig_safe_filter((isset($context['MethodId']) ? $context['MethodId'] : null));
        echo "\" />
\t<input type=\"hidden\" name=\"zoneId\" id=\"zoneId\" value=\"";
        // line 3
        echo twig_safe_filter((isset($context['ZoneId']) ? $context['ZoneId'] : null));
        echo "\" />
\t<input type=\"hidden\" name=\"currentTab\" value=\"";
        // line 4
        echo twig_safe_filter((isset($context['CurrentTab']) ? $context['CurrentTab'] : null));
        echo "\" id=\"currentTab\" />

\t<div class=\"row\">
\t\t<div class=\"col-sm-12\">
\t\t\t<h4 class=\"page-title\">";
        // line 8
        echo twig_safe_filter((isset($context['Title']) ? $context['Title'] : null));
        echo "</h4>
\t\t\t<p>";
        // line 9
        echo twig_safe_filter((isset($context['Intro']) ? $context['Intro'] : null));
        echo "</p>
\t\t\t";
        // line 10
        echo twig_safe_filter((isset($context['Message']) ? $context['Message'] : null));
        echo "
\t\t</div>
\t</div>

\t<div class=\"row\">
\t\t<div class=\"panel panel-default\">
\t\t\t<div class=\"panel-heading\"> 
\t\t\t\t<h3 class=\"panel-title\">";
        // line 17
        echo getLang("ShippingMethodSettings");
        echo "</h3> 
\t\t\t</div> 

\t\t\t<div class=\"panel-body\">
\t\t\t\t<div class=\"form-group\">
\t\t\t\t\t<label class=\"col-md-2 control-label\">";
        // line 22
        echo getLang("ShippingMethod");
        echo "</label>
\t\t\t\t\t<div class=\"col-md-10\">
\t\t\t\t\t\t<div>";
        // line 24
        echo twig_safe_filter((isset($context['MethodBasedOn']) ? $context['MethodBasedOn'] : null));
        echo "</div>
\t\t\t\t\t\t<div style=\"";
        // line 25
        echo twig_safe_filter((isset($context['HideModuleSelect']) ? $context['HideModuleSelect'] : null));
        echo "\">
\t\t\t\t\t\t\t<select name=\"methodmodule\" id=\"methodmodule\" class=\"form-control\" size=\"10\" onchange=\"UpdateModule(\$(this).val());\">
\t\t\t\t\t\t\t";
        // line 27
        echo twig_safe_filter((isset($context['ShippingProviders']) ? $context['ShippingProviders'] : null));
        echo "
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t</div>

\t\t\t\t<div class=\"form-group\">
\t\t\t\t\t<label class=\"col-md-2 control-label\">";
        // line 34
        echo getLang("DisplayName");
        echo "</label>
\t\t\t\t\t<div class=\"col-md-10\">
\t\t\t\t\t\t<input type=\"text\" onkeypress=\"updateUsingDefault();\" name=\"methodname\" id=\"methodname\" class=\"form-control\" value=\"";
        // line 36
        echo twig_safe_filter((isset($context['MethodName']) ? $context['MethodName'] : null));
        echo "\" required />
\t\t\t\t\t\t<div id=\"HandlingSettings\" style=\"";
        // line 37
        echo twig_safe_filter((isset($context['HideHandlingFee']) ? $context['HideHandlingFee'] : null));
        echo "\">
\t\t\t\t\t\t\t<div class=\"input-group m-t-10 col-sm-8\">
\t\t\t                   \t<span class=\"input-group-addon\">Taxa de manuseio em R\$</span>
\t\t\t                    <input type=\"text\" name=\"methodhandlingfee\" id=\"methodhandlingfee\" class=\"form-control\" value=\"";
        // line 40
        echo twig_safe_filter((isset($context['HandlingFee']) ? $context['HandlingFee'] : null));
        echo "\" />
\t\t\t                </div>
\t\t\t            </div>

\t\t\t\t\t</div>
\t\t\t\t</div>

\t\t\t\t<div class=\"form-group\" style=\"";
        // line 47
        echo twig_safe_filter((isset($context['HideZoneEnabled']) ? $context['HideZoneEnabled'] : null));
        echo "\">
\t\t\t\t\t<label class=\"col-md-2 control-label\">";
        // line 48
        echo getLang("EnableShippingMethod");
        echo "</label>
\t\t\t\t\t<div class=\"col-md-10\">
\t\t\t\t\t\t<div class=\"checkbox checkbox-primary\">
\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"methodenabled\" id=\"methodenbled\" ";
        // line 51
        echo twig_safe_filter((isset($context['MethodEnabledCheck']) ? $context['MethodEnabledCheck'] : null));
        echo " />
\t                        <label for=\"methodenbled\">";
        // line 52
        echo getLang("YesEnableShippingMethod");
        echo "</label>
\t                    </div>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t</div>

\t<div class=\"row\">
\t\t<div id=\"shippingMethodSettings\">
\t\t\t";
        // line 62
        echo twig_safe_filter((isset($context['ShippingModuleProperties']) ? $context['ShippingModuleProperties'] : null));
        echo "
\t\t</div>
\t</div>
\t
\t<input type=\"submit\" value=\"";
        // line 66
        echo getLang("Save");
        echo "\" class=\"FormButton btn btn-primary\" />
\t<input type=\"reset\" value=\"";
        // line 67
        echo getLang("Cancel");
        echo "\" class=\"FormButton btn btn-default\" onclick=\"ConfirmCancel()\" />
</form>
<script type=\"text/javascript\">
\tvar usingDefault = 1;

\tfunction updateUsingDefault()
\t{
\t\tusingDefault = 0;
\t}

\tfunction ConfirmCancel()
\t{
\t\tif(confirm('";
        // line 79
        echo getLang("ConfirmCancel");
        echo "')) {
\t\t\twindow.location = 'index.php?ToDo=editShippingZone&zoneId=";
        // line 80
        echo twig_safe_filter((isset($context['ZoneId']) ? $context['ZoneId'] : null));
        echo "&currentTab=1';
\t\t}
\t}

function CheckMethodForm()
{
\tif(!\$('#methodId').val() && !\$('#methodmodule').val()) {
\t\talert('";
        // line 87
        echo getLang("SelectShippingMethod");
        echo "');
\t\t\$('#methodmodule').focus();
\t\treturn false;
\t}

\tif(!\$('#methodname').val()) {
\t\talert('";
        // line 93
        echo getLang("EnterShippingMethodName");
        echo "');
\t\t\$('#methodname').focus();
\t\treturn false;
\t}

\tif(\$('#HandlingSettings').css('display') != 'none') {
\t\tif(isNaN(priceFormat(\$('#methodhandlingfee')))) {
\t\t\talert('";
        // line 100
        echo getLang("EnterValidHandlingFee");
        echo "');
\t\t\t\$('#methodhandlingfee').select();
\t\t\treturn;
\t\t}
\t}

\tif(typeof(ShipperValidation) != 'undefined' && ShipperValidation() == false) {
\t\treturn false;
\t}

\treturn true;
}

";
        // line 113
        echo twig_safe_filter((isset($context['ShippingProviderErrors']) ? $context['ShippingProviderErrors'] : null));
        echo "

function UpdateModule(module) {
\tif(module == '' || module == null) {
\t\t\$('#chooseMethodFirst').show();
\t\t\$('#shippingMethodSettings *').remove();
\t\treturn;
\t}

\t// Is there a reason why this zone cannot be enabled?
\tif(typeof(eval('providerErrors.'+module)) != 'undefined') {
\t\tvar errors = eval('providerErrors.'+module);
\t\talert(errors);
\t\t\$('#methodmodule').val('');
\t\treturn false;
\t}

\t\$.ajax({
\t\turl: 'remote.php',
\t\tmethod: 'post',
\t\tdata: 'w=GetShippingModuleProperties&module='+module,
\t\tsuccess: function(data) {
\t\t\t\$('#shippingMethodSettings').html(data);
\t\t\t\$('#chooseMethodFirst').hide();
\t\t\tISSelectReplacement.on_load();
\t\t\tif(usingDefault == 1) {
\t\t\t\t\$('#methodname').val(\$('#shippingMethodSettings #moduleName').html());
\t\t\t}
\t\t}
\t});
}
</script>";
    }

}
