{include file="header.tpl"}

{include file="program_details.tpl"}

<div class="details">
<table class="form">
<tr>
 <th>{t}Payout Ratio:{/t}</th>
 <td>{$totals.ratio*100}% {if $totals.ratio >= 1}<span class="inprofit">{t}in profit{/t}</span>{/if}</td>
</tr>
<tr>
 <th>{t}Profit:{/t}</th>
 <td>${$totals.profit|number_format:2} {if $totals.payouts > 0}in {$totals.payouts} payouts{/if}</td>
</tr>
<tr>
 <th>{t}Investment:{/t}</th>
 <td>${$totals.spent|number_format:2} {if $totals.spends > 0}in {$totals.spends} spends{/if}</td>
</tr>
</table>
<br>
<table class="list">
<tr>
 <th style="text-align:center;">{t}Type{/t}</th>
 <th>{t}Date{/t}</th>
 <th>{t}Amount{/t}</th>
 <th>{t}Comment{/t}</th>
</tr>
{if $stats}
{section name=s loop=$stats}
<tr class="{cycle values="row1,row2"} {if $stats[s].type == 1}profit{else}spend{/if}">
 <td>{if $stats[s].type == 1}{t}Profit{/t}{else}{t}Spend{/t}{/if}</td>
 <td>{$stats[s].fdate}</td>
 <td>${$stats[s].amount}</td>
 <td align=center>{$stats[s].comment}</td>
</tr>
{/section}
{else}
<tr>
 <td colspan=4 align=center>{t}No Payouts{/t}</td>
</tr>
{/if}
</table>

{paginator col=$pages.col cur=$pages.cur url="?a=statistics&lid=`$listing.id`&p=%s"|encurl}

</div>

{include file="footer.tpl"}