<div>
    <table class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th style="text-align: center">Xếp hạng</th>
            <th style="text-align: center">Đánh giá</th>
            <th style="text-align: center">Ảnh</th>
            <th style="text-align: center"><i class="fa fa-music color-red"></i> Tên bài hát</th>
            <th style="text-align: center"><i class="fa fa-line-chart color-red"></i> Lịch sử</th>
            <th style="text-align: center"><i class="fa fa-microphone color-red"></i> Ca sĩ</th>
            <th style="text-align: center"><i class="fa fa-headphones color-red"></i> Zing</th>
            <th style="text-align: center"><i class="fa fa-headphones color-red"></i> NCT</th>
            <th style="text-align: center"><i class="fa fa-headphones color-red"></i> Keeng</th>
            <th style="text-align: center"><i class="fa fa-headphones color-red"></i> Tổng lượt nghe</th>
            <th style="text-align: center"><i class="fa fa-edit color-red"></i> Tổng điểm</th>
        </tr>
        </thead>
        <tbody>
        <?php if(count($listData) > 0): foreach($listData as $key => $data): ?>
            <tr>
                <td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
                <td style="text-align: center">
                    <?php echo MyHelper::getRankingCompare($data['track_id'], $data['ranking'], $previousRanking) ?>
                </td>
                <td style="text-align: center"><img src="<?php echo MyHelper::getArtByTrack($data['art'], false, $data['art_type']); ?>" style="max-width: 50px; max-height: 50px"></td>
                <td style="text-align: left">
                    <?php echo $data['name_song']; ?>
                    <br>
                    <span style="color: #adadad">ID: <?php echo $data['track_id']; ?></span>
                </td>
                <td style="text-align: center">
                    <a href="javascript:void(0)" title="Click để xem lịch sử lượt nghe"
                       onclick="showHistory(<?php echo $data['track_id']?>, '<?php echo $data['name_song'] ?>')">
                        <i class="fa fa-line-chart tab-color-blue"></i>
                    </a>
                </td>
                <td style="text-align: left"><?php echo  $data['all_name']; ?></td>
                <td style="text-align: right"><?php echo  number_format($data['views_zing'], 0, ',', '.'); ?></td>
                <td style="text-align: right"><?php echo  number_format($data['views_nct'], 0, ',', '.'); ?></td>
                <td style="text-align: right"><?php echo  number_format($data['views_keeng'], 0, ',', '.'); ?></td>
                <td style="text-align: right"><?php echo  number_format(($data['views_zing'] + $data['views_nct'] + $data['views_keeng']), 0, ',', '.'); ?></td>
                <td style="text-align: right"><?php echo number_format($data['total_point'], 0, ',', '.'); ?></td>
            </tr>
        <?php endforeach; ?>
        <?php else: ?>
            <tr>
                <td colspan="11" style="color: red; font-style: italic">Không có dữ liệu nào!</td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
</div>
<!-- /.row -->
<div style="text-align: center;"><?php //echo $pagination; ?></div>