<?php $__env->startSection('content'); ?>
   <div class="nk-content">
                        <div class="container-fluid">
                            <div class="nk-content-inner">
                                
                                
                                
                                
                                <div class="nk-content-body">
                                    <div class="nk-block-head nk-block-head-sm">
                                        <div class="nk-block-between">
                                            <div class="nk-block-head-content">
                                                <h4 class="nk-block-title page-title">Referral System</h4>
                                                <div class="nk-block-des text-soft"></div>
                                            </div>

                                        </div>
                                    </div>
                                    
                                    
                                    
                                    
                                    
                                    <div class="nk-block">
                                        <div class="card card-bordered card-stretch">
                                            <div class="card-inner-group">
                                                <div class="card-inner position-relative card-tools-toggle">
                                                     <div class="card-head"><h5 class="card-title card-title-md">Earn <strong><?php echo e($basic->currency_sym); ?><?php echo e(number_format($basic->ref, $basic->decimal)); ?></strong> When You Invite your friends and family to <?php echo e($gnl->sitename); ?></h5></div>
                                                     <div class="card-text"><p>Each member have a unique #<?php echo e($basic->sitename); ?>Tag referral link to share with friends and family and receive a 
                                                     <strong>bonus of <?php echo e($basic->currency_sym); ?><?php echo e(number_format($basic->ref, $basic->decimal)); ?></strong> when they make thier first purchase. If any one sign-up with your link, he or she will be added to your referral program. Your referral link may be used to invite more users.</p></div
                                                     <div class="nk-refwg-invite card-inner">
                                                <div class="nk-refwg-head g-3">
                                                    <div class="nk-refwg-title">
                                                        <br>
                                                        <div class="title-sub">Copy Ref link</div>
                                                    </div>
                                                    <div class="nk-refwg-action"><a href="http://www.facebook.com/share.php?u=<?php echo e(route('refer.register',auth::user()->username)); ?>&amp;title=<?php echo e($gnl->title); ?> Referral Link" class="btn btn-primary"><em class="icon ni ni-facebook-f"></em>Share </a></div>

                                                     <div class="nk-refwg-action"><a href="whatsapp://send?text=<?php echo e(route('refer.register',auth::user()->username)); ?>" class="btn btn-success"><em class="icon ni ni-whatsapp"></em> Invite</a></div>
                                                </div>
                                                <div class="nk-refwg-url">
                                                    <div class="form-control-wrap">
                                                        <div class="form-clip clipboard-init" data-clipboard-target="#refUrl" data-success="Copied" data-text="Copy Link">
                                                            <em class="clipboard-icon icon ni ni-copy"></em> <span class="clipboard-text">Copy Link</span>
                                                        </div>
                                                        <div class="form-icon"><em class="icon ni ni-link-alt"></em></div>
                                                        <input type="text" class="form-control copy-text" id="refUrl" value="<?php echo e(route('refer.register',auth::user()->username)); ?>" />
                                                    </div>
                                                </div><br> <h6 class="card-title card-title-md">Your Referred Users</h6>
                                            </div>
                                                </div>


                                               
                                               
                                                <div class="card-inner p-0">

                                                    <div class="nk-tb-list nk-tb-ulist table-responsive">


                                                        <div class="nk-tb-item nk-tb-head">
                                                            <div class="nk-tb-col nk-tb-col-check">
                                                                <div class="custom-control custom-control-sm custom-checkbox notext">
                                                                    <input type="checkbox" class="custom-control-input" id="uid" /><label class="custom-control-label" for="uid"></label>
                                                                </div>
                                                            </div>
                                                            <div class="nk-tb-col"><span class="sub-text">Username</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">User FullName</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Phone</span></div>

                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Last Login</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Status</span></div>
                                                            <div class="nk-tb-col nk-tb-col-tools text-right">
                                                                <div class="dropdown">

                                                                </div>
                                                            </div>
                                                        </div>


                                                            <?php if(count($referral) > 0): ?>
                                                         <?php $__currentLoopData = $referral; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                                        <div class="nk-tb-item">
                                                            <div class="nk-tb-col nk-tb-col-check">
                                                                <div class="custom-control custom-control-sm custom-checkbox notext">
                                                                    <input type="checkbox" class="custom-control-input" id="uid1" /><label class="custom-control-label" for="uid1"></label>
                                                                </div>
                                                            </div>
                                                            <div class="nk-tb-col">
                                                                <a href="#">
                                                                    <div class="user-card">
                                                                        <div class="user-avatar bg-primary"><span>AB</span></div>
                                                                        <div class="user-info">
                                                                            <span class="tb-lead"><?php echo e(isset(App\User::whereId($data->id)->first()->username) ? App\User::whereId($data->id)->first()->username  : 'N/A'); ?> </span></span><span><?php echo e(isset(App\User::whereId($data->id)->first()->email) ? App\User::whereId($data->id)->first()->email  : 'N/A'); ?><span class="dot dot-success d-md-none ml-1"></span></span>

                                                                        </div>
                                                                    </div>
                                                                </a>
                                                            </div>
                                                            <div class="nk-tb-col tb-col-mb">
                                                            
                                                            <span class="tb-lead"><?php echo e(isset(App\User::whereId($data->id)->first()->fname) ? App\User::whereId($data->id)->first()->fname  : 'N/A'); ?> <?php echo e(isset(App\User::whereId($data->id)->first()->lname) ? App\User::whereId($data->id)->first()->lname  : 'N/A'); ?><span class="dot dot-success d-md-none ml-1"></span></span>
                                                                                                                        
                                                                
                                                            </div>
                                                            <div class="nk-tb-col tb-col-mb"><span><?php echo e(isset(App\User::whereId($data->id)->first()->phone) ? App\User::whereId($data->id)->first()->phone  : 'N/A'); ?></span></div>

                                                            <div class="nk-tb-col tb-col-mb"><span><?php echo e(isset(App\User::whereId($data->id)->first()->lastseen) ? App\User::whereId($data->id)->first()->lastseen  : 'N/A'); ?></span></div>
                                                            <div class="nk-tb-col tb-col-mb"><?php if($data->status == 1): ?>
<span class="tb-status text-success">Active</span>
<?php else: ?>
<span class="tb-status text-danger">Inactive</span>
<?php endif; ?></div>
                                                            <div class="nk-tb-col nk-tb-col-tools">

                                                            </div>
                                                        </div>

<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<div class="example-alert">
                                                            <div class="alert alert-warning alert-icon">
                                                                <em class="icon ni ni-alert-circle"></em> <strong>Empty!</strong></div>
                                                        </div>
<?php endif; ?>


                                                    </div>
                                                </div>
                                               
                                               



                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('include.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>