<?php /* Smarty version 2.6.2, created on 2012-05-23 23:11:19
         compiled from details_paystat.tpl */ ?>
<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'number_format', 'details_paystat.tpl', 10, false),)), $this); ?>
<table cellspacing=1 cellpadding=2 border=0 width=100%>
<tr>
 <td colspan=2><b>Payout Statistics for <?php echo $this->_tpl_vars['listing']['name']; ?>
</b></td>
</tr>
<tr>
 <td width="15%">Payouts Ratio:</td><td><b><?php echo $this->_tpl_vars['totals']['ratio']*100; ?>
% <?php if ($this->_tpl_vars['totals']['ratio'] >= 1): ?><font color=red>in profit</font><?php endif; ?></b></td>
</tr>
<tr>
 <td>Profit:</td>
 <td><b style="color:green">$<?php echo ((is_array($_tmp=$this->_tpl_vars['totals']['profit'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</b> <?php if ($this->_tpl_vars['totals']['payouts'] > 0): ?>in <?php echo $this->_tpl_vars['totals']['payouts']; ?>
 payouts<?php endif; ?></td>
</tr>
<tr>
 <td>Investment:</td>
 <td><b style="color:red">$<?php echo ((is_array($_tmp=$this->_tpl_vars['totals']['spent'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</b> <?php if ($this->_tpl_vars['totals']['spends'] > 0): ?>in <?php echo $this->_tpl_vars['totals']['spends']; ?>
 spends<?php endif; ?></td>
</tr>
</table>

<table cellspacing=1 cellpadding=2 border=0 width="100%">
<tr>
 <th class="title_box" align="center">Date</th>
 <th class="title_box" align="center">Amount</th>
 <th class="title_box" align="center">Comment</th>
</tr>
<?php if ($this->_tpl_vars['stats']): ?>
<?php if (isset($this->_sections['s'])) unset($this->_sections['s']);
$this->_sections['s']['name'] = 's';
$this->_sections['s']['loop'] = is_array($_loop=$this->_tpl_vars['stats']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['s']['show'] = true;
$this->_sections['s']['max'] = $this->_sections['s']['loop'];
$this->_sections['s']['step'] = 1;
$this->_sections['s']['start'] = $this->_sections['s']['step'] > 0 ? 0 : $this->_sections['s']['loop']-1;
if ($this->_sections['s']['show']) {
    $this->_sections['s']['total'] = $this->_sections['s']['loop'];
    if ($this->_sections['s']['total'] == 0)
        $this->_sections['s']['show'] = false;
} else
    $this->_sections['s']['total'] = 0;
if ($this->_sections['s']['show']):

            for ($this->_sections['s']['index'] = $this->_sections['s']['start'], $this->_sections['s']['iteration'] = 1;
                 $this->_sections['s']['iteration'] <= $this->_sections['s']['total'];
                 $this->_sections['s']['index'] += $this->_sections['s']['step'], $this->_sections['s']['iteration']++):
$this->_sections['s']['rownum'] = $this->_sections['s']['iteration'];
$this->_sections['s']['index_prev'] = $this->_sections['s']['index'] - $this->_sections['s']['step'];
$this->_sections['s']['index_next'] = $this->_sections['s']['index'] + $this->_sections['s']['step'];
$this->_sections['s']['first']      = ($this->_sections['s']['iteration'] == 1);
$this->_sections['s']['last']       = ($this->_sections['s']['iteration'] == $this->_sections['s']['total']);
?>
<tr class=<?php if ($this->_sections['s']['rownum'] % 2 != 0): ?>detailsbg1<?php else: ?>detailsbg2<?php endif; ?>>
 <td align="center"><?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['fdate']; ?>
</td>
 <td align="center"><?php if ($this->_tpl_vars['stats'][$this->_sections['s']['index']]['type']): ?><font color="green"><?php else: ?><font color="red"><?php endif; ?>$<?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['amount']; ?>
</font></td>
 <td align="center"><?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['comment']; ?>
</td>
</tr>
<?php endfor; endif; ?>
<?php else: ?>
<tr>
 <td colspan=4 align=center>No Payouts.</td>
</tr>
<?php endif; ?>
</table>