<?php

// Chama o método getDonations() para obter os resultados
$result = amwdeveloper()->getDonations();

?>


<div class="rankings blockHome">
    <div class="h2-title h2-title-table flex-s-c">
        <span>Top Donate</span> <sup style="color:lime"> Mês <?= date('m') ?> </sup>
    </div><!--h2-title-->
    <div class="table tabTable-block active" id="players">
        <div class="tableBlock">
            <div class="tableBlock-title">
                <div class="tableBlock-title_player"># Player</div>
                <div class="tableBlock-title_level">Total</div>
            </div>
            <?php $cont = 0;
            foreach ($result as $donation) : $cont++;
                $classColor = "";
                if ($cont <= 1) $classColor = "color-purple";
                elseif ($cont <= 2) $classColor = "color-blue";
                elseif ($cont <= 3) $classColor = "color-green";
                else $classColor = "color-yellow";
            ?>
                <div class="tableBlock-content">
                    <div class="tableBlock-conten_number"><?= $cont ?>°</div>
                    <div class="tableBlock-conten_name">
                       <?=$donation->Account?>
                    </div>
                    <div class="tableBlock-conten_lvl"><span class="<?= $classColor ?>">R$<?= $donation->TotalPrice ?>.00 </span></div>
                    
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>