<?php if (count($saldo) > 0): ?>
	<?php foreach ($saldo as $res): ?>
		<?php
		if ((int) $res->status === 1) {
			$statusHtml = "<span style='color:#27ae60'>berhasil</span>";
		} elseif ((int) $res->status === 2) {
			$statusHtml = "<span style='color:#c0392b'>dibatalkan</span>";
		} else {
			$statusHtml = "<i style='color:#f39c12'>belum dibayar</i>";
		}
		$jumlah = $func->formUang($res->total);
		?>
		<ul class="list-items mb-2">
			<li>
				<div class="col-12">
					<div class="row">
						<div class="col-12">
							TopUp Saldo <?= esc($func->getSetting('nama')) ?><br/>
							<span class="text-secondary small mb-2"><?= esc($func->ubahTgl('d M Y H:i', $res->tgl)) ?></span><br/>
							<b class="text-success font-weight-normal mb-0">Rp <?= esc($jumlah) ?></b>
							<span class="text-success small"> <?= $statusHtml ?></span>
						</div>
					</div>
					<?php if ((int) $res->status === 0): ?>
						<div class="col-12 text-center">
							<a href="javascript:void(0)" onclick="bayarTopup('<?= esc($res->trxid) ?>')" class="btn btn-sm btn-success btn-rounded shadow mb-1">Bayar</a>&nbsp;
							<a href="javascript:void(0)" onclick="batalTopup(<?= (int) $res->id ?>)" class="btn btn-sm btn-danger btn-rounded shadow mb-1">Batal</a>
						</div>
					<?php endif; ?>
				</div>
			</li>
		</ul>
	<?php endforeach; ?>
	<?= $func->createPagination($rows, $page, $perpage, 'historyTopup') ?>
<?php else: ?>
	<div class="txt-center"><h5>BELUM ADA TRANSAKSI</h5></div>
<?php endif; ?>
