<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin}: {$language.lblLocalizationSettings} : {$language.lblCurrency}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
{include file='CommonCustomStyles.tpl'}
</head>
<body>
<div class="outer_container">
  {include file='CommonTop.tpl'} 
  <!--End:Header Container-->
  <!--***********************************************************************START CONTAINER SECTION******************************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar localization">
      <div class="side_wrapper"> 
        {include file='localizationRighLinks.tpl'} </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
  		<div class="content_wrapper">
        <h2>{$language.lblCurrencies}</h2>    
		{if $addPrivilege}
          <div class="info-message" id="msg-info">{$language.lblCurrencyDropDownText} </div>
		  {/if}
          <div class="clear"></div>
          <div class="add_conatiner"> 
          {form->start name="formStdCurrency" action="" error_class="message_inline_validation" method="post" enctype="multipart/form-data"}
          {if $addPrivilege}
          <div class="search_container">
            <div class="inner single-box">
            <ul class="clearfix">
            <li class="column">
              <p class="label-field01">{$language.lblCurrency}</p>
                <span class="textfield01">{form->select name="currencyCodeStandard" options=$resStdCurrencies caption="->{$language.lblSelectCurrency}" validate="required" error=$language.errCurrency class="select-box"}</span></li>
                <li class="column">
              <p class="label-field01">{$language.lblExchangeRate}</p>
                <span class="textfield01">
				 {form->hidden name="minCurrencyValue" value=0}
				 {form->textbox name="currencyValueStandard" size="10" maxlength="10" class="text-box"  validate="required~*isNumber~*currencyValueStandard->gt->minCurrencyValue" error=$language.errRequired|cat:"~*"|cat:$language.errValidRateShort|cat:"~*"|cat:$language.errValidRateShort}   				
				</span></li>
                <li class="column">
              {form->submit name="updateStdCurrency" value="{$language.lblAdd}" class="button01"}
                {form->button name="cancel_std_currency" value="{$language.lblCancel}" class="action-link"}
                </li>
                </ul>
            </div>
            </div>
            {/if}
            {form->close}
           
          <div id="common_message" ></div>
          {if $currencyDetails}
          <div class="table_listing ">
           {form->start name="formCurrency" id="formCurrency" action="" method="post" enctype="multipart/form-data"}
          <div class="clearfix">
		  
         	{if $addPrivilege}
			{html->anchor href="currency/new/"   title="{$language.lblAddCustomCurrency}" class="button-link01 add_currency fixing_right add00" content=$language.lblAddCustomCurrency}
		{/if}
          </div>
            <div class="grid_table00">
            <table width="100%" border="0" cellspacing="0" cellpadding="0"  id="table_inline_edit" >
              <tr>
			  {if $editPrivilege}
                <th align="left" valign="middle" width="2%">{$language.lblDefault}</th>
				{/if}
                <th align="left" valign="middle"  width="18%">{$language.lblLanguageCode}</th>
                <th align="left" valign="middle">{$language.lblTitle}</th>
                <th align="left" valign="middle"  width="10%">{$language.lblExchRate}</th>
                <th align="left" valign="middle"  width="10%">{$language.lblDecimal}</th>
                <th align="left" valign="middle"  width="10%">{$language.lblPosition}</th>
                <th align="left" valign="middle"  width="7%">{$language.lblSymbol}</th>
				{if $editPrivilege || $deletePrivilege} 
                <th align="center" valign="middle"  width="65" >&nbsp;</th>
				{/if}
              </tr>
              {if $currencyDetails}              
              {foreach from=$currencyDetails item="currency" key="key"}              
              {if $currency.currencyDefault eq 'Yes'}              
              {assign var ="checked" value="checked"}              
              {else}              
              {assign var ="checked" value=""}              
              {/if}
              <tr id="editable_tr{$currency.currencyID}">
			  {if $editPrivilege}
                <td align="left" valign="top" class="checkbox_column">
                     {form->radio checked=$checked name="currencyDefault" class="checkbox01" value=$currency.currencyID} 
                 </td>
				 {/if}
                <td align="left" valign="top">
                   {$currency.currencyCode}
                </td>
                <td align="left" valign="top">
                {$currency.currencyName}
                </td>
                <td align="left" valign="top">
                {$currency.currencyValue}
                </td>
                <td align="left" valign="top">
                  {$currency.currencyDecimalPlaces}
                </td>
                {if $currency.currencySymbolLeft !=""}                
                {assign var="symbPos" value="Left"}                 
                {assign var="symbVal" value=$currency.currencySymbolLeft}                 
                {else}                
                {assign var="symbPos" value="Right"}                 
                {assign var="symbVal" value=$currency.currencySymbolRight}                 
                {/if}
                <td align="left" valign="top">{$symbPos}</td>
                <td align="left" valign="top"> {$symbVal} </td>
				{if $editPrivilege || $deletePrivilege} 
                <td align="left" valign="top"><span id="actionField_{$currency.currencyID}" class="actionField">
				{if $editPrivilege}
					{html->anchor href="currency/edit/id/{$currency.currencyID}/" id="{$currency.currencyID}" title="Edit Currency" class="edit02 icon-set add00 mouse_pointer button_inline_edit"  content={$language.lblEditCurrrency|default:''}} 
				{/if}
				{if $deletePrivilege}
					{if $currency.currencyDefault eq 'No' && $currency.currencyID!=1 && $currency.productCount lt 1}
						{html->anchor confirm="{$language.msgSelectAtleastOne}" href="currency/destroy/id/"|cat:$currency.currencyID|cat:"/"  alt="delete" class="delete02 icon-set"  confirm_head=$language.lblDelete}  
					{elseif $currency.productCount gt 0} 
						{html->anchor title="{$language.lblProductCurrencyExists}"  class="delete02-inactive icon-set"}               
					{else} 
						{html->anchor title="{$language.lblCannotDeleteDefaultCurrency}"  class="delete02-inactive icon-set"}
				{/if}
				{/if}
				</span> </td>
				{/if}
              </tr>
              {assign var="last_tr_ID" value=$currency.currencyID}
              {/foreach}
              <tr id="wait_text" class="hide">
                <td colspan="8" align="center" valign="top"><img src="{$view_images}/loader-1.gif" /></td>
              </tr>
              <tr id="add_new_tr"></tr>
            </table>
            {form->hidden name="value_changed" id="value_changed" value="0"}    
            {form->hidden name="value_new" id="value_new" value="0"}            
            {/if}  
            </div>
            {if $editPrivilege || $updateRatePrivilege}    
              <div class="action_box">
              	{if $editPrivilege}
					{form->submit name="setDefaultCurrency" value=$language.lblSetAsDefault class="button04" tabindex="9"}
				{/if}
				{if $updateRatePrivilege} 
					{form->submit name="updateCurrencyRate" value=$language.lblUpdateExchRate class="button04" tabindex="10"}
				{/if}	
            </div>
            {/if}
              <div class="updatebtn fixing_right hide" id="rows_list_update_buttons">
               {form->submit name="updateCurrency" id="editsubmitCurrency"  onclick="return validateForm(this.id);" value="{$language.lblSave}" form="formCurrency" class="linkbtnt01 " validate="yes" tabindex="7"} 
              {form->button_reset name="cancelCurrency" value="{$language.lblCancel}"  form="formCurrency" class="action-link " tabindex="8"}
                <div class="clear"></div>
            </div>
            <div class="clear"></div>    
            {form->close} 
           </div>
          {else}
          <div class="message_norecord" id="common_message">{$language.lblNoCurrenciesFound}</div>
          {/if}
          <!--End:From Listing-->
      </div>
    </div>
  </div>
  <!--End: left Block-->
</div>
<!--End:Content Container-->
{include file='CommonBottom.tpl'}
</div>
{include file='CommonJavaScriptBottom.tpl'}
{form->validate_script form="formStdCurrency"}
{html->messages_script id="common_message"}
<script type="text/javascript">
	var req="{$language.errRequired}";
	var errValidRateShort="{$language.errValidRateShort}";
	var errNumericsOnly="{$language.errNumericsOnly}";
</script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
	$(".add00").colorbox({iframe:true, innerWidth:700, innerHeight:400});
		$('.side_wrapper ul li a[rel=currency]').addClass('selected'); 
		setSideMenu();
		$(document).on('click',"#formStdCurrency #cancel_std_currency",function(){
		$("#formStdCurrency .message_inline_validation").addClass("hide"); 
		$("#formStdCurrency").each(function(){
			  this.reset();
			});
		if($('#currencyValueStandard').val()!='')
		{
			$('#currencyValueStandard').val('');
		}
		if($("#currencyCodeStandard option:selected").length)
		{
			$('#currencyCodeStandard :selected').attr('selected', '');

		}
	})
	
});
{/literal}
</script>
</body>
</html>
