<?php /* Smarty version 2.6.2, created on 2012-10-21 14:50:10
         compiled from statistics.tpl */ ?>
<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'number_format', 'statistics.tpl', 13, false),array('modifier', 'encurl', 'statistics.tpl', 44, false),array('function', 'cycle', 'statistics.tpl', 30, false),array('function', 'paginator', 'statistics.tpl', 44, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "program_details.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div class="details">
<table class="form">
<tr>
 <th>Payouts Ratio</th>
 <td><?php echo $this->_tpl_vars['totals']['ratio']*100; ?>
% <?php if ($this->_tpl_vars['totals']['ratio'] >= 1): ?><span class="inprofit">in profit</span><?php endif; ?></td>
</tr>
<tr>
 <th>Profit</th>
 <td>$<?php echo ((is_array($_tmp=$this->_tpl_vars['totals']['profit'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
 <?php if ($this->_tpl_vars['totals']['payouts'] > 0): ?>in <?php echo $this->_tpl_vars['totals']['payouts']; ?>
 payouts<?php endif; ?></td>
</tr>
<tr>
 <th>Investment</th>
 <td>$<?php echo ((is_array($_tmp=$this->_tpl_vars['totals']['spent'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
 <?php if ($this->_tpl_vars['totals']['spends'] > 0): ?>in <?php echo $this->_tpl_vars['totals']['spends']; ?>
 spends<?php endif; ?></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>
<?php if ($this->_tpl_vars['stats']):  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 echo smarty_function_cycle(array('values' => "row1,row2"), $this);?>
 <?php if ($this->_tpl_vars['stats'][$this->_sections['s']['index']]['type'] == 1): ?>profit<?php else: ?>spend<?php endif; ?>">
 <td><?php if ($this->_tpl_vars['stats'][$this->_sections['s']['index']]['type'] == 1): ?>Profit<?php else: ?>Spend<?php endif; ?></td>
 <td><?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['fdate']; ?>
</td>
 <td>$<?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['amount']; ?>
</td>
 <td align=center><?php echo $this->_tpl_vars['stats'][$this->_sections['s']['index']]['comment']; ?>
</td>
</tr>
<?php endfor; endif;  else: ?>
<tr>
 <td colspan=4 align=center>No Payouts</td>
</tr>
<?php endif; ?>
</table>

<?php echo smarty_function_paginator(array('col' => $this->_tpl_vars['pages']['col'],'cur' => $this->_tpl_vars['pages']['cur'],'url' => ((is_array($_tmp="?a=statistics&lid=".($this->_tpl_vars['listing']['id'])."&p=%s")) ? $this->_run_mod_handler('encurl', true, $_tmp) : smarty_modifier_encurl($_tmp))), $this);?>


</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>