<div style="padding-top: 15px; ">
	<font class="main_header_text">{$lang.sms_payments.rates_for_system}</font>
</div>
<div style="padding-top: 15px; ">
	<a target="_blank" href="https://secure.zaypay.com/public/en/outpayment">{$lang.sms_payments.prices_link_text}</a>&nbsp;
</div>
<div style="padding-top: 15px; ">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr class="table_header">
	<td class="main_header_text" align="left" width="15%" nowrap>{$lang.sms_payments.name}</td>
	<td class="main_header_text" align="left" width="15%" nowrap>{$lang.sms_payments.subscribers_cost},&nbsp;{$data.cur}</td>
	<td class="main_header_text" align="left" nowrap>{$lang.sms_payments.subscribers_site_charging},&nbsp;{$data.cur}</td>
    <td class="main_header_text" align="left" width="15%">{$lang.sms_payments.zaypay.price_setting_id}</td>
	<td class="main_header_text" align="left" width="30%" >{$lang.sms_payments.zaypay.price_setting_key}</td>
	<td width="10%" align="right">{$lang.button.action}</td>
</tr>
{foreach item=item from=$data.rates name=j}
<tr {if $smarty.foreach.j.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
    <td class="main_content_text" align="left" nowrap>{$item.name}
	<td class="main_content_text" align="left">{$item.cost_for_user}</td>
	<td class="main_content_text" align="left">{$item.goes_to_site}</td>
    <td class="main_content_text" align="left">{$item.price_setting_id}</td>
	<td class="main_content_text" align="left">{$item.price_setting_key}</td>
	<td class="main_content_text" align="right" nowrap>
							<div style="width:10px;float:right;" class="fl">&nbsp;</div>
							<div class="block_action fr" style="display: none;">
								<div class="action_del" style="display: block;">
									<img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" src="{$site_root}{$template_root}/images/photo_delete.png" onclick="{literal} if (confirm('{/literal}{$lang.confirm.rate}{literal}')) {document.location.href='admin_sms_payments.php?sel=delete_rate&id_rate={/literal}{$item.id}{literal}&settype=zaypay'} else {return false;} {/literal}">
								</div>
							</div>			
							<div style="width:10px;float:right;" class="fl">&nbsp;</div>
							<div class="block_action fr" style="display: none;">
								<div class="action_del" style="display: block;">
									<img width="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" src="{$site_root}{$template_root}/images/edit.png" onclick="ShowEditRateDiv('{$item.id}'); return false;">
								</div>
							</div>			
{*		<a href="#" onclick="ShowEditRateDiv('{$item.id}'); return false;">{$lang.button.edit}</a>
		&nbsp;
		<a href="#" onclick="{literal} if (confirm('{/literal}{$lang.confirm.rate}{literal}')) {document.location.href='admin_sms_payments.php?sel=delete_rate&id_rate={/literal}{$item.id}{literal}&settype=zaypay'} else {return false;} {/literal}">{$lang.button.delete}</a>
*}	</td>
</tr>
{/foreach}
<tr class="table_header"><td colspan="6"></td></tr>
</table>
</div>
<div style="padding-top: 15px; "><a href="#" onclick="ShowAddRateDiv();return false;">Add rate</a>
</div>
<div id="add_rate" style="display: none;">
	<div style="padding-top: 15px;  ">
	<table cellpadding="0" cellspacing="0">
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.name}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="name" value="">
		</td>
	</tr>
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.subscribers_cost},&nbsp;{$data.cur}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="cost_for_user" value="">&nbsp;<i>{$lang.payment.update_account_page.account_to_add_hint}</i>
		</td>
	</tr>
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.subscribers_site_charging},&nbsp;{$data.cur}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="goes_to_site" value="">&nbsp;<i>{$lang.payment.update_account_page.account_to_add_hint}</i>
		</td>
	</tr>
    <tr>
        <td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.zaypay.price_setting_id}:&nbsp;</td>
        <td style="padding:10px;" width="99%">
            <input type="text" name="price_setting_id" value="">
        </td>
    </tr>
	<tr>
		<td class="main_header_text" align="left"  width="1%" nowrap style="padding:10px;">{$lang.sms_payments.zaypay.price_setting_key}:&nbsp;</td>
		<td style="padding:10px;" width="99%">
			<input type="text" name="price_setting_key" value="" size="35">
		</td>
	</tr>
	<tr>
		<td colspan="2" align="left" style="padding:10px;">
		<a class="admin_button_major" onclick="document.sms_systems.submit();">{$button.add}<span>&nbsp;</span></a>
		{*<input type="submit" value="{$button.add}">*}
		</td>
	</tr>
	</table>
	</div>
</div>
<div id="edit_rate" style="display: none;">
	<div style="padding-top: 15px;  ">
	<input type="hidden" id="edit_id_rate" name="edit_id_rate" value="">
	<input type="hidden" id="is_edit" name="is_edit" value="1">
	<table cellpadding="0" cellspacing="0">
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.name}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="edit_name" id="edit_name" value="">
		</td>
	</tr>
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.subscribers_cost},&nbsp;{$data.cur}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="edit_cost_for_user" id="edit_cost_for_user" value="">&nbsp;<i>{$lang.payment.update_account_page.account_to_add_hint}</i>
		</td>
	</tr>
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.subscribers_site_charging},&nbsp;{$data.cur}:&nbsp;</td>
		<td width="99%" style="padding:10px;">
			<input type="text" name="edit_goes_to_site" id="edit_goes_to_site" value="">&nbsp;<i>{$lang.payment.update_account_page.account_to_add_hint}</i>
		</td>
	</tr>
    <tr>
        <td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.zaypay.price_setting_id}:&nbsp;</td>
        <td style="padding:10px;" width="99%">
            <input type="text" value="" name="edit_price_setting_id" id="edit_price_setting_id">
        </td>
    </tr>
	<tr>
		<td class="main_header_text" align="left" width="1%" nowrap style="padding:10px;">{$lang.sms_payments.zaypay.price_setting_key}:&nbsp;</td>
		<td style="padding:10px;" width="99%">
			<input type="text" value="" name="edit_price_setting_key" id="edit_price_setting_key" size="35">
		</td>
	</tr>
	<tr>
		<td colspan="2" align="left" style="padding:10px;">
		{*<input type="submit" value="{$button.save}">*}
		<a class="admin_button_major" onclick="document.sms_systems.submit();">{$button.save}<span>&nbsp;</span></a>
		</td>
	</tr>
	</table>
	</div>
</div>
{literal}
<script type="text/javascript">
function ShowAddRateDiv() {
	if (document.getElementById('add_rate').style.display == 'none') {
		document.getElementById('add_rate').style.display = 'inline';
	} else {
		document.getElementById('add_rate').style.display = 'none';
	}
	document.getElementById('edit_rate').style.display = 'none';
	CleanEditValues();
	return;
}

function ShowEditRateDiv(id) {
	document.getElementById('edit_rate').style.display = 'inline';
	document.getElementById('add_rate').style.display = 'none';
	CleanEditValues();
	FillEditRateFields(id);
}

function CleanEditValues() {
	document.getElementById('is_edit').value = '';
	document.getElementById('edit_id_rate').value = '';
	document.getElementById('edit_name').value = '';
	document.getElementById('edit_cost_for_user').value = '';
	document.getElementById('edit_goes_to_site').value = '';
    document.getElementById('edit_price_setting_id').value = '';
	document.getElementById('edit_price_setting_key').value = '';
	return;
}

function FillEditRateFields(id) {
	{/literal}
	{foreach item=item from=$data.rates}
	{literal}
	if (id == {/literal}{$item.id}{literal}) {
		document.getElementById('is_edit').value = '1';
		document.getElementById('edit_id_rate').value = '{/literal}{$item.id}{literal}';
		document.getElementById('edit_name').value = '{/literal}{$item.name}{literal}';
		document.getElementById('edit_cost_for_user').value = '{/literal}{$item.cost_for_user}{literal}';
		document.getElementById('edit_goes_to_site').value = '{/literal}{$item.goes_to_site}{literal}';
        document.getElementById('edit_price_setting_id').value = '{/literal}{$item.price_setting_id}{literal}';
		document.getElementById('edit_price_setting_key').value = '{/literal}{$item.price_setting_key}{literal}';
	}
	{/literal}
	{/foreach}
	{literal}
}
function ShowCodesDiv() {
	document.getElementById('c_codes').style.display = 'inline';
	return false;
}
function HideCodesDiv() {
	document.getElementById('c_codes').style.display = 'none';
	return false;
}

</script>
{/literal}