Exemple #1
0
<div class="last-battles">
    <style scoped>
        .lastMatches{
            margin:0 0 25px 0;
            text-align: center;
        }
        .nicknames{
            font-size: 16px;
        }
    </style>
    <p class="neve">LAST MATCHES</p>
    <table class="ladderTable lastMatches">
        <?php 
while ($list = mysqli_fetch_assoc($this->last_matches)) {
    $columns = array('nickname', 'country');
    $uInfoRes = $model->getUserInfo($list['uid'], $columns);
    $uInfo = mysqli_fetch_object($uInfoRes);
    $pInfoRes = $model->getUserInfo($list['pid'], $columns);
    $pInfo = mysqli_fetch_object($pInfoRes);
    $timeAgo = ceil((time() - $list['startTime']) / 60 / 60) . "h ago";
    $playerInfo = ($pInfo->country ? '<img src="' . _SITEDIR_ . 'public/images/country/' . mb_strtolower($pInfo->country) . '.png">' : '') . $pInfo->nickname;
    $userInfo = ($uInfo->country ? '<img src="' . _SITEDIR_ . 'public/images/country/' . mb_strtolower($uInfo->country) . '.png">' : '') . $uInfo->nickname;
    echo "<tr>";
    echo '<td><p><span class="nicknames">';
    echo $list['pwin'] > $list['uwin'] ? $playerInfo . " won VS " . $userInfo : $userInfo . " won VS " . $playerInfo;
    echo '</span><br />' . $timeAgo . '</p>';
    echo '</td><td><a href="/match' . $list['id'] . '">Link to Match</a></td>';
    echo "</tr>";
}
?>
    </table>