{if $smarty.const.CONF_AFFILIATE_PROGRAM_ENABLED}
{if $safemode}
{$smarty.const.ADMIN_SAFEMODE_WARNING}
{/if} {$smarty.const.STRING_AFFILIATE_CUSTOMERS}: {$RecruitedCustomersNumber}
{* recruited customers table *}
{if $RecruitedCustomersNumber}

{$smarty.const.ADMIN_CUSTOMER_LOGIN} | {$smarty.const.STR_ACTSTATE} | {$smarty.const.ADMIN_REGISTRATION_TIME} |
{assign var="admhl" value=0} {foreach from=$RecruitedCustomers item=_Customer name=i} {if $admhl eq 1}
{else}{assign var="admhl" value=1}{/if}
{$_Customer.Login} | {if $_Customer.ActivationCode}{$smarty.const.STR_NOTACTIVATED} {else}{$smarty.const.STR_ACTIVATED} {/if} | {$_Customer.reg_datetime} | X
{/foreach}

{/if}{* if $RecruitedCustomersNumber *} {* calendar form *} {$smarty.const.AFFP_COMMISSION_PAYMENTS}

{$smarty.const.AFFP_SUBMIT_NEW_COMMISSION} | {$smarty.const.AFFP_SUBMIT_NEW_PAYMENT}
{$smarty.const.STRING_CALENDAR}
{if $Error_DateFormat}
{$smarty.const.AFFP_MSG_ERROR_DATE_FORMAT}
{/if} {$smarty.const.STRING_FROM}: {$smarty.const.STRING_TILL}:
{if !$show_tables}
{$smarty.const.MSG_PERIOD_ISNT_SPECIFIED} {/if}

{* commissions table *} {if $delete_commission}
{$smarty.const.AFFP_MSG_COMMISSION_DELETED}
{/if} {if $show_tables}

{$smarty.const.AFFP_STRING_CUSTOMER_COMMISSIONS} ({$smarty.const.STRING_FROM} {$from} {$smarty.const.STRING_TILL} {$till})

{/if} {if $CommissionsNumber and $show_tables}

ID | {$smarty.const.ADMIN_CURRENT_DATE} | {$smarty.const.STRING_DESCRIPTION} | {$smarty.const.STRING_SUM} |
{assign var="admhl" value=0} {foreach from=$Commissions item=_Commission} {if $admhl eq 1}
{else}{assign var="admhl" value=1}{/if} {assign_array var="TotalCommissionsAmount" index=$_Commission.CurrencyISO3 value=$TotalCommissionsAmount[$_Commission.CurrencyISO3]+$_Commission.Amount}
C-{$_Commission.cID} | {$_Commission.xDateTime} | {$_Commission.Description} | {$_Commission.Amount} {$_Commission.CurrencyISO3} | {$smarty.const.EDIT_BUTTON} | X
{/foreach}
{$smarty.const.STRING_SUM}: | {foreach from=$TotalCommissionsAmount key=_key item=_total}
{$_total|string_format:"%.2f"} | {$_key}
{/foreach}

{elseif $show_tables}
{$smarty.const.AFFP_MSG_NOCOMMISISONS_FOUND}

{/if} {* payments table *}

{if $delete_payment}
{$smarty.const.AFFP_MSG_PAYMENT_DELETED}
{/if} {if $show_tables}

{$smarty.const.AFFP_STRING_PAYMENTS_TO_CUSTOMERS} ({$smarty.const.STRING_FROM} {$from} {$smarty.const.STRING_TILL} {$till})

{/if} {if $PaymentsNumber and $show_tables}

ID | {$smarty.const.ADMIN_CURRENT_DATE} | {$smarty.const.STRING_DESCRIPTION} | {$smarty.const.STRING_SUM} |
{assign var="admhl" value=0} {foreach from=$Payments item=_Payment} {if $admhl eq 1}
{else}{assign var="admhl" value=1}{/if} {assign_array var="TotalPaymentsAmount" index=$_Payment.CurrencyISO3 value=$TotalPaymentsAmount[$_Payment.CurrencyISO3]+$_Payment.Amount}
P-{$_Payment.pID} | {$_Payment.xDate} | {$_Payment.Description} | {$_Payment.Amount} {$_Payment.CurrencyISO3} | {$smarty.const.EDIT_BUTTON} | X
{/foreach}
{$smarty.const.STRING_SUM}: | {foreach from=$TotalPaymentsAmount key=_key item=_total}
{$_total|string_format:"%.2f"} | {$_key}
{/foreach}

{elseif $show_tables}
{$smarty.const.AFFP_MSG_NOPAYMENTS_FOUND}

{/if} {if $PaymentsNumber and $CommissionsNumber and $show_tables}

{$smarty.const.AFFP_USER_BALANCE}: | {foreach from=$CurrencyISO3 item=_currency} {if $TotalCommissionsAmount[$_currency.currency_iso_3] or $TotalPaymentsAmount[$_currency.currency_iso_3]}
{"`$TotalCommissionsAmount[$_currency.currency_iso_3]-$TotalPaymentsAmount[$_currency.currency_iso_3]`"|string_format:"%.2f"} | {$_currency.currency_iso_3}
{/if} {/foreach}

{/if} {else}{$smarty.const.AFFP_MSG_PROGRAM_DISABLED}{/if}