{include file="header.tpl"}

{include file="program_details.tpl"}

<div class="details">
<table class="form">
<tr>
 <th>Payouts Ratio</th>
 <td>{$totals.ratio*100}% {if $totals.ratio >= 1}<span class="inprofit">in profit</span>{/if}</td>
</tr>
<tr>
 <th>Profit</th>
 <td>${$totals.profit|number_format:2} {if $totals.payouts > 0}in {$totals.payouts} payouts{/if}</td>
</tr>
<tr>
 <th>Investment</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;">Type</th>
 <th>Date</th>
 <th>Amount</th>
 <th>Comment</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}Profit{else}Spend{/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>No Payouts</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"}