<div class="modal-header">
    <div class="_title d-flex align-items-center">
        <a href="" data-bs-dismiss="modal" class="close">
            <i class="fa fa-times"></i>
        </a>
        <h2>Top up Saldo</h2>
    </div>
</div>
<div class="modal-body">
    <div class="mb-3">
        <label class="form-label">Nominal</label>
        <div class="input-group">
            <span class="input-group-text">
                Rp
            </span>
            <input type="text" class="nf form-control nominal_tf" name="nominal_tf">
        </div>
        <div class="mt-1">
            <small class="text-muted">Top up saldo minimal Rp50.000</small>
        </div>
    </div>
    <div class="mb-5">
        <label class="form-label">Metode Pembayaran</label>
    
        <input type="hidden" name="payment_tf_gateway">
        <input type="hidden" name="payment_tf_icon">
        <input type="hidden" name="payment_tf_fee">
    
        <?php foreach($data as $title => $rows) : ?>
            <?php 
                $title = ucwords(str_replace('_', ' ', $title));
                $title = $title == 'Transfer Bank' ? $title . ' (Verifikasi manual)' : ($title == 'Saldo' ? 'Saldo' : $title . ' (Verifikasi otomatis)');   
            ?>
            <?php if($title != 'Saldo') : ?>
                <ul class="list-group mb-3">
                    <li class="list-group-item py-3 bg-light">
                        <?= $title ?>
                    </li>
                    <?php foreach($rows as $item) : ?>
                        <li class="list-group-item py-2">
                            <div class="form-check">
                                <input class="form-check-input" 
                                        type="radio" 
                                        name="payment_tf" 
                                        id="tf_<?= $item -> code ?>" 
                                        value="<?= $item -> code ?>"
                                        data-gateway="<?= $item -> gateway ?>" 
                                        data-fee="<?= $item -> fee ?>" 
                                        data-icon="<?= $item -> icon ?>" 
                                >
                                <label class="form-check-label" for="tf_<?= $item -> code ?>">
                                    <?= $item -> name ?>
                                    <div>
                                        <small class="text-muted">
                                            Biaya penanganan: <?= format_uang($item -> fee) ?>
                                        </small>
                                    </div>
                                </label>
                            </div>
                        </li>
                    <?php endforeach ?>
                </ul>
            <?php endif ?>
        <?php endforeach ?>
    </div>
</div>
<div class="modal-footer">
    <button class="btn btn-primary w-100 p-3">
        <i class="fa fa-plus me-2"></i>
        <strong>
            Top up Saldo
        </strong>
    </button>
</div>