
<center>




<center>

<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-body text-center">
                <?php
                if (isset($_SESSION['message'])) {
                    echo $_SESSION['message'];
                }
                ?>
             <div class="alert text-center alert-fade text-center xalert-simple xalert-primary xalert-dismissible text-left font__family-montserrat font__size-16 font__weight-light brk-library-rendered rendered show"> <p class="has-text-align-center has-black-color has-electric-grass-gradient-background has-text-color has-background has-small-font-size"><strong>🆕 GET EXTRA 15,000+ TOKENS ON SHORTLINKS! <a href="https://coinlycash.com/achievements" target="_blank" rel="noreferrer noopener">CLICK</a> TO SEE HOW!</strong></p></div>
    
           
            
                <div class="ads">
                    <?= $settings['links_top_ad'] ?>
                </div>
                <?php
                if (isset($_SESSION['message'])) {
                    echo $_SESSION['message'];
                }
                ?>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-6 col-xl-4 mb-1 mb-xl-4">
        <div class="card mini-stats-wid">
            <div class="card-body">
                <div class="media">
                    <div class="media-body">
                        <p class="lh-1 mb-1 font-weight-bold"><?= $countAvailableLinks ?></p>
                        <p class="mb-0">links available</p>
                    </div>

                    <div class="align-self-center">
                <img src="/img/link-s.png" draggable="false" width="50px">
              </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-6 col-xl-4 mb-2 mb-xl-4">
        <div class="card mini-stats-wid">
            <div class="card-body">
                <div class="media">
                    <div class="media-body">
                        <p class="lh-1 mb-1 font-weight-bold"><?= currency($totalReward, $settings['currency_rate']) ?></p>
                        <p class="mb-0"><?= currencyUnit($totalReward, $settings['currency_rate']) ?></p>
                    </div>

                      <div class="align-self-center">
                <img src="/img/token-s.png" draggable="false" width="50px">
              </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-6 col-xl-4 mb-3 mb-xl-4">
        <div class="card mini-stats-wid">
            <div class="card-body">
                <div class="media">
                    <div class="media-body">
                        <p class="lh-1 mb-1 font-weight-bold"><?= $totalEnergy ?></p>
                        <p class="mb-0">energy</p>
                    </div>

                     <div class="align-self-center">
                <img src="/img/energy1.png" draggable="false" width="50px">
              </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <?php
    foreach ($availableLinks as $link) { ?>
	
	<div class="col-lg-3">
            <div class="card card-body text-center">
                <h4 class="card-title mt-0"><?= $link['name'] ?></h4>
                <hr>
                <div class="row text-center">
                            
                            <div class="col-6">
                                <span><h5 style="color: #00ff89; font-weight: bold; margin-bottom: 0rem;"><img src="/img/coin2.png" draggable="false" width="15px"> <?= currency($link['reward'], $settings['currency_rate']) ?></h5></span>
                                
                            </div>
<div class="col-2">
                                <span><h5 style="color: #32394e; font-weight: bold; margin-bottom: 0rem;">|</h5></span>
                                
                            </div>
                            <div class="col-4">
                                <span><h5 style="color: #00ff89; font-weight: bold; margin-bottom: 0rem;"><i class="bx bxs-bolt label-icon"></i> <?= $link['energy'] ?> </h5></span>
                                
                            </div>

                        </div>
                        <hr>
						 <?php if ($link['rmnViews'] > 0) { ?>
                    <a href="<?= base_url() . 'links/go/' . $link['id'] ?>" target="_blank" class="btn btn-primary waves-effect waves-light">Claim <span class="badge badge-info"><?= $link['rmnViews'] ?>/<?= $link['view_per_day'] ?></span></a> 
                <?php } else { ?>
                    <button class="btn btn-primary waves-effect waves-light" disabled>Claim <span class="badge badge-info"><?= $link['rmnViews'] ?>/<?= $link['view_per_day'] ?></span></button>   
                <?php } ?>
				                            </div>
        </div>
    <?php } ?>
</div>
<?php if (!count($availableLinks)) {
    echo '<div class="alert alert-warning text-center">There is no link left <i class="far fa-sad-cry fa-2x"></i> <i class="far fa-sad-cry fa-2x"></i> <i class="far fa-sad-cry fa-2x"></i></div>';
}
?>
<div class="ads">
    <?= $settings['links_footer_ad'] ?>
</div>

