<div class="page-breadcrumb">
<div class="row">
    <div class="col-5 align-self-center">
        <h4 class="page-title">Permintaan Claim Scatter</h4>
    </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">Claim Scatter Pending</h4>
</div>

<div class="table-responsive">
<table 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>Aksi</th>
</tr>
</thead>
<tbody>

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

$no=1;
while($d=mysqli_fetch_assoc($q)){
?>
<tr>
<td><?= $no++ ?></td>
<td><?= date('d-m-Y H:i',strtotime($d['created_at'])) ?></td>
<td><?= $d['username'] ?></td>
<td><?= $d['play_id'] ?></td>
<td>Rp <?= number_format($d['total_bet']) ?></td>
<td><?= $d['jumlah_scater'] ?></td>
<td>Rp <?= number_format($d['total_bonus']) ?></td>
<td>
    <a href="../../uploads/bukti_scater/<?= $d['bukti_ss'] ?>" 
       class="btn btn-success btn-sm" target="_blank">
       Bukti
    </a>
</td>
<td>
    <a href="?page=proses_claim_scater&id=<?= $d['id'] ?>" 
       class="btn btn-primary btn-sm">
       Approve
    </a>
    <a href="?page=proses_reject_claim_scater&id=<?= $d['id'] ?>" 
       class="btn btn-danger btn-sm">
       Reject
    </a>
</td>
</tr>
<?php } ?>

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

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