<div class="" style="width:100%; padding-top:0px; background:#fff; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; box-sizing: border-box;">
	<div style="font-family:Montserrat,'Open Sans',Raleway,Verdana,Helvetica,sans-serif; 
		font-weight:300; border-bottom:1px solid #eee; padding:10px 15px 7px; margin-top:10px; margin-bottom:5px">
		<div style="float:left; width:33%;  line-height:28px; text-align:center;">
			<span style="font-weight:700; font-size:34px; color:#00d500"><?= count($referrals) ?></span><br />
			<span style="font-size:11px;">DIRECT REFERRALS</span>
		</div>
		<div style="float:left; width:33%; line-height:28px; text-align:center;">
			<span style="font-weight:700; font-size:34px; color:#00d500">$<?= $paidreferrals > 0 ? $paidreferrals : 0 ?></span> / MO.<br />
			<span style="font-size:11px;">MEMBERSHIP EARNINGS</span>
		</div>
		<div style="float:left; width:33%;  line-height:28px; text-align:center;">
			<span style="font-weight:700; font-size:34px; color:#00d500">$0</span><br />
			<span style="font-size:11px;">LESSON EARNINGS</span>
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<?php
	foreach ($referrals as $referral) {
		if ($referral['is_mem'] == 1) {
			$is_member = "<img src='/static/system/icons/green_checkmark_mini.png' style='height:20px;'>";	
		} else {
			$is_member = "None yet";
		}
		
		if ($referral['mem_type'] == 1) {
			$mem_type = "VIP Recurring as of";
		} elseif($referral['mem_type'] == 2) {
			$mem_type = "Creator Recurring as of";
		} elseif($referral['mem_type'] == 3) {
			$mem_type = "Super VIP Recurring as of";
		} elseif($referral['mem_type'] == 4) {
			$mem_type = "VIP M-t-m as of";
		} elseif($referral['mem_type'] == 5) {
			$mem_type = "Creator M-t-m as of";
		} elseif($referral['mem_type'] == 6) {
			$mem_type = "Super VIP M-t-m as of";
		} else {
			$mem_type = "";
		}	
		
		if (!empty($referral['membership_expire_date'])) {
			$mem_date = date('h:ma \o\n m/d/y',strtotime($referral['membership_expire_date']));	
		} else {
			$mem_date = "";
		}
			
		echo "<div style='height:auto; width:auto; padding:10px 15px; border-bottom:1px solid #eee;
		font-family:Montserrat,Raleway,Verdana,Helvetica,sans-serif;'>
				<div style='float:left; display:inline-block; width:102px; height:102px; object-fit:cover;
				overflow:hidden; background:none; margin:0 10px 0 0; border-radius:50%;
				-moz-border-radius: 50%; -webkit-border-radius: 50%;'>
				<a href='/profile/{$referral['user_slug']}'><img 
				src='/static/images/users/agency/{$referral['image']}'
						onerror=\"this.src='/static/system/default_avatar.png'\"
						style='height:100px; width:auto; object-fit:cover;
						max-width:100px; min-width:100px; border-radius:50%;
						-moz-border-radius: 50%; -webkit-border-radius: 50%; 
						border:1px solid #ddd; clear:both'  /></a>
					</div>
					<div style='float:left height:40px; max-height:40px; width:auto; line-height:40px; 
					background:#f5f5f5; margin-left:50px; overflow:hidden; padding-left:10px'>
						<b>{$referral['name']}</b>
						/ {$referral['user_slug']} / {$referral['id']}
					</div>
					<div style='float:left height:50px; width:auto; line-height:25px; 
					margin-left:50px; font-weight:400'>
						<span style='color:#aaa; font-weight:400'>SUBSCRIPTION STATUS</span><br />
						<span style='font-weight:500;'>{$is_member}</span> {$mem_type} {$mem_date}
					</div>
					<div class='clear'></div></div>";
	}
	?>
	<br />
	<div style="display:none; color:#aaa; font-weight:400; padding:15px; 
	font-family:Montserrat,Raleway,Verdana,Helvetica,sans-serif;">
		* Commissions Monthly Membership Subscriptions<br /> 
	</div>
</div>