<div>
    <table class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th style="text-align: center">STT</th>
            <th style="text-align: center">Nguồn BXH</th>
            <th style="text-align: center">Thời gian</th>
            <th style="text-align: center">Ranking - Bài hát đúng - ID</th>
            <th style="text-align: center">Ranking - Bài hát trùng / muốn gỡ bỏ - ID</th>
            <th style="text-align: center">Trạng thái</th>
            <th style="text-align: center">Xử lý</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: left"><?php echo $data['scope']; ?></td>
                <td style="text-align: center">
                    <?php echo ($data['scope'] == 'DAILY' && !empty($data['date'])) ? date('d/m/Y', strtotime($data['date'])) : '' ; ?>
                    <?php echo ($data['scope'] == 'WEEKLY') ? $data['week'] . '/' . $data['year'] : '' ; ?>
                    <?php echo ($data['scope'] == 'MONTHLY') ? $data['month'] . '/' . $data['year'] : '' ; ?>
                </td>
                <td style="text-align: left">
                    <?php echo $data['keep_track_title']; ?>
                </td>
                <td style="text-align: left">
                    <?php echo $data['delete_track_title']; ?>
                    <br>
                    <span style="color: #adadad">ID: <?php echo $data['ranking_id']; ?> | Nhận lúc: <?php echo MyHelper::reFormatDate($data['created_at']); ?></span>
                </td>
                <td>
                    <?php if ($data['status'] == 1): ?>
                        <span>Đã xử lý</span>
                        <br>
                        <span style="color: #adadad">Lúc: <?php echo MyHelper::reFormatDate($data['updated_at']); ?></span>
                    <?php else: ?>
                        <span>Chờ xử lý</span>
                    <?php endif; ?>
                </td>
                <td style="text-align: center">
                    <?php if($data['status'] == 0): ?>
                    <a href="<?php echo base_url('backend/cmsRanking/processOverlapRanking/'.$data['id'].'/'.$data['scope']); ?>"
                       title="Xử lý xóa trùng" onclick="return confirm('Bạn có chắc chắn muốn xóa bài này khỏi BXH không?');">
                        <i class="ace-icon fa fa-trash bigger-130 color-red"></i>
                    </a>
                    <?php endif; ?>
                </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>