<?php if (!empty($transactions)) { ?>
	<div class="sj-transaction-list">
	<?php foreach ($transactions as $transaction) { $saved = !empty($transaction['id_surat']) && (int)$transaction['status_surat'] > 0; ?>
		<button type="button" class="sj-transaction-item choose-transaction" data-id="<?=encrypt_url($transaction['id_invoice']);?>">
			<span class="sj-transaction-icon"><i class="fa fa-file-text-o"></i></span>
			<span class="sj-transaction-copy"><strong><?=html_escape($transaction['id_transaksi']);?></strong><small><?=html_escape($transaction['nama_pelanggan']);?> &bull; <?=dtimes($transaction['tgl_trx'], false, false);?></small></span>
			<span class="sj-transaction-status <?=$saved ? 'is-saved' : '';?>"><?=$saved ? 'Sudah dibuat' : 'Buat surat';?></span>
			<i class="fa fa-angle-right sj-transaction-arrow"></i>
		</button>
	<?php } ?>
	</div>
<?php } else { ?>
	<div class="sj-picker-empty"><i class="fa fa-search"></i><strong>Transaksi tidak ditemukan</strong><span>Coba gunakan nomor transaksi atau nama pelanggan yang berbeda.</span></div>
<?php } ?>
