<?php $PAGE_TITLE='Transactions'; require __DIR__.'/_layout.php';
$s=$pdo->prepare("SELECT * FROM transactions WHERE user_id=? ORDER BY id DESC LIMIT 100"); $s->execute([$U['id']]); $rows=$s->fetchAll();
?>
<h2 style="margin-bottom:14px">💳 ট্রানজেকশন</h2>
<table><thead><tr><th>#</th><th>Date</th><th>Type</th><th>Amount</th><th>Note</th></tr></thead><tbody>
<?php foreach($rows as $r):?>
<tr><td>#<?=$r['id']?></td><td><?=e($r['created_at'])?></td>
<td><span class="badge <?=$r['type']==='credit'?'ok':'fail'?>"><?=e($r['type'])?></span></td>
<td><?=money($r['amount'])?></td><td><?=e($r['note'])?></td></tr>
<?php endforeach;?>
</tbody></table>
<?php require __DIR__.'/_footer.php';
