<?php /* Smarty version 2.6.2, created on 2012-10-21 14:46:41
         compiled from refback.tpl */ ?>
<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'number_format', 'refback.tpl', 57, false),array('modifier', 'encurl', 'refback.tpl', 107, false),array('modifier', 'escape', 'refback.tpl', 107, false),array('modifier', 'default', 'refback.tpl', 117, false),array('function', 'cycle', 'refback.tpl', 180, 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);
 ?>

<script type="text/javascript">
userAccounts = Array();
<?php if (isset($this->_sections['p'])) unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['paysystems']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?>
userAccounts['<?php echo $this->_tpl_vars['paysystems'][$this->_sections['p']['index']]['name']; ?>
'] = '<?php echo $this->_tpl_vars['paysystems'][$this->_sections['p']['index']]['account']; ?>
';
<?php endfor; endif; ?>

<?php echo '
function setDefAccount() {
  obj = document.refback.paysystem;
  objd = document.refback.psaccount;
  if (!obj) return;
  i = obj.selectedIndex; o = obj.options;
  n = o[i].value;
  if (userAccounts[n]) objd.value = userAccounts[n];
}
function checkRefBack()
{
  if (document.refback.email) {
    status = checkEmail(document.refback.email.value);

    if (status > 0) {
      if (status == 1)
  	    alert(\'Please, enter your E-Mail address!\');
      if (status == 2)
  	    alert(\'Please, enter a valid E-Mail address!\');

      document.refback.email.focus();
      return false;
    }
  }

  if (!document.refback.username.value) {
    alert(\'Please enter you Program Username\');
    document.refback.username.focus();
    return false;
  }

  if (!document.refback.amount.value) {
    alert(\'Please enter you Invested Amount\');
    document.refback.amount.focus();
    return false;
  }

  if (!document.refback.account.value) {
    alert(\'Please enter you Payment System ID\');
    document.refback.account.focus();
    return false;
  }

  return true;
}

'; ?>

var rcb = <?php echo $this->_tpl_vars['jsrcb']; ?>
;
var add_rcb_percent = <?php echo ((is_array($_tmp=$this->_tpl_vars['add_rcb_percent'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
;
<?php echo '

function calcRCB() {
  inv = parseFloat(document.getElementById(\'inv_amount\').value);
  fst_amount = re_amount = 0.00;
  rrcb = {ref:0,fst_rcb:0,re_rcb:0,fst_bonus:0,re_bonus:0};
  if (!isNaN(inv)) {
    for (i in rcb) {
      r = rcb[i];
      if (r.min <= inv && (r.max == 0 || r.max >= inv)) {
        rrcb = r; break;
      }
    }
    if (rrcb) {
      fst_amount = inv * (rrcb.ref/100) * ((rrcb.fst_rcb+add_rcb_percent)/100) + rrcb.fst_bonus;
      re_amount = inv * (rrcb.ref/100) * ((rrcb.re_rcb+add_rcb_percent)/100) + rrcb.re_bonus;
    }
  }
  document.getElementById(\'fst_amount_quote\').innerHTML = fst_amount.toFixed(2);
  document.getElementById(\'re_amount_quote\').innerHTML = re_amount.toFixed(2);
}
'; ?>

</script>

<?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);
 ?>

<?php if ($this->_tpl_vars['rcb']): ?>
<h3>RCB Rates</h3>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "rcb_table.tpl", 'smarty_include_vars' => array('rcbs' => $this->_tpl_vars['rcb'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  endif; ?>

<h3>Referral Commission Back</h3>

<?php if ($this->_tpl_vars['frm']['display'] == 'sent'): ?>
<div class="ok">Thank you. Your request has been sent to administrator. You will receive commission back after admininstrator approve the request.</div>
<?php else: ?>

<?php if ($this->_tpl_vars['errors']): ?>
<ul class="error">
<?php if ($this->_tpl_vars['errors']['turing']): ?><li> Invalid turing image.</li><?php endif;  if ($this->_tpl_vars['errors']['email']): ?><li> Please enter your e-mail addresss.</li><?php endif;  if ($this->_tpl_vars['errors']['invalid_email']): ?><li> Please enter valid e-mail address.</li><?php endif;  if ($this->_tpl_vars['errors']['username']): ?><li> Please enter your program username.</li><?php endif;  if ($this->_tpl_vars['errors']['account']): ?><li> Please enter your payment system account.</li><?php endif;  if ($this->_tpl_vars['errors']['request_exists']): ?>Request for this program and username already exists. Please be patient and wait till admin process your previus request.<?php endif; ?>
</ul>
<?php endif; ?>

<?php if (! $this->_tpl_vars['userinfo']['logged']): ?>
<div class="message">You can <a href="<?php echo ((is_array($_tmp="?a=signup")) ? $this->_run_mod_handler('encurl', true, $_tmp) : smarty_modifier_encurl($_tmp)); ?>
">signup</a> and <a href="<?php echo ((is_array($_tmp="?a=login")) ? $this->_run_mod_handler('encurl', true, $_tmp) : smarty_modifier_encurl($_tmp)); ?>
">login</a> into our site to <?php if ($this->_tpl_vars['settings']['registered_rcb_percent'] > 0): ?> receive additional <?php echo ((is_array($_tmp=$this->_tpl_vars['settings']['registered_rcb_percent'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
% RCB and<?php endif; ?> track your refbacks.</div>
<?php endif; ?>
<form method="post" onsubmit="return checkRefBack()" name="refback" action="">
<input type=hidden name=a value=refback>
<input type=hidden name=action value=send>
<input type=hidden name=lid value=<?php echo $this->_tpl_vars['listing']['id']; ?>
>
<table class="form">
<?php if (! $this->_tpl_vars['userinfo']['logged']): ?>
<tr>
 <th>Your E-mail</th>
 <td><input type="text" name="email" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$this->_tpl_vars['frm']['email'])) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['userinfo']['email']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['userinfo']['email'])))) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
"></td>
</tr>
<?php endif; ?>
<tr>
 <th>Program Username</th>
 <td><input type="text" name="username" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$this->_tpl_vars['frm']['username'])) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['userinfo']['username']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['userinfo']['username'])))) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
"></td>
</tr>
<tr>
 <th>Invested Amount</th>
 <td><input type="text" name="amount" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['amount'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
" id="inv_amount" onkeyup="calcRCB()" onmouseover="calcRCB()" onblur="calcRCB()"></td>
</tr>
<tr>
 <th>RCB Quote</th>
 <td>
  1st deposit: $<span id="fst_amount_quote">0.00</span><br>
  Re-Deposit: $<span id="re_amount_quote">0.00</span>
 </td>
</tr>
<tr>
 <th>Deposit Payment System</th>
 <td>
   <select name="paysystem" onchange="setDefAccount()">
<?php if (isset($this->_sections['p'])) unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['paysystems']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?>
   <option value="<?php echo $this->_tpl_vars['paysystems'][$this->_sections['p']['index']]['name']; ?>
" <?php if ($this->_tpl_vars['paysystems'][$this->_sections['p']['index']]['selected']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['paysystems'][$this->_sections['p']['index']]['name']; ?>
</option>
<?php endfor; endif; ?>
   </select>
 </td>
</tr>
<tr>
 <th>Your Payment System ID</th>
 <td><input type="text" name="psaccount" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['psaccount'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
"></td>
</tr>
<tr>
 <th>Your Comments</th>
 <td><textarea name="comments" cols=27 rows=4><?php echo ((is_array($_tmp=$this->_tpl_vars['frm']['comments'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
</textarea></td>
</tr>
<?php if ($this->_tpl_vars['settings']['use_turing']): ?>
<tr>
  <th><img src="<?php echo ((is_array($_tmp="?a=turing&".($this->_tpl_vars['sesname'])."=".($this->_tpl_vars['sesid'])."&r=".($this->_tpl_vars['rand']))) ? $this->_run_mod_handler('encurl', true, $_tmp) : smarty_modifier_encurl($_tmp)); ?>
" alt="turing code"></th>
  <td><input type=text name="turing" maxlength=6 size=6></td>
</tr>
<?php endif; ?>
<tr>
 <th></th>
 <td><input type="submit" value="Submit" class=sbmt></td>
</tr>
</form>
</table>

<?php endif; ?>

<?php if ($this->_tpl_vars['rcbs']): ?>
<div class="details">
<h3>RCB Requests for <?php echo ((is_array($_tmp=$this->_tpl_vars['listing']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?>
</h3>
<table class="list">
<tr>
 <th>Date</th>
 <th>User</th>
 <th>Deposit/RCB</th>
 <th>Account</th>
 <th>Status</th>
</tr>
<?php if (count($_from = (array)$this->_tpl_vars['rcbs'])):
    foreach ($_from as $this->_tpl_vars['r']):
?>
<tr class="<?php echo smarty_function_cycle(array('values' => "row1,row2"), $this);?>
">
 <td><?php echo $this->_tpl_vars['r']['date']; ?>
</td>
 <td><?php echo $this->_tpl_vars['r']['username']; ?>
</td>
 <td>$<?php echo ((is_array($_tmp=$this->_tpl_vars['r']['inv_amount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2));  if ($this->_tpl_vars['r']['rcb_amount']): ?>/$<?php echo ((is_array($_tmp=$this->_tpl_vars['r']['rcb_amount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2));  endif; ?></td>
 <td><img src="<?php echo ((is_array($_tmp=($this->_tpl_vars['theme'])."images/".($this->_tpl_vars['r']['paysystem']).".gif")) ? $this->_run_mod_handler('encurl', true, $_tmp) : smarty_modifier_encurl($_tmp)); ?>
" alt="<?php echo $this->_tpl_vars['r']['paysystem']; ?>
"> <?php echo $this->_tpl_vars['r']['psaccount']; ?>
</td>
 <td><?php if ($this->_tpl_vars['r']['status'] == 1): ?><b class="profit">Paid</b><?php else: ?><b class="spend">Pending</b><?php endif; ?></td>
</tr>
<?php endforeach; unset($_from); endif; ?>
</table>
</div>
<?php endif; ?>

<script>
setDefAccount();
</script>

<?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);
 ?>