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/view.tpl

226 lines
9.3 KiB
Smarty
Raw Normal View History

2009-08-03 04:10:16 +00:00
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
2009-08-03 04:10:16 +00:00
{$method->exe($meth.0,$meth.1)}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
{include file='file:../core/view_pre.tpl'}
2009-08-03 04:10:16 +00:00
<!-- Display the field validation -->
{if $form_validation}
{$block->display('core:alert_fields')}
{/if}
2009-08-03 04:10:16 +00:00
<!-- Display each record -->
<form id="view" 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=id}</td>
<td style="width: 65%;"><b>{$record.id} <a href="?_page=account:mail_one&amp;mail_account_id={$record.account_id}"><img src="themes/{$THEME_NAME}/images/icons/mail_16.gif" alt="Email" width="16" height="16" style="border: 0px;"/></a></b></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_orig}</td>
<td style="width: 65%;">{$list->date_time($record.date_orig)}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_last}</td>
<td style="width: 65%;">{$list->date_time($record.date_last)}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=status}</td>
<td style="width: 65%;">{$list->bool('affiliate_status',$record.status,'" onchange="submit()')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=account_id}</td>
<td style="width: 65%;">{osb f=html_select_account name='affiliate_account_id' default=$record.account_id}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=parent_affiliate_id}</td>
<td style="width: 65%;">{osb f=html_select_account name='affiliate_parent_affiliate_id' default=$record.parent_affiliate_id}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_campaign_id}</td>
<td style="width: 65%;">{$list->menu_multi($record.avail_campaign_id,'affiliate_avail_campaign_id','campaign','name','','2','form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_tiers}</td>
<td style="width: 65%;"><input type="text" id="affiliate_max_tiers" name="affiliate_max_tiers" value="{$record.max_tiers}" size="5" onchange="TierUpdate();"/></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_commission_minimum" value="{$record.commission_minimum}" size="5"/></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_recurr_max_commission_periods" value="{$record.recurr_max_commission_periods}" 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_new_commission_type','affiliate_new_commission_type',$record.new_commission_type,'form_menu" onchange="document.getElementById(\'view\').submit()')}</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_recurr_commission_type','affiliate_recurr_commission_type',$record.recurr_commission_type,'form_menu" onchange="document.getElementById(\'view\').submit()')}</td>
</tr>
{foreach from=$record.static_var item=rrecord}
<tr valign="top">
<td style="width: 35%;" valign="top">{$rrecord.name}</td>
<td style="width: 65%;">{$rrecord.html}</td>
</tr>
{/foreach}
<tr valign="top">
<td style="width: 35%;" valign="top">{osb f=tf field=affiliate_plugin}</td>
<td style="width: 65%;">{$list->menu_files('','affiliate_affiliate_plugin',$record.affiliate_plugin,'affiliate_plugin','','.php','" onchange="document.getElementById(\'view\').submit()')}</td>
</tr>
</table>
{assign var="afile" value=$record.affiliate_plugin}
{assign var="ablock" value='affiliate:plugin_'}
{assign var="blockfile" value="$ablock$afile"}
{if $afile != 'ACCOUNT_DISCOUNT'}
{$block->display($blockfile)}
{/if}
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
{include file='file:../core/view_tr_submit_delete.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_new_commission_rate[]"/>
<input type="hidden" id="rec_{$smarty.section.i.index}" name="affiliate_recurr_commission_rate[]"/>
{/section}
</div>
{include file='file:../core/view_post.tpl'}
<div><br/></div>
<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">{t}Affiliate Statistics{/t}</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%;"><a href="?_page=core:search&amp;module=session&amp;session_affiliate_id={$record.id}">{t}Sessions{/t}</a></td>
<td style="width: 35%;"><b>{$record.stats_sessions}</b></td>
</tr>
<tr valign="top">
<td style="width: 35%;"><a href="?_page=core:search&amp;module=account&amp;account_affiliate_id={$record.id}">{t}Accounts{/t}</a></td>
<td style="width: 35%;"><b>{$record.stats_accounts}</b></td>
</tr>
<tr valign="top">
<td style="width: 35%;"><a href="?_page=core:search&amp;module=invoice&amp;invoice_affiliate_id={$record.id}">{t}Invoices{/t}</a></td>
<td style="width: 35%;"><b>{$list->format_currency($record.stats_invoices_amt,'')} ({$record.stats_invoices})</b></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{t}commissions{/t}</td>
<td style="width: 35%;"><b>{$list->format_currency($record.stats_commissions,'')}</b></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{t}commissions_due{/t}</td>
<td style="width: 35%;"><b>{$list->format_currency($record.commissions_due,'')}</b></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<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);
2009-08-03 04:10:16 +00:00
{literal}
// create the hidden fields for the tier rates
for(i=0; i<99; i++) {
new_array[i] = '';
rec_array[i] = '';
}
{/literal}
{$list->unserial($record.new_commission_rate,'new_commission_rate')}
{foreach key=key item=item from=$new_commission_rate}
{if $item}
UpdateTierValueNew({$key},"{$item}");
{/if}
{/foreach}
{$list->unserial($record.recurr_commission_rate,'recurr_commission_rate')}
{foreach key=key item=item from=$recurr_commission_rate}
{if $item}
UpdateTierValueRecur({$key},"{$item}");
{/if}
2009-08-03 04:10:16 +00:00
{/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];
}
2009-08-03 04:10:16 +00:00
function TierUpdate() {
var tiers = document.getElementById('affiliate_max_tiers').value;
2009-08-03 04:10:16 +00:00
if(tiers > 99) {
tiers = 99;
document.getElementById('affiliate_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}
2009-08-03 04:10:16 +00:00
TierUpdate();
//-->
</script>
{/if}