<div class="page-breadcrumb">
    <div class="row">
        <div class="col-5 align-self-center">
            <h4 class="page-title">Daftar Claim Scatter</h4>
        </div>
        <div class="col-7 align-self-center">
            <div class="d-flex align-items-center justify-content-end">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            <a href="#">Claim Scatter</a>
                        </li>
                        <li class="breadcrumb-item active">Riwayat Claim</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">

<div class="card-body">
    <h4 class="card-title">Riwayat Claim Scatter</h4>
</div>

<div class="table-responsive">
<table id="zero_config" class="table table-striped table-bordered">
<thead>
<tr>
    <th>#</th>
    <th>Tanggal</th>
    <th>Username</th>
    <th>Play ID</th>
    <th>Total Bet</th>
    <th>Scatter</th>
    <th>Bonus</th>
    <th>Bukti</th>
    <th>Status</th>
</tr>
</thead>
<tbody>

<?php
$query = mysqli_query($koneksi, "
    SELECT cs.*, u.username 
    FROM tb_scater cs
    JOIN tb_user u ON u.extplayer = cs.id_user
    ORDER BY cs.id DESC
");

$no = 1;
while ($row = mysqli_fetch_assoc($query)) {
?>
<tr>
    <td><?= $no++; ?></td>
    <td><?= date('d-m-Y H:i', strtotime($row['created_at'])) ?></td>
    <td><?= $row['username'] ?></td>
    <td><?= $row['play_id'] ?></td>
    <td>Rp <?= number_format($row['total_bet'],0,',','.') ?></td>
    <td><?= $row['jumlah_scater'] ?></td>
    <td>
        Rp <?= number_format($row['total_bonus'],0,',','.') ?>
    </td>
    <td>
        <a href="../../uploads/bukti_scater/<?= $row['bukti_ss'] ?>" 
           class="btn btn-success btn-sm" target="_blank">
           Bukti
        </a>
    </td>
    <td>
        <?php
        if ($row['status'] == 'pending') {
            echo '<span class="badge badge-warning">Pending</span>';
        } elseif ($row['status'] == 'approved') {
            echo '<span class="badge badge-success">Approved</span>';
        } else {
            echo '<span class="badge badge-danger">Rejected</span>';
        }
        ?>
    </td>
</tr>
<?php } ?>

</tbody>
</table>
</div>

</div>
</div>
</div>
</div>