{*{include file="$admingentemplates/admin_top.tpl"}

<div class="back">
    <a href="{$site_url}{$site_root}/admin/affiliate/aff_summary.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.affiliate.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.admin_help.aff_settings}
    </div>
</div>
<div class="cr">&nbsp;</div>

<ul class="tabs" style="width: 100.5%;">
    <li>
        <a href="aff_summary.php">{$lang.aff.tab_1}</a>
    </li>
    <li>
        <a href="aff_sales.php">{$lang.aff.tab_2}</a>
    </li>
	<li>
        <a href="aff_affiliates.php">{$lang.aff.tab_3}</a>
    </li>
	<li>
        <a href="aff_ads.php">{$lang.aff.tab_4}</a>
    </li>
	<li>
        <a href="aff_stats.php">{$lang.aff.tab_5}</a>
    </li>
	<li>
        <a class="current" href="#">{$lang.aff.tab_6}</a>
    </li>
</ul>*}

{literal}

<SCRIPT LANGUAGE="JavaScript">
<!-- //hide
function SetChose() {
    switch ( data.TYPE_AFF.value )
    {
{/literal}
	case 'registration':
		document.data.COST.disabled=false;
		document.data.COMMISSION.disabled=true;
		break;
	case 'payment':
		document.data.COMMISSION.disabled=false;
		document.data.COST.disabled=true;
		break;
{literal}
    }
}
//-->
</SCRIPT>

{/literal}
<div class="panel">
	<div class="panel_section">
		<div class="panel_content" style="width:95%">
		
<form action='affiliate/aff_editsettings.php?ajax=1' method='POST' name="data" style="margin:0px">
<input type="hidden" name='action' value='Save'>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
  <td colspan=2><b>{$lang.affiliate.affiliate_settings}:</b></td>
</tr>
<!------------------------------------------------------------------------------------------------------------------------------------------>
<tr>
	<td valign="top">{$lang.affiliate.affiliate_type}:</td>
	<td>
		<select name="TYPE_AFF" onChange="SetChose()">
			{if !$settings.aff_type}
				<option selected value="registration">{$lang.affiliate.type_registration}
				<option value="payment">{$lang.affiliate.type_payment}
			{else}
				<option value="registration">{$lang.affiliate.type_registration}
				<option selected value="payment">{$lang.affiliate.type_payment}
			{/if}
		</select>
	</td>
</tr>
<tr>
	<td valign="top">{$lang.affiliate.cost}:</td>
	{if !$settings.aff_type}
		<td><input type="text" name="COST" value="{$settings.cost}" size="30" style="padding: 1px 4px;"> $</td>
	{else}
		<td><input type="text" name="COST" value="{$settings.cost}" size="30" style="padding: 1px 4px;" disabled> $</td>
	{/if}
</tr>
<tr>
	<td valign="top">{$lang.affiliate.commission}:</td>
	{if !$settings.aff_type}
		<td><input type="text" name="COMMISSION" value="{$settings.commission}" size="30" style="padding: 1px 4px;" disabled> %</td>
	{else}
		<td><input type="text" name="COMMISSION" value="{$settings.commission}" size="30" style="padding: 1px 4px;"> %</td>
	{/if}
</tr>
<!------------------------------------------------------------------------------------------------------------------------------------------>
<tr>
  <td colspan=2><b>{$lang.affiliate.affiliate_tracking}:</b></td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.cookie_period}:</td>
  <td><input type="text" name="COOKIE_VALIDITY_PERIOD" value="{$settings.cookie_period}" size="30" style="padding: 1px 4px;"> {$lang.affiliate.days}</td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.ip_period}:</td>
  <td><input type="text" name="IP_VALIDITY_PERIOD" value="{$settings.ip_period}" size="30" style="padding: 1px 4px;"> {$lang.affiliate.hours}</td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.keep_max}:</td>
  <td><input type="text" name="IP_LIMIT" value="{$settings.ip_maximum}" size="30" style="padding: 1px 4px;"> {$lang.affiliate.ips}</td>
</tr>
<tr>
  <td colspan=2><b>{$lang.affiliate.other_settings}:</b></td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.script_url}:</td>
  <td><input type="text" name="SITEURL" value="{$settings.script_url}" size="30" style="padding: 1px 4px;"> </td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.info_email}:</td>
  <td><input type="text" name="ADMIN_EMAIL_ADDRESS" value="{$settings.email}" size="30" style="padding: 1px 4px;"> </td>
</tr>
<tr>
  <td valign="top">{$lang.affiliate.keep_stat}:</td>
  <td><input type="text" name="STATS_PERIOD" value="{$settings.keep_stat}" size="30" style="padding: 1px 4px;"> {$lang.affiliate.months}</td>
</tr>
</table>
</form>

		</div>
	</div>
<div style="float:left;">
	<div class="fl" style="text-align:left;">
		<a href="#" class="admin_button_major" style="margin:0px;" id="" onclick="javascript:document.data.action.value='Save'; document.data.submit();">{$lang.button.save}<span>&nbsp;</span></a>
	</div>	
</div>
</div>
{*
{include file="$admingentemplates/admin_bottom.tpl"}*}
