This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/themes/default/blocks/affiliate_template/add.tpl
2011-05-03 09:49:01 +10:00

156 lines
6.8 KiB
Smarty

{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
<!-- Display the form validation -->
{if $form_validation}
{$block->display('core:alert_fields')}
{/if}
<!-- Display the form to collect the input values -->
<form id="add" method="post" action="" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{osb f=tt}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=name}</td>
<td style="width: 65%;"><input type="text" name="affiliate_template_name" value="{$VAR.affiliate_template_name}" {if $affiliate_template_name == true}class="form_field_error"{/if}/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=notes}</td>
<td style="width: 65%;"><textarea name="affiliate_template_notes" cols="40" rows="5" {if $affiliate_template_notes == true}class="form_field_error"{/if}>{$VAR.affiliate_template_notes}</textarea></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=status}</td>
<td style="width: 65%;">
{if $VAR.affiliate_template_status != ''}
{$list->bool('affiliate_template_status',$VAR.affiliate_template_status,'form_menu')}
{else}
{$list->bool('affiliate_template_status','1','form_menu')}
{/if}
</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=affiliate_plugin}</td>
<td style="width: 65%;">{$list->menu_files('','affiliate_template_affiliate_plugin',$VAR.affiliate_template_affiliate_plugin,'affiliate_plugin','','.php','form_menu') }</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_campaign_id}</td>
<td style="width: 65%;">{$list->menu_multi($VAR.affiliate_template_avail_campaign_id,'affiliate_template_avail_campaign_id','campaign','name','','5','form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_tiers}</td>
<td style="width: 65%;">
{if $VAR.affiliate_template_max_tiers == ''}
<input type="text" id="affiliate_template_max_tiers" name="affiliate_template_max_tiers" value="1" {if $affiliate_template_max_tiers == true}class="form_field_error"{/if} size="5" onchange="TierUpdate();"/>
{else}
<input type="text" id="affiliate_template_max_tiers" name="affiliate_template_max_tiers" value="{$VAR.affiliate_template_max_tiers}" {if $affiliate_template_max_tiers == true}class="form_field_error"{/if} size="5" onchange="TierUpdate();"/>
{/if}
</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=commission_minimum}</td>
<td style="width: 65%;"><input type="text" name="affiliate_template_commission_minimum" value="{$VAR.affiliate_template_commission_minimum}" {if $affiliate_template_commission_minimum == true}class="form_field_error"{/if} size="5"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_commission_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('commissiontype','affiliate_template_new_commission_type','affiliate_template_new_commission_type',$VAR.affiliate_template_new_commission_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_commission_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('commissiontype','affiliate_template_recurr_commission_type','affiliate_template_recurr_commission_type',$VAR.affiliate_template_recurr_commission_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_max_commission_periods}</td>
<td style="width: 65%;"><input type="text" name="affiliate_template_recurr_max_commission_periods" value="{$VAR.affiliate_template_recurr_max_commission_periods}" {if $affiliate_template_recurr_max_commission_periods == true}class="form_field_error"{/if} size="5"/></td>
</tr>
{include file='file:../core/add_tr_submit.tpl'}
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div>
{section name=i start=0 loop=100 step=1}
<input type="hidden" id="new_{$smarty.section.i.index}" name="affiliate_template_new_commission_rate[]"/>
<input type="hidden" id="rec_{$smarty.section.i.index}" name="affiliate_template_recurr_commission_rate[]"/>
{/section}
</div>
<div><br/></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 50%;" align="left"><iframe name="iframeNewTier" id="iframeNewTier" style="border:0px; width:0px; height:0px;" scrolling="auto" allowtransparency="true" frameborder="0" src="themes/{$THEME_NAME}/IEFrameWarningBypass.htm"></iframe></td>
<td style="width: 50%;" align="right"><iframe name="iframeRecTier" id="iframeRecTier" style="border:0px; width:0px; height:0px;" scrolling="auto" allowtransparency="true" frameborder="0" src="themes/{$THEME_NAME}/IEFrameWarningBypass.htm"></iframe></td>
</tr>
</table>
<script type="text/javascript">
<!--
var new_array = new Array(99);
var rec_array = new Array(99);
{literal}
// create the hidden fields for the tier rates
for(i=0; i<99; i++) {
new_array[i] = '';
rec_array[i] = '';
}
{/literal}
{foreach key=key item=item from=$VAR.affiliate_template_new_commission_rate}
{if $item}
UpdateTierValueNew({$key},"{$item}");
{/if}
{/foreach}
{foreach key=key item=item from=$VAR.affiliate_template_recurr_commission_rate}
{if $item}
UpdateTierValueRecur({$key},"{$item}");
{/if}
{/foreach}
{literal}
function UpdateTierValueNew(id,value) {
new_array[id] = value;
document.getElementById('new_'+id).value = value;
}
function UpdateTierValueRecur(id,value) {
rec_array[id] = value;
document.getElementById('rec_'+id).value = value;
}
function GetTierValueNew(id) {
return new_array[id];
}
function GetTierValueRecur(id) {
return rec_array[id];
}
function TierUpdate() {
var tiers = document.getElementById('affiliate_template_max_tiers').value;
if(tiers > 99) {
tiers = 99;
document.getElementById('affiliate_template_max_tiers').value = 99;
}
showIFrame('iframeNewTier',400,400,'?_page=affiliate:new_tier_iframe&_escape=1&tiers='+tiers);
showIFrame('iframeRecTier',400,400,'?_page=affiliate:recurr_tier_iframe&_escape=1&tiers='+tiers);
}
{/literal}
TierUpdate();
//-->
</script>
</form>