<?php

/* settings.currency.manage.tpl */
class __TwigTemplate_61418f2f93629bce831a3042dea92a75 extends Twig_Template
{
    public function display(array $context)
    {
        // line 1
        echo "<div class=\"BodyContainer\">
\t<form name=\"frmCurrency\" id=\"frmCurrency\" method=\"post\" action=\"index.php?ToDo=settingsSaveCurrencySettings\" onsubmit=\"return ValidateForm(CheckCurrencyForm);\">
\t\t<input type=\"hidden\" name=\"currentTab\" id=\"currentTab\" value=\"0\" />
\t\t<div class=\"row\">
\t\t\t<div class=\"col-sm-12\">
\t\t\t\t<h4 class=\"page-title\">";
        // line 6
        echo getLang("Currency");
        echo "</h4>
\t\t\t\t<p>";
        // line 7
        echo twig_safe_filter((isset($context['CurrencyIntro']) ? $context['CurrencyIntro'] : null));
        echo "</p>
\t\t\t\t";
        // line 8
        echo twig_safe_filter((isset($context['Message']) ? $context['Message'] : null));
        echo "
\t\t\t</div>
\t\t</div>

\t\t<div class=\"row\">
\t\t\t<div class=\"col-sm-12\">
\t\t\t\t<ul id=\"tabnav\" class=\"nav nav-tabs tabs ui-tabs ui-widget ui-widget-content ui-corner-all\">
\t\t\t\t\t";
        // line 15
        echo twig_safe_filter((isset($context['CurrencyTabs']) ? $context['CurrencyTabs'] : null));
        echo "
\t\t\t\t\t<li><a href=\"#\" class=\"active\" id=\"tab1\" onclick=\"ShowTab(1)\">";
        // line 16
        echo getLang("CurrencyRateSettings");
        echo "</a></li>
\t\t\t\t</ul>
\t\t\t</div>
\t\t</div>
\t\t<br>

\t\t<div id=\"div0\" style=\"padding-top: 10px;\">
\t\t\t<div class=\"row\">
\t\t\t\t<div class=\"col-sm-12\">
\t\t\t\t\t<input type=\"button\" name=\"IndexAddButton\" value=\"";
        // line 25
        echo getLang("AddCurrency");
        echo "...\" id=\"IndexCreateButton\" class=\"SmallButton btn btn-primary\" onclick=\"document.location.href='index.php?ToDo=settingsAddCurrency'\" />&nbsp;

\t\t\t\t\t<input type=\"button\" name=\"IndexDeleteButton\" value=\"";
        // line 27
        echo getLang("DeleteSelected");
        echo "\" id=\"IndexDeleteButton\" class=\"SmallButton btn btn-danger\" onclick=\"ConfirmDeleteSelected()\" ";
        echo twig_safe_filter((isset($context['DisableDelete']) ? $context['DisableDelete'] : null));
        echo " />&nbsp;
\t\t\t\t\t
\t\t\t\t\t";
        // line 29
        echo twig_safe_filter((isset($context['UpdateExchageRateButton']) ? $context['UpdateExchageRateButton'] : null));
        echo "
\t\t\t\t</div>
\t\t\t</div>

\t\t\t<div class=\"row\">
\t\t\t\t<div class=\"col-sm-12\">
\t\t\t\t\t<br>
\t\t\t\t\t<div class=\"panel panel-default\">
\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding: 0\">
\t\t\t\t\t\t\t<table class=\"GridPanel table table-striped\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:100%;\">
\t\t\t\t\t\t\t\t<thead>
\t\t\t\t\t\t\t\t\t<tr style=\"display: ";
        // line 40
        echo twig_safe_filter((isset($context['ShowCurrencyTableHeaders']) ? $context['ShowCurrencyTableHeaders'] : null));
        echo "\">
\t\t\t\t\t\t\t\t\t\t<th style=\"width:18px\"><input type=\"checkbox\" onclick=\"ToggleDeleteBoxes(this.checked)\"></th>
\t\t\t\t\t\t\t\t\t\t<th>&nbsp;</th>
\t\t\t\t\t\t\t\t\t\t<th>";
        // line 43
        echo getLang("CurrencyName");
        echo "</th>
\t\t\t\t\t\t\t\t\t\t<th>";
        // line 44
        echo getLang("Currency");
        echo "</th>
\t\t\t\t\t\t\t\t\t\t<th>";
        // line 45
        echo getLang("ExchangeRate");
        echo "</th>
\t\t\t\t\t\t\t\t\t\t<th style=\"width:70px;\">";
        // line 46
        echo getLang("Status");
        echo "</th>
\t\t\t\t\t\t\t\t\t\t<th style=\"width:120px;\">";
        // line 47
        echo getLang("Action");
        echo "</th>
\t\t\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t\t</thead>

\t\t\t\t\t\t\t\t<tbody>
\t\t\t\t\t\t\t\t\t";
        // line 52
        echo twig_safe_filter((isset($context['CurrencyGrid']) ? $context['CurrencyGrid'] : null));
        echo "
\t\t\t\t\t\t\t\t</tbody>
\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</div>
\t\t\t</div>
\t\t</div>

\t\t<div id=\"div1\" style=\"padding-top: 10px;\">
\t\t\t<div class=\"panel panel-default\">
\t\t\t\t<div class=\"panel-heading\"> 
\t\t\t\t\t<h3 class=\"panel-title\">";
        // line 64
        echo getLang("ExchangeRateSettings");
        echo "</h3> 
\t\t\t\t</div> 

\t\t\t\t<div class=\"panel-body\">
\t\t\t\t\t<div class=\"form-group row\">
\t\t\t\t\t\t<label class=\"col-md-2 control-label\">
\t\t\t\t\t\t\t";
        // line 70
        echo getLang("CurrencyMethods");
        echo ":
\t\t\t\t\t\t</label>
\t\t\t\t\t\t<div class=\"col-md-10\">
\t\t\t\t\t\t\t<select size=\"8\" multiple name=\"converterproviders[]\" id=\"converterproviders\" class=\"form-control Field250 ISSelectReplacement\">
\t\t\t\t\t\t\t\t";
        // line 74
        echo twig_safe_filter((isset($context['ConverterProviders']) ? $context['ConverterProviders'] : 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</div>

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

\t\t\t\t<div class=\"panel-body\">
\t\t\t\t\t<div class=\"alert alert-info\">";
        // line 87
        echo getLang("AutomaticExchangeRateUpdatesHelp");
        echo "</div>
\t\t\t\t\t<div class=\"form-group row\">
\t\t\t\t\t\t<label class=\"col-md-2 control-label\">
\t\t\t\t\t\t\t";
        // line 90
        echo getLang("ExchangeRateCronCommand");
        echo ":
\t\t\t\t\t\t</label>
\t\t\t\t\t\t<div class=\"col-md-10\">
\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"cronpath\" id=\"cronpath\" value=\"";
        // line 93
        echo twig_safe_filter((isset($context['ExchangeRatePath']) ? $context['ExchangeRatePath'] : null));
        echo "\" />
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t\t<div class=\"row\">
\t\t\t\t<div class=\"col-sm-12\">
\t\t\t\t\t<input type=\"submit\" name=\"IndexCreateButton\" value=\"";
        // line 100
        echo getLang("Save");
        echo "\" id=\"IndexCreateButton\" class=\" btn btn-primary\">
\t\t\t\t\t<input type=\"reset\" onclick=\"ConfirmCancel()\" value=\"";
        // line 101
        echo getLang("Cancel");
        echo "\" class=\"btn btn-danger\">
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t</form>
</div>

<script type=\"text/javascript\">
\tvar updateExchageRateSequency = new Array();
\tvar PopupPositioned = false;

\tfunction ToggleDeleteBoxes(Status) {
\t\tvar fp = document.getElementById(\"frmCurrency\").getElementsByTagName('input');

\t\tfor (var i=0; i < fp.length; i++) {
\t\t\tif (!fp[i].getAttribute('disabled'))
\t\t\t\tfp[i].checked = Status;
\t\t}
\t}

\tfunction getSelected() {
\t\tvar inputs = document.getElementById(\"frmCurrency\").getElementsByTagName('input');
\t\tvar nodes  = new Array();

\t\tfor (var i=0; i<inputs.length; i++) {
\t\t\tif (inputs[i].type == \"checkbox\" && inputs[i].name == \"currencies[]\" && inputs[i].checked)
\t\t\t\tnodes[nodes.length] = inputs[i];
\t\t}

\t\treturn nodes
\t}

\tfunction hasSelected() {
\t\tvar nodes = getSelected();
\t\treturn nodes.length > 0;
\t}

\tfunction ConfirmDeleteSelected() {
\t\tif (hasSelected()) {
\t\t\tif (confirm(\"";
        // line 140
        echo getLang("ConfirmDeleteCurrency");
        echo "\")) {
\t\t\t\t\$('#frmCurrency').attr('action', 'index.php?ToDo=settingsDeleteCurrencies');
\t\t\t\tdocument.getElementById(\"frmCurrency\").submit();
\t\t\t}
\t\t} else {
\t\t\talert(\"";
        // line 145
        echo getLang("ChooseCurrencyDelete");
        echo "\");
\t\t}
\t}

\tfunction ConfirmUpdateSelectedExchangeRate() {
\t\tvar nodes = getSelected();

\t\tif (nodes.length > 0) {
\t\t\tif (confirm(\"";
        // line 153
        echo getLang("ConfirmUpdateCurrencyExchangeRate");
        echo "\")) {
\t\t\t\tvar spans  = document.getElementById(\"frmCurrency\").getElementsByTagName('span');
\t\t\t\tvar substr = \"currencyexchangeratestatus-\";

\t\t\t\tfor (var i=(spans.length-1); i>=0; i--) {
\t\t\t\t\tif (spans[i].id.substring(0, substr.length) == substr) {
\t\t\t\t\t\tvar parent = spans[i].parentNode;
\t\t\t\t\t\tparent.removeChild(spans[i]);
\t\t\t\t\t}
\t\t\t\t}

\t\t\t\tupdateExchageRateSequency = new Array();

\t\t\t\tfor (var i=0; i<nodes.length; i++)
\t\t\t\t\tupdateExchageRateSequency[updateExchageRateSequency.length] = nodes[i].value;

\t\t\t\tupdateExchangeRate(updateExchageRateSequency[0], 0);
\t\t\t}
\t\t} else {
\t\t\talert(\"";
        // line 172
        echo getLang("ChooseCurrencyUpdate");
        echo "\");
\t\t}
\t}

\tfunction updateExchangeRate(id, seq) {
\t\t\$.ajax({
\t\t\turl     : url,
\t\t\tdata    : \"w=updateExchangeRate&cid=";
        // line 179
        echo twig_safe_filter((isset($context['SelectedCurrencyModuleId']) ? $context['SelectedCurrencyModuleId'] : null));
        echo "&currencyid=\" + id + \"&seq=\" + seq,
\t\t\tasync   : true,
\t\t\tcache   : false,
\t\t\tsuccess : ProcessData
\t\t});
\t}

\tfunction ProcessData(data) {
\t\teval('var data = ' + data);
\t\tvar currencyExchangeRateNode = document.getElementById(\"currencyexchangerate-\" + data.id);
\t\tvar statusNode               = document.createElement(\"span\");
\t\tvar text, colour;

\t\tstatusNode.id                = \"currencyexchangeratestatus-\" + data.id;
\t\tstatusNode.style.marginLeft  = \"10px\";
\t\tstatusNode.style.fontSize    = \"0.8em\";
\t\tstatusNode.style.fontWeight  = \"bold\";

\t\tswitch (data.status) {
\t\t\tcase 0:
\t\t\t\tcolour = \"green\";
\t\t\t\ttext   = \"(";
        // line 200
        echo getLang("CurrencyExchangeRateUpdateSuccess");
        echo ")\";
\t\t\t\tcurrencyExchangeRateNode.innerHTML = data.newRate;
\t\t\t\tbreak;
\t\t\tcase 2:
\t\t\t\tcolour = \"blue\";
\t\t\t\ttext   = \"(";
        // line 205
        echo getLang("CurrencyExchangeRateUpdateInvalid");
        echo ")\";
\t\t\t\tbreak;
\t\t\tcase 1:
\t\t\tdefault:
\t\t\t\tcolour = \"red\";
\t\t\t\ttext   = \"(";
        // line 210
        echo getLang("CurrencyExchangeRateUpdateFailed");
        echo ")\";
\t\t\t\tbreak;
\t\t}

\t\tstatusNode.style.color = colour;
\t\tstatusNode.appendChild(document.createTextNode(text));
\t\tcurrencyExchangeRateNode.appendChild(statusNode);

\t\tif (data.seq < (updateExchageRateSequency.length - 1))
\t\t\twindow.setTimeout(\"updateExchangeRate(\" + updateExchageRateSequency[data.seq+1] + \", \" + (data.seq+1) + \");\", 1);
\t}

\tfunction ConfirmCancel() {
\t\tif(confirm(\"";
        // line 223
        echo getLang("ConfirmCancelCurrencySettings");
        echo "\")) {
\t\t\tdocument.location.href = \"index.php?ToDo=viewCurrencySettings\";
\t\t}
\t}

\tfunction ShowTab(T) {
\t\ti = 0;
\t\twhile (document.getElementById(\"tab\" + i) != null) {
\t\t\tdocument.getElementById(\"div\" + i).style.display = \"none\";
\t\t\tdocument.getElementById(\"tab\" + i).className = \"\";
\t\t\ti++;
\t\t}

\t\tdocument.getElementById(\"div\" + T).style.display = \"\";
\t\tdocument.getElementById(\"tab\" + T).className = \"active\";
\t\tdocument.getElementById(\"currentTab\").value = T;
\t}

\tfunction CheckCurrencyForm() {
\t\tif (\$(\"#currencytype2\").attr('checked')) {
\t\t\tif (isNaN(priceFormat(\$(\"#DefaultCurrency\").val())) || \$(\"#DefaultCurrency\").val() < 0) {
\t\t\t\talert(\"";
        // line 244
        echo getLang("EnterACurrency");
        echo "\");
\t\t\t\t\$(\"#DefaultCurrency\").focus();
\t\t\t\t\$(\"#DefaultCurrency\").select();
\t\t\t\treturn false;
\t\t\t}
\t\t}
\t\treturn true;
\t}

\tfunction ConfirmSetAsDefault(currencyId) {
\t\t\$(\"#";
        // line 254
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "ButtonYes\").click(function() { location.href = \"index.php?ToDo=settingsSetAsDefaultCurrency&currencyId=\" + currencyId + \"&updatePrice=0\" });
\t\t\$(\"#";
        // line 255
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "ButtonYesPrice\").click(function() { location.href = \"index.php?ToDo=settingsSetAsDefaultCurrency&currencyId=\" + currencyId + \"&updatePrice=1\" });
\t\t\$(\"#";
        // line 256
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "ButtonNo\").click(function() { \$(\"#";
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").hide(\"slow\"); });

\t\tif (!PopupPositioned) {
\t\t\t\$(\"#";
        // line 259
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").css(\"left\", ((\$(window).width() - \$(\"#";
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").width()) / 2) + \"px\");
\t\t\t\$(\"#";
        // line 260
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").css(\"top\", ((\$(window).height() - \$(\"#";
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").height()) / 2) + \"px\");
\t\t\tPopupPositioned = true;
\t\t}

\t\t\$(\"#";
        // line 264
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\").show(\"slow\", function() { \$(\"#";
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "ButtonYes\").focus(); });
\t}

\t\$(document).ready(function() {
\t\tShowTab(";
        // line 268
        echo twig_safe_filter((isset($context['DefaultTab']) ? $context['DefaultTab'] : null));
        echo ");
\t});
</script>

<div class=\"Popup\" id=\"";
        // line 272
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "\" style=\"display:";
        echo twig_safe_filter((isset($context['PopupDisplay']) ? $context['PopupDisplay'] : null));
        echo ";\">
\t<div class=\"PopupToolbar\">
\t\t<div class=\"PopupToolbarLeftCorner\"></div>
\t\t<div class=\"PopupToolbarRightCorner\"></div>
\t\t<div class=\"PopupToolbarTools\">
\t\t\t<ul>
\t\t\t\t<li><img src=\"images/popupbuttonclose.gif\" alt=\"\" border=\"0\" onclick=\"\$('#";
        // line 278
        echo twig_safe_filter((isset($context['PopupID']) ? $context['PopupID'] : null));
        echo "').hide('slow');\" /></li>
\t\t\t\t";
        // line 279
        echo twig_safe_filter((isset($context['PopupTools']) ? $context['PopupTools'] : null));
        echo "
\t\t\t</ul>
\t\t</div>
\t</div>
\t
\t<div class=\"PopupDocument\">
\t\t<div class=\"PopupDocumentImg\" style=\"display:";
        // line 285
        echo twig_safe_filter((isset($context['PopupImgDisplay']) ? $context['PopupImgDisplay'] : null));
        echo "\">
\t\t\t<img src=\"";
        // line 286
        echo twig_safe_filter((isset($context['PopupImgSrc']) ? $context['PopupImgSrc'] : null));
        echo "\" />
\t\t</div>
\t\t
\t\t<div class=\"PopupDocumentBody\">
\t\t\t<p><h2>";
        // line 290
        echo twig_safe_filter((isset($context['PopupHeader']) ? $context['PopupHeader'] : null));
        echo "</h2></p>
\t\t\t<p>";
        // line 291
        echo twig_safe_filter((isset($context['PopupContent']) ? $context['PopupContent'] : null));
        echo "</p>
\t\t</div>
\t</div>
</div>";
    }

}
