<?PHP
$_OPTIMIZATION["title"] = $lang['referrals']['title'];
$user_id = (int)$_SESSION["user_id"];
$db->Query("SELECT COUNT(*) FROM db_users_a WHERE referer_id = '$user_id'");
$refs = $db->FetchRow();
?>

<section class="main races">
    <div class="wrapper-constrained">
        <div class="content-wrapper flex">
            <div class="perfpage">
                
                <div class="container elven">
                    <div class="decor big"></div>
                    <h3><span>Your referrals</span></h3>
																	</br>		<center>		<iframe data-aa='2103704' loading='lazy' src='//ad.a-ads.com/2103704?size=728x90' style='width:728px; height:90px; border:0px; padding:0; overflow:hidden; background-color: transparent;'></iframe></center>

                    <div class="container-inner">
                        

                        <div class="clearfix"></div>
                        <h2 class="st-center">Your referrals</h2>
                        <p class="mt20 tal">
                            <img src="/images/character_elf_min.png" style="padding: 0 20px 20px 0; float: left; margin-top:-30px;" width="120" />
Invite your friends and acquaintances to the game, you will receive 20 percents of each recharge invited by you person and 50 % from his bonus. The income from investment is going to your <strong>Crypto Balance for withdrawal</strong>, you can withdraw it <strong>instantly</strong> and commission from bonus go to your Gold/Silver balance. Below is a link to attract and the number of people invited by you.                        </p>
<style>
        .form-row-cell-item img { text-align: center; }
        .form-row-cell-item { margin-bottom: 30px; }
        label { display: block; }
        textarea { height: 60px; }
        h4 { margin-bottom: 30px; }
    </style>
<div class="form-row-cell-item">

<div class="form-row-cell-item">
                                    <img src="/images/banners/468x60-5en.gif" width="468" height="60">
                                    <label>HTML code for your referral image  (Size 468x60 EN, &lt; 300 Kbytes):</label>
                                    <textarea>&lt;a href="<?php echo('https://cashempire.cc/?i='.$user_id);?>" title="CASH EMPIRE - The best innovative game project with money withdrawal"&gt;&lt;img src="https://cashempire.cc/images/banners/468x60-5en.gif"/&gt;&lt;/a&gt;</textarea>
                                </div>

<div class="form-row-cell-item">
                                    <img src="/images/banners/468x60-3en.gif" width="468" height="60">
                                    <label>HTML code for your referral image  (Size 468x60 EN, &lt; 300 Kbytes):</label>
                                    <textarea>&lt;a href="<?php echo('https://cashempire.cc/?i='.$user_id);?>" title="CASH EMPIRE - The best innovative game project with money withdrawal"&gt;&lt;img src="https://cashempire.cc/images/banners/468x60-3en.gif"/&gt;&lt;/a&gt;</textarea>
                                </div>
                                    <img src="/images/banners/728x90-2en.gif" width="728" height="90">
                                    <label>HTML code for your referral image  (Size 728x90 EN, &lt; 300 Kbytes):</label>
                                    <textarea>&lt;a href="<?php echo('https://cashempire.cc/?i='.$user_id);?>" title="CASH EMPIRE - The best innovative game project with money withdrawal"&gt;&lt;img src="https://cashempire.cc/images/banners/728x90-2en.gif"/&gt;&lt;/a&gt;</textarea>
                                </div>
                        <div class="clearfix"></div>
                        <h3 class="st-center"><i class="fa fa-dashboard"></i> Total of Referrals: <?php echo $refs; ?> </h3>

                        
                        
						<div class="bonus-list-area">
                                               <div class="content" id="bonus-content">    
                      <table class="table table-striped">
                    <thead class="text-center">
                       
                        <th><?= $lang['common']['username'] ?></th>
                        <th>Revenue From Referral</th>
                        <th><?= $lang['common']['date'] ?></th>
                    </thead>
                    <?PHP
                    $all_money = 0;
                    $db->Query("SELECT db_users_a.user, db_users_a.date_reg, db_users_b.to_referer FROM db_users_a, db_users_b
                        WHERE db_users_a.id = db_users_b.id AND db_users_a.referer_id = '$user_id' ORDER BY to_referer DESC");
                    if($db->NumRows() > 0){
                        while($ref = $db->FetchArray()){
                            ?>
                            <tr class="text-center">
                                
                                <td><i class="fa fa-user"></i> <?php echo $ref["user"]; ?></td>
                                <td> <?php echo $ref["to_referer"]; ?></td>
                                <td><i class="fa fa-calendar"></i> <?php echo date("h:m:s | d.m.Y",$ref["date_reg"]); ?></td>
                            </tr>
                            <?PHP
                        }
                    }else echo '<tr><td class="text-center" colspan="4">'. $lang['bonus_daily']['no_rec'] .'</td></tr>';
                ?>
                </table>
</div>
 </div>

                    </div>
                    <div class="decor middle"></div>
                    <div class="decor left"></div>
                    <div class="decor right"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="devider bottom"></div>
</section>