{include file="header.tpl"}

<div class="box">
<div class="box_title" id="tba">RCB Requests</div>
<div class="box_body">

<script type="text/javascript">
{literal}
function go(p) {
  document.nav.p.value = p;
  document.nav.submit();
}
{/literal}
</script>
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
 <td width="25%">Active Requests:</td>
 <td>{$totals.active|intval}</td>
</tr>
<tr>
 <td>Processed Requests:</td>
 <td>{$totals.processed|intval}</td>
</tr>
<tr>
 <td>RCB Received:</td>
 <td>${$totals.received|number_format:2}</td>
</tr>
<tr>
 <td>RCB Pending:</td>
 <td>${$totals.pending|number_format:2}</td>
</tr>
</table>

<br>
<form name="nav" action="">
<input type="hidden" name="p">
<input type="hidden" name="a" value="refback_requests">
<table cellspacing="1" cellpadding="2" border="0">
<tr>
 <td>
<select name="status" class="inpts" onchange="document.nav.submit()">
<option value="0"{if $frm.status == 0} selected{/if}>New</option>
<option value="1"{if $frm.status == 1} selected{/if}>Processed</option>
<option value="2"{if $frm.status == 2} selected{/if}>Declined</option>
</select></td>
 <td><input type="submit" value="Go" class="sbmt"></td>
</tr>
</table>
</form>
<br>
{if $frm.display == 'deleted'}
<div style="color:green">Request has been successfully deleted</div>
{/if}

{if $refbacks}
{section name=s loop=$refbacks}
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
 <td>Request &nbsp;
{if $frm.status == 0}
  <a href="{"?a=refback_requests&action=delete&id=`$refbacks[s].id`"|encurl}" style="color:red" onclick="return confirm('Do you really want to remove this request?')">[Delete]</a>
{/if}
</td>
 <td>Refback</td>
</tr>
<tr>
 <td valign="top" width="50%" bgcolor="#FFFFE2">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
  <tr><td width="40%">Program:</td><td><a href="{"?a=details&lid=`$refbacks[s].lid`"|encurl}" target="_blank"><b>{$refbacks[s].program_name}</b></a></td></tr>
  <tr><td>Date:</td><td>{$refbacks[s].date_added} {$refbacks[s].time_added}</td></tr>
  <tr><td>Username:</td><td>{$refbacks[s].username}</td></tr>
  <tr><td>Investment:</td><td>${$refbacks[s].deposit}</td></tr>
</table>
 </td>
 <td valign=top bgcolor="#FFFFD2">
<table width="100%" cellspacing="1" cellpadding="2" border="0">                                                  <tr><td width="40%">Date:</td><td>{$refbacks[s].date_processed|default:"n/a"} {$refbacks[s].time_processed}</td></tr>
  <tr><td>Amount:</td><td>{if $refbacks[s].rcb}${$refbacks[s].rcb|number_format:2}{else}n/a{/if}</td></tr>
  <tr><td>System:</td><td>{$refbacks[s].ec}</td></tr>
  <tr><td>Account:</td><td>{$refbacks[s].ecno}</td></tr>
</table>
 </td>
</tr>
<tr>
 <td colspan=3>
  {if $refbacks[s].comments}
  <div class="comments">
   <b>Comments</b>: {$refbacks[s].comments|nl2br|escape:htmlall}
  </div>
  {/if}
  {if $refbacks[s].reply}
  <div class="reply">
    <b>Reply</b>: {$refbacks[s].reply|nl2br|escape:htmlall}
  </div>
  {/if}
 </td>
</tr>
</table>
{/section}
{else}
 <div class="message">No Refback Requests</div>
{/if}
</div></div>

{paginator col=$pages.col cur=$pages.cur url="javascript:go('%s')"}

{include file="footer.tpl"}