{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$header.razdel_name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.voip.settings_help_1}
    </div>
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a class="current">{$lang.admin_menu.voip_settings}</a>
    </li>
    <li>
        <a href="admin_voip_statistics.php">{$lang.admin_menu.voip_statistics}</a>
    </li>
</ul>

	{if $form.error}<div id="error_box" class="error_box_blue" style="display:table;padding:10px 0;">* {$form.error}</div><div style="height:10px;">&nbsp;</div>{/if}
	
	<form action="admin_voip_settings.php" method="post" enctype="multipart/form-data" name="settings">
	{$form.hiddens}
	<table style=" border-spacing: 0 5px;padding: 0 10px;" cellpadding="0" cellspacing="0" class="panel_section">
<tr>
		<td class="text_head">{$lang.voip.admin_name}:</td>
		<td><input type="text" size="40" name="admin_name" value="{$settings.voip_admin}" /></td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="text_head">{$lang.voip.admin_password}:</td>
		<td><input type="password" AUTOCOMPLETE="off" size="40" name="admin_password" value="{$settings.voip_admin_pass}" /></td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="text_head">{$lang.voip.account_id}:</td>
		<td><input type="text" name="account_id" size="40" value="{$settings.voip_accountid}" /></td>
		<td><i>&nbsp;&nbsp;* {$lang.voip.account_id_comment}</i></td>
	</tr>
	<tr>
		<td class="text_head">{$lang.voip.admin_percent}:</td>
		<td><input type="text" name="admin_percent" size="5" value="{$settings.voip_admin_percent}"/></td>
		<td><i>&nbsp;%&nbsp;&nbsp;* {$lang.voip.admin_percent_comment}</i></td>
	</tr>
	{*<tr>
		<td class="text_head">{$lang.voip.currency_rate}:</td>
		<td>1 {$settings.site_currency} = <input type="text" name="curr_rate" size="5" value="{$settings.voip_currency_rate}" {if !$settings.edit_rate}disabled="disabled"{/if}/></td>
		<td><i> {$balance.jajah_currency_name}&nbsp;&nbsp;* {$lang.voip.currency_rate_comment}</i></td>
	</tr>*}
	<tr>
		<td class="text_head">{$lang.voip.cost_minute}:</td>
		<td><input type="text" name="voip_cost_minute" size="5" value="{$settings.voip_cost_minute}"/></td>
		<td><i>&nbsp;&nbsp;* {$lang.voip.account_id_comment}</i></td>
	</tr>
	<tr>
		<td class="text_head">{$lang.voip.voip_phone}:</td>
		<td><input type="text" name="voip_phone" size="15" value="{$settings.voip_phone}"/></td>
		<td><i>&nbsp;&nbsp;* {$lang.voip.account_id_comment}</i></td>
	</tr>
	  </table>
	  <a href="#" class="admin_button_major" onclick="javascript: checkForm(document.settings); return false;">{$lang.button.save}<span>&nbsp;</span></a>
   </form>
<script type="text/javascript">
{literal}
function checkForm(form){
	if (form.admin_name.value == ''){
		alert('{/literal}{$lang.voip.err.empty_adminname|escape:javascript}{literal}');
		return false;
	}
	if (form.admin_password.value == ''){
		alert('{/literal}{$lang.voip.err.empty_adminpassword|escape:javascript}{literal}');
		return false;
	}
	if (form.account_id.value == ''){
		alert('{/literal}{$lang.voip.err.empty_accountid|escape:javascript}{literal}');
		return false;
	}
	percent = parseInt(form.admin_percent.value);
	if (percent < 1){
		alert('{/literal}{$lang.voip.err.wrong_percent|escape:javascript}{literal}');
		return false;
	}
	rate = Math.round(parseFloat(form.curr_rate.value)*1000)/1000;
	if (rate <= 0){
		alert('{/literal}{$lang.voip.err.wrong_rate|escape:javascript}{literal}');
		return false;
	}
	form.submit();
}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}