<!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.lblSettings} : {$language.lblPaymentDiscounts} : {$language.lblEditPayment}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/inner-formlisting.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
{include file='CommonCustomStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/chosen.css" media="screen"/>
</head>
<body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--****************************************************END HEADER CONTAINER*********************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar">
      <div class="side_wrapper"> {include file='ShippingRightLinks.tpl'} </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
    
      <div class="content_wrapper">
        <h2>{$language.lblEditPayment} - {$paySetGroupLabel}</h2>
        <div class="form_listing form_listing03"> {form->start name="formPaymentGateway" method="post" action=""}
          {form->hidden name="submit_button_click" value=""}
          <ul>
            {foreach from=$resPaymentSettings item="paymentSettings" key="key"}
            {assign var="tabvalue" value=$key+1}
            <li class="clearfix">
              <div class="leftside01 {if $paymentSettings.paySetValidate|strpos:"required" !== false}mandatory{/if}">{$paymentSettings.paySetLabel}
                {if $paymentSettings.paySetKey eq 'payment_currency'}<br />
                <span> ({$language.lblSupportingCurrencyCodes}) {/if}</span> </div>
              <div class="rightside01"> {if $paymentSettings.paySetType=="textbox"}                   
                {if $paymentSettings.paySetKey eq 'payment_gateway_charge' || $paymentSettings.paySetKey eq 'payment_gateway_charge_percent'} 
                {form->textbox class="textbox" tabindex=$tabvalue name=$paymentSettings.paySetKey value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError maxlength="10"}
                {elseif $paymentSettings.paySetKey eq 'payment_currency'} 
                {form->textbox class="textbox" style="width:91% !important;" tabindex=$tabvalue name=$paymentSettings.paySetKey value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}                                    
                {else}                  
                {form->textbox class="textbox" tabindex=$tabvalue name=$paymentSettings.paySetKey value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {/if}  
                {elseif $paymentSettings.paySetType=="textarea"}
                {form->textarea name=$paymentSettings.paySetKey tabindex=$tabvalue  value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {elseif $paymentSettings.paySetType=="upload"}
                {form->upload name=$paymentSettings.paySetKey class="class01" validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError} 
                {elseif $paymentSettings.paySetType=="select"}
                {if $paymentSettings.paySetKey eq 'transaction_currencies'} 
                {form->select name=$paymentSettings.paySetKey style="width:91% !important;" id="transactionCurrencies" tabindex=$tabvalue options=$listCurrencyCodes multiple="multiple" value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {else}
                {form->select name=$paymentSettings.paySetKey tabindex=$tabvalue options=$paymentSettings.paySetOptions value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {/if}
                {elseif $paymentSettings.paySetType=="password"}
                {form->password name=$paymentSettings.paySetKey tabindex=$tabvalue class="textbox" value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {elseif $paymentSettings.paySetType=="checkbox"}
                {if $paymentSettings.paySetOptions == $paymentSettings.paySetValue}
                {assign var="checked" value="checked"}
                {else}
                {assign var="checked" value=""}
                {/if}
                {if $paymentSettings.paySetKey eq 'payment_card_type'}
                {form->hidden name="payment_card_type" value=""}
                {form->hidden name="paySetCardypeValue" value=$paymentSettings.paySetValue}
                <div class="grid_table00 " >
                  <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                    <tr>
                      <th width="5%" align="left" valign="middle"  class="checkbox_column">{form->checkbox id="SelectAllCheckbox" name="SelectAllCheckbox"} </th>
                      <th align="left" valign="middle"  >{$language.lblCardCode}</th>
                      <th align="left" valign="middle" >{$language.lblCardName}</th>
                      <th align="left" valign="middle" >{$language.lblRequireCVV2}</th>
                    </tr>
                    {assign var=selectedCardTypes value="~*"|explode:$paymentSettings.paySetValue}  
                    {foreach from=$listPaymentCards item="paymentCard" key="key1"}
                    {assign var="cardTypeID" value=$paymentCard.cardTypeID}
                    {assign var="cardTypeValue" value=$paymentCard.cardType|cat:"->"|cat:$paymentCard.cardTypeCode}
                    <tr {if $key1%2!=0} class="shade01" {/if}>
                      <td>{form->checkbox id="check_$cardTypeID" name="checkcardTypeIDs[]" class="checkbox01 ListAll List"|cat:$paymentCard.status value=$cardTypeValue }</td>
                      <td>{$paymentCard.cardTypeCode}</td>
                      <td>{$paymentCard.cardType}</td>
                      <td>{$paymentCard.enableCVV2}</td>
                    </tr>
                    {/foreach}
                  </table>
                  {form->hidden name="selectedCardTypeIDs" value=""}
                  {if $paymentSettings.paySetValidate eq 'required'}
                  {form->validate  name="validateCardTypes" validate="selectedCardTypeIDs->required" error=$paymentSettings.paySetValidateError}
                  {/if} </div>
                <div class="clear"></div>
                {elseif $paymentSettings.paySetKey eq 'payment_methods'}
                
                {form->hidden name="payment_methods" value=""}
                
                {form->hidden name="payMethodNames" value=$paymentSettings.paySetValue}
                <div class="grid_table00" >
                  <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                    <tr>
                      <th width="5%" align="left" valign="middle"  class="checkbox_column"> {form->checkbox id="SelectAllPaymentMethods" name="SelectAllCheckbox"} </th>
                      <th align="left" valign="middle"  >{$language.lblPaymentMethodCode}</th>
                      <th align="left" valign="middle" >{$language.lblPaymentMethodName}</th>
                    </tr>
                    {assign var=selectedCardTypes value="~*"|explode:$paymentSettings.paySetValue}                       
                    {foreach from=$listNetpayPaymentMethods item="netpayPaymentMethods" key="key1"}    
                    {assign var="netpayMethodID" value=$netpayPaymentMethods.payMethodId}                      
                    {assign var="netpayMethodValue" value=$netpayPaymentMethods.methodName|cat:"->"|cat:$netpayPaymentMethods.methodCode}
                    <tr {if $key1%2!=0} class="shade01" {/if}>
                      <td>{form->checkbox id="check_$netpayMethodID" name="checknetpayMethodIDs[]" class="checkbox01 ListAllNetPay"|cat:$netpayPaymentMethods.status value=$netpayMethodValue}</td>
                      <td>{$netpayPaymentMethods.methodCode}</td>
                      <td>{$netpayPaymentMethods.methodName}</td>
                    </tr>
                    {/foreach}
                  </table>
                  {form->hidden name="selectednetpayMethod" value=""}                    
                  {if $paymentSettings.paySetValidate eq 'required'}                    
                  {form->validate  name="validateNetpayMethod" validate="selectednetpayMethod->required" error=$paymentSettings.paySetValidateError}                    
                  {/if} </div>
                <div class="clear"></div>
                {else}
                {form->checkbox name=$paymentSettings.paySetKey tabindex=$tabvalue checked=$checked  value=$paymentSettings.paySetOptions validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                {/if}
                {elseif $paymentSettings.paySetType=="radio"}              
                {if $paymentSettings.paySetKey eq 'payment_status'}       
                {assign var=$paymentSettings.paySetKey value=$paymentSettings.paySetValue}
                <div id="perioddiv"> {form->radio name="{$paymentSettings.paySetKey}" class="customradio" options="Active~*Inactive" value="Active"} </div>
                {else}
                {form->radio name=$paymentSettings.paySetKey tabindex=$tabvalue options=$paymentSettings.paySetOptions value=$paymentSettings.paySetValue validate=$paymentSettings.paySetValidate error=$paymentSettings.paySetValidateError}
                
                {/if}
                {/if} </div>
            </li>
            {/foreach}              
            {assign var="tabvaluebtn" value=$tabvalue+1}
            <li class="clearfix">
              <div class="submit-block clearfix">
              <span>&nbsp; </span>
              <div class="leftside01">&nbsp;</div>
              <div class="rightside01"> {form->submit name="submitPayment" tabindex=$tabvaluebtn id="submitPayment" class="curve-3"  value="{$language.lblUpdate}"} {$language.lblOr} 
                {html->anchor href=$previousURL id="cancel" class="cancelPayment" tabindex=$tabvaluebtn caption="{$language.lblCancel}"} </div>
            </li>
          </ul>
          {form->close} </div>
        <!--End:Table Listing--> 
      </div>
    </div>
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container--> 
{form->basepath_script}
{form->rootpath_script}
{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript" src="{$view_javascript}/paymentAdd.page.js"></script> 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/custom-radiobutton.js"></script> 
<script language="javascript" type="text/javascript">
if($("#transactionCurrencies").length>0) {
	$("#transactionCurrencies").chosen();
}
</script> 
<script type="text/javascript">
$(function(){
	 $("#perioddiv input").customInput('');
	});
	$(document).ready(function(e) {
	  $('.side_wrapper ul li a[rel=paymentgateway]').addClass('selected'); 
    });
</script> 
{form->validate_script form="formPaymentGateway"}
{html->messages_script id="common_message"}
</body>
</html>
