{include file="mheader.tpl"}
<div class="header-title-breadcrumb element-box-shadow">
              <div class="container">
                  <div class="row">
                      <div class="col-md-7 col-sm-6 col-xs-12 text-left">
                        <h3>Referrals</h3>
                      </div>
                      <div class="col-md-5 col-sm-6 col-xs-12 hide-on-tablet">
                          <ol class="breadcrumb text-right">
                            <li><a href="?a=account">Home</a></li> 
                            <li class="active">Referrals</li>
                          </ol>                    
                      </div>
                  </div>
              </div>
            </div>
            <div class="spacer_80"></div>


<br>
<div class="row">
              <div class="col-xs-12 col-sm-6 col-lg-3">
                <div class="panel panel-default ico-listing-box padding_30">
                  <div class="panel-heading ico-listing-title no-padding">
                      <div class="text-center ico-listing-img">
                        <a class="show-code" href="#"><i class="cc BTC no-margin" title="BTC"></i></a>
                      </div>
                      <div class="ico-listing-name">
                          <h3 class="no-margin text-bold">Total Referrals</h3>
                          <span class="ico-listing-second-name">{$total_ref}</span>
                      </div>
                  </div>
                  <div class="panel-body ico-listing-details no-padding">
                      
                      
                      <div class="ico-listing-second-details text-bold">
                        <p class="ico-listing-type text-bold no-margin">3% - 2% - 1%</p>
                        
                      </div>
                  </div>
                </div>
              </div>
              <div class="col-xs-12 col-sm-6 col-lg-3">
                <div class="panel panel-default ico-listing-box padding_30">
                  <div class="panel-heading ico-listing-title no-padding">
                      <div class="text-center ico-listing-img">
                        <a class="show-code" href="#"><i class="cc BTC no-margin" title="BTC"></i></a>
                      </div>
                      <div class="ico-listing-name">
                          <h3 class="no-margin text-bold">Active Referrals</h3>
                          <span class="ico-listing-second-name">{$active_ref}</span>
                      </div>
                  </div>
                  <div class="panel-body ico-listing-details no-padding">
                      
                      
                      <div class="ico-listing-second-details text-bold">
                        <p class="ico-listing-type text-bold no-margin">3% - 2% - 1%</p>
                        
                      </div>
                  </div>
                </div>
              </div>
              <div class="col-xs-12 col-sm-6 col-lg-3">
                <div class="panel panel-default ico-listing-box padding_30">
                  <div class="panel-heading ico-listing-title no-padding">
                      <div class="text-center ico-listing-img">
                        <a class="show-code" href="#"><i class="cc BTC no-margin" title="BTC"></i></a>
                      </div>
                      <div class="ico-listing-name">
                          <h3 class="no-margin text-bold">Referral commission</h3>
                          <span class="ico-listing-second-name">{$currency_sign}{$commissions}</span>
                      </div>
                  </div>
                  <div class="panel-body ico-listing-details no-padding">
                      
                      
                      <div class="ico-listing-second-details text-bold">
                        <p class="ico-listing-type text-bold no-margin">3% - 2% - 1%</p>
                        
                      </div>
                  </div>
                </div>
              </div>
              <div class="col-xs-12 col-sm-6 col-lg-3">
                <div class="panel panel-default ico-listing-box padding_30">
                  <div class="panel-heading ico-listing-title no-padding">
                      <div class="text-center ico-listing-img">
                        <a class="show-code" href="#"><i class="cc BTC no-margin" title="BTC"></i></a>
                      </div>
                      <div class="ico-listing-name">
                          <h3 class="no-margin text-bold">Your Upline</h3>
                          {if $upline.email != ""}<span class="ico-listing-second-name">
Your upline is <a href=mailto:{$upline.email}>{$upline.name}</a>
</span>{/if}
                      </div>
                  </div>
                  <div class="panel-body ico-listing-details no-padding">
                      
                      
                      <div class="ico-listing-second-details text-bold">
                        <p class="ico-listing-type text-bold no-margin">3% - 2% - 1%</p>
                        
                      </div>
                  </div>
                </div>
              </div>
              

{if $settings.show_refstat}
<div class="col-md-12">
<h3>Referral ins/signups</h3><br>
<div class="panel panel-default table-transactions">
<div class="panel-body padding_30">
<table class="table table-striped no-margin">
                      <tbody>
<form method=post name=opts>
<input type=hidden name=a value=referals>
 <td align=right>
From: </td>
<td>
<select name=month_from class=inpts>
{section name=month_from loop=$month}
<option value={$smarty.section.month_from.index+1} {if $smarty.section.month_from.index+1 == $frm.month_from}selected{/if}>{$month[month_from]}
{/section}
</select> &nbsp;
<select name=day_from class=inpts>
{section name=day_from loop=$day}
<option value={$smarty.section.day_from.index+1} {if $smarty.section.day_from.index+1 == $frm.day_from}selected{/if}>{$day[day_from]}
{/section}
</select> &nbsp;
<select name=year_from class=inpts>
{section name=year_from loop=$year}
<option value={$year[year_from]} {if $year[year_from] == $frm.year_from}selected{/if}>{$year[year_from]}
{/section}
</select>
</td>
 <td rowspan=2>
	&nbsp; <input type=submit value="Go" class=sbmt>
 </td>
</tr>
<tr><td align=right>To:</td><td> <select name=month_to class=inpts>
{section name=month_to loop=$month}
<option value={$smarty.section.month_to.index+1} {if $smarty.section.month_to.index+1 == $frm.month_to}selected{/if}>{$month[month_to]}
{/section}
</select> &nbsp;
<select name=day_to class=inpts>
{section name=day_to loop=$day}
<option value={$smarty.section.day_to.index+1} {if $smarty.section.day_to.index+1 == $frm.day_to}selected{/if}>{$day[day_to]}
{/section}
</select> &nbsp;

<select name=year_to class=inpts>
{section name=year_to loop=$year}
<option value={$year[year_to]} {if $year[year_to] == $frm.year_to}selected{/if}>{$year[year_to]}
{/section}
</select>

 </td>
</tr></form>
</tbody>
</table>
</div>


<div class="panel-body padding_30">
<table class="table table-striped no-margin">
                      <tbody>
<tr>
 <td class=inheader>Date</td>
 <td class=inheader>Ins</td>
 <td class=inheader>Signups</td>
</tr>
{if $show_refstat}
{section name=s loop=$refstat}
<tr>
 <td class=item align=center><b>{$refstat[s].date}</b></td>
 <td class=item align=right>{$refstat[s].income}</td>
 <td class=item align=right>{$refstat[s].reg}</td>
</tr>
{/section}
{else}
<tr>
 <td class=item align=center colspan=3>No statistics found for this period.</td>
</tr>
{/if}
</tbody>
</table><br>
</div>
{/if}

{if $settings.show_referals}
{if $show_referals}
<h3>Your referrals:</h3>
<div class="panel-body padding_30">
<table class="table table-striped no-margin">
                      <tbody>
<tr>
 <td class=inheader>Nickname</td>
 <td class=inheader>E-mail</td>
 <td class=inheader>Status</td>
</tr>
{section name=s loop=$referals}
<tr>
 <td class=item><b>{$referals[s].username}</b></td>
 <td class=item><a href=mailto:{$referals[s].email}>{$referals[s].email}</a></td>
 <td class=item>{if $referals[s].q_deposits > 0}Deposited{else}No deposit yet{/if}</td>
</tr>
{if $referals[s].ref_stats}
<tr>
 <td colspan=3>
  User referrals:
  {section name=l loop=$referals[s].ref_stats}
   <nobr>{$referals[s].ref_stats[l].cnt_active} active of {$referals[s].ref_stats[l].cnt} on level {$referals[s].ref_stats[l].level}{if !$smarty.section.l.last};{/if}</nobr>
  {/section}
 </td>
</tr>
{/if}
{if $referals[s].came_from}
<tr><td colspan=3>
<a href="{$referals[s].came_from}" target=_blank>[User came from]</a>
</td></tr>
{/if}
{/section}
<tr>
 <td colspan=3>&nbsp;</td>
</tr>
<tr>
 <td colspan=3><b>2-10 level referrals:</b> {$cnt_other}</td>
</tr>
<tr>
 <td colspan=3><b>2-10 level active referrals:</b> {$cnt_other_active}</td>
</tr>
</tbody>
</table>
</div>
{/if}
{/if}
</div></div>
<a href="#" class="scrollToTop"><i class="fa fa-chevron-up text-white" aria-hidden="true"></i></a>
</div>
{include file="mfooter.tpl"}
