<?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-text-color has-small-font-size"><strong>GET EXTRA +750 FREE TOKENS ON PAID TO CLICK <a href="https://btcbunch.com/achievements">CLICK</a> TO SEE HOW!</strong></p>  </div>


<div class="ads">
    <?= $settings['ptc_top_ad'] ?>
</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"><?= $totalAds ?></p>
                        <p class="mb-0">Ads Available</p>
                    </div>

                    <div class="align-self-center">
                <img src="/img/claims.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-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"><a href="/advertise">Create Campaign</a></p>
                        <p class="mb-0">Planning To advertise?</p>
                    </div>

                    <div class="align-self-center">
                <img src="/img/play.png" draggable="false" width="50px">
              </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layout-px-spacing">
    <?php
    if (isset($_SESSION['message'])) {
        echo $_SESSION['message'];
    }
    ?>
    <div class="row">
        <?php
        foreach ($ptcAds as $ads) { ?>
		
		<div class="col-sm-6" style="margin-bottom: 5px;">
                <div class="card">
                    <div class="card-body">
                          <h5 class="card-title"><?= $ads['name'] ?></h5>
                        <p class="card-text"><?= $ads['description'] ?></p>
                        <hr>
                        <div class="row text-center">
                            
                            <div class="col-5">
                                <span><h5 style="color: #00ff89; font-weight: bold; margin-bottom: 0rem;"><img src="/img/coin2.png" draggable="false" width="15px"> <?= currency($ads['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-5">
                                <span><h5 style="color: #00ff89; font-weight: bold; margin-bottom: 0rem;"><i class="bx bx-time label-icon"></i> <?= $ads['timer'] ?> sec</h5></span>
                                
                            </div>

                        </div>
                        <hr>
                          <button onclick="window.location = '<?= site_url('ptc/view/' . $ads['id']) ?>'" class="btn btn-primary btn-block">Go</button>  
                    </div>
                </div>
            </div>
			

        <?php } ?>
    </div>
    <?php if (!count($ptcAds)) {
        echo '<div class="alert alert-warning text-center">There is PTC Ad 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>
<div class="ads">
    <?= $settings['ptc_footer_ad'] ?>
</div>



<center>

<span id="ct_cT0rx7DMM15"></span>



  <center>



