{include file="header.tpl"}
    <div class="col-md-10 col-12 fix-mt fix-mtSm">
        <div class="d-block d-sm-none mb-4">
            <div class="row">
                <div class="col-12 align-center">
                    <h5 class="reduceH5 site-yellow">
                        <b>Your Referrals</b>
                    </h5>
                </div>
            </div>
        </div>
            <div class="row login-bg" style="background-image: url('static/plush/images/backgrounds/bg-3.jpg'); height: fit-content;">
        <div class="col-12 index-bg-overlay py-50">
            <h4 class="whiteText">
                <b>Refer Friends and Earn Up To 5% Bonus</b>
            </h4>
            <p class="whiteText">
                Earn up to 5% bonus when your referred friends invest across all Century Investment Global trading Plans.
            </p>
            <p class="whiteText">
                Referral bonus will be instantly credited to your account assets once those you have reffered invest. Share your referral link, referral ID or QrCode to start Earning bonuses.
            </p>
        </div>
    </div><br>
        <!-- ## -->
        <div class="row px-0 px-sm-4">
            <div class="col-md-12 col-12">
                <div class="post-box p-4">
                    <div class="mb-3 align-center">
                        <h5 class="reduceH5 bold-text">
                            Your Referrals
                        </h5>
                    </div> 
                    <div class="form-group">
                    <label class="textColor">Your Referral Link</label>
                    <div class="row">
                        <div class="col-10">
                            <input type="text" class="form-control dark-bg4" id="refLink" value="{$settings.site_url}/?ref={$userinfo.username}" style="border: none;" readonly>
                        </div>
                        <div class="col-2 mt-2">
                            <i class="fi fi-rr-copy textColor" style="font-size: 20px;" onclick="copyRefLink(this)"></i>
                        </div>
                    </div>
                </div>
<div class="table-responsive">
{if $upline.email != ""}
Your upline is <a href=mailto:{$upline.email}>{$upline.name}</a><br><br>
{/if}
<br>
<table class="table table-striped table-bordered" cellspacing=1 cellpadding=1>
<tr>
  <td class=item>Referrals:</td>
  <td class=item>{$total_ref}</td>
</tr><tr>
  <td class=item>Active referrals:</td>
  <td class=item>{$active_ref}</td>
</tr><tr>
  <td class=item>Total referral commission:</td>
  <td class=item>{$currency_sign}{$commissions}</td>
</tr>
</table>
<br>
{if $settings.show_refstat}

<h3>Referral ins/signups</h3><br>
<table cellspacing=0 cellpadding=1 border=0>
<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></table>


<table width=300 celspacing=1 cellpadding=1 border=0>
<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}
</table><br>
{/if}

{if $settings.show_referals}
{if $show_referals}
<h3>Your referrals:</h3>
<table cellspacing=1 cellpadding=1 border=0>
<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>
</table>
{/if}
{/if}
</div>
</div></div></div></div>
{include file="footer.tpl"}
