{include file="header.tpl"}
<section class="content">
	<div class="container">
		<section class="content">
			<div class="container">
				<link rel="stylesheet" href="web/assets/css/referral.css">
				<div class="row clearfix">
					<div class="col-lg-12">
						<div class="card" style="margin-top: 30px">
							<div class="body block-header">
								<div class="row">
									<div class="col-lg-6 col-md-8 col-sm-12">
										<h2>Welcome, {$userinfo.username}</h2>
										<ul class="breadcrumb p-l-0 p-b-0 ">
											<li class="breadcrumb-item"><a href="/?a=account"><i class="fas fa-home"></i></a></li>
											<li class="breadcrumb-item"><a href="/?a=account">Dashboard</a></li>
											<li class="breadcrumb-item active">My Referrals</li>
										</ul>
									</div>
									<div class="col-lg-6 col-md-4 col-sm-12 text-right">
										<a href="/?a=deposit">
											<button class="btn btn-primary btn-round btn-simple float-right hidden-xs m-l-10 btn-warning waves-effect">Make an investment</button>
										</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row clearfix">
					<div class="col-xl-4 col-lg-5 col-md-12">
						<div class="card overflowhidden weather2">
							<div class="body city-selected l-khaki">
								<div class="row">
									<div class="col-12">
										<div class="city">Your referral url</div>
										<div class="night" style="font-size: 13px">{$settings.site_url}/?ref={$userinfo.username}</div>
									</div>
								</div>
							</div>
							<table class="table table-striped m-b-0">
								<tbody>
									<tr>
										<td>Your status</td>
										<td class="font-medium">Client</td>
									</tr>
									<tr>
										<td>Your upline</td>
										{if $upline.email != ""}
                                        <a href=mailto:{$upline.email}>{$upline.name}</a>
                                        {/if}
										<td class="font-medium"></td>
									</tr>
									<tr>
										<td>Referrals</td>
										<td class="font-medium">{$total_ref}</td>
									</tr>
									<tr>
										<td>Active referrals</td>
										<td class="font-medium">{$active_ref}</td>
									</tr>
									<tr>
										<td>Total commission</td>
										<td class="font-medium">{$currency_sign}{$commissions}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<center>
							<a href="/?a=edit_account">
								<button class="btn btn-primary btn-simple btn-round btn-warning waves-effect">Change RCB </button>
							</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="/?a=support">
								<button class="btn btn-primary btn-simple btn-round btn-warning waves-effect">Apply representative</button>
							</a>
						</center>
						<br>
						<br> </div>
					<div class="col-xl-8 col-lg-7 col-md-12">
						<div class="card user-account">
							<div class="header">
								<h2>Your <strong>Referrals</strong></h2> </div>
							<div class="body">
								<div class="table-responsive">
									<div class="alert alert-warning"> You have earned $0.00 from referrals so far! </div>
									<br>Each participant of the program invites investors using their referral link.
									<br>
									<br><b>Your personal referral link: {$settings.site_url}/?ref={$userinfo.username}</b>
									<br>
									<br>When opening an investment deposit by invited participant you get 8% of additional income from each deposit of invited participant of the 1st level and 3% of the 2nd and 2% of the 3rd level. (Representatives 10% of additional income from each deposit of invited participant of the 1st level and 3% of the 2nd and 2% of the 3rd level.)
									<br>
									<br>There is no need to have an active investment to participate. Referral commission will be added to your balance immediately after your referral makes a deposit. </div>
							</div>
						</div>
					</div>
				</div>
				{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}
				<br>
				<div class="row clearfix"></div>
				<div class="row clearfix">
					<div class="col-md-12 col-lg-12">
						<div class="card active-bg">
							<div class="body">
								<p class="copyright m-b-0 text-dark">Copyright 2024 {$settings.site_name}.</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>

{include file="footer.tpl"}
