<div class="row">
                        <div class="col-md-12">
		<div class="text-left mb-2">
		<a href="<?= base_url('deposit/history') ?>" class="btn btn-primary mb-3"><i class="fas fa-arrow-circle-left fs-6 me-2"></i>Kembali</a>
		</div>
                            <div class="card" id="demo">
                                <div class="card-header">
                                    <div class="d-sm-flex">
                                        <div class="flex-grow-1">
                                            <h4 class="b-brand text-primary"><?= website_config('title') ?></h4>
                                                <p class="text-muted mb-1" id="address-details">Medan, Sumatera Utara, Indonesia</p>
                                        </div>
                                     
                                    </div>
                                </div>
                                <!--end card-header-->
                                <div class="card-body p-4">
                                    <div class="row g-3">
                                        <div class="col-lg-12">
                                            <div class="alert alert-primary">Deposit akan sukses dalam waktu 1-10 Menit</div>
                                        </div>
                                        <div class="col-lg-3 col-6">
                                            <p class="text-muted mb-2 text-uppercase fw-semibold">Invoice No</p>
                                            <h5 class="fs-14 mb-0">#<span id="invoice-no"><?= $target->id ?></span></h5>
                                        </div>
                                        <!--end col-->
                                        <div class="col-lg-3 col-6">
                                            <p class="text-muted mb-2 text-uppercase fw-semibold">Date</p>
                                            <h5 class="fs-14 mb-0"><span id="invoice-date"><?= $this->lib->format_date($target->created_at) ?>  </span></h5>
                                        </div>
                                        <!--end col-->
                                        <div class="col-lg-3 col-6">
                                            <p class="text-muted mb-2 text-uppercase fw-semibold">Payment Status</p>
                                            <?= $this->lib->status_deposit($target->status) ?>
                                        </div>
                                        <!--end col-->
                                        <div class="col-lg-3 col-6">
                                            <p class="text-muted mb-2 text-uppercase fw-semibold">Total Amount</p>
                                            <h5 class="fs-14 mb-0">Rp<span id="total-amount"><?= currency($target->amount) ?></span></h5>
                                        </div>
                                        <!--end col-->
                                    </div>
                                    <!--end row-->
                                </div>
                                <!--end card-body-->
                                <div class="card-body p-4">
                                    <div class="table-responsive">
                                        <table
                                            class="table table-borderless text-center table-nowrap align-middle mb-0">
                                            <thead>
                                                <tr class="table-active">
                                                    <th scope="col" style="width: 50px;">#</th>
                                                    <th scope="col" style="wdith: 100px;">Metode Pembayaran</th>
                                                    <th scope="col">Jumlah Transfer</th>
                                                    <th scope="col">Saldo Didapat</th>
                                                    <th scope="col" class="text-end">Status</th>
                                                    <?php if ($deposit_method->tripay_code <> '-') { ?>
                                                    <th scope="col" class="text-end">Link Pembayaran</th>
                                                    <?php } ?>
                                                </tr>
                                            </thead>
                                            <tbody id="products-list">
                                                <tr>
                                                    <th scope="row">01</th>
                                                    <td class="text-start">
                                                        <span class="fw-medium"><?= $deposit_method->name ?></span>
                                                    </td>
                                                    <td>Rp <?= currency($target->amount) ?></td>
                                                    <td>Rp <?= currency($target->balance) ?></td>
                                                    <td class="text-end"><?= $this->lib->status_deposit($target->status) ?></td>
                                                    <?php if ($deposit_method->tripay_code <> '-') { ?>
                                                    <th scope="col" class="text-end"><a href="https://tripay.co.id/checkout/<?= $target->reference ?>" target="_blank" class="btn btn-primary btn-sm round">Link Pembayaran</a></th>
                                                    <?php } ?>
                                                </tr>
                                                <tr class="border-top border-top-dashed mt-2">
                                                    <td colspan="3"></td>
                                                    <td colspan="2" class="fw-medium p-0">
                                                        <table
                                                            class="table table-borderless text-start table-nowrap align-middle mb-0">
                                                            <tbody>
                                                                <tr>
                                                                    <td>Sub Total </td>
                                                                    <td class="text-end">Rp <?= currency($target->amount) ?></td>
                                                                </tr>
                                                                <tr class="border-top border-top-dashed">
                                                                    <th scope="row"><h2>Jumlah Transfer</h2></th>
                                                                    <td class="text-end"><h2>Rp <?= currency($target->amount) ?></h2></td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                        <!--end table-->
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <!--end table-->
                                    </div>
                                    <div class="">
                                        <div class="row justify-content-center">
                                            <div class="col-sm-6">
                                                <div class="clearfix pt-5"><hr>
                                                    <?php if ($target->reference <> NULL) { ?>
                                                    <?php if ($deposit_method->tripay_code == 'QRIS' OR $deposit_method->tripay_code == 'QRISC') { ?>
                                                    <p>Silahkan lakukan pembayaran dengan meng-scan QR Code dibawah ini</p>
                                                    <a href="#"><img style="
    margin: auto;
    text-align: center;
    display: block;" src="https://tripay.co.id/qr/<?= $target->reference ?>" alt="" height="150" />
                                                    </a>
                                                    <?php } elseif (in_array($deposit_method->tripay_code, ['INDOMARET', 'ALFAMART', 'ALFAMIDI']) == true) { ?>
                                                    <p class="text-center">Silahkan salin Kode Pembayaran ini dan tunjukan ke kasir:</p>
                                                    <h2 class="text-center text-primary"><b><?= $target->additional_data ?></b> <i data-toggle="tooltip" data-placement="bottom" title="Copy to clipboard" data-container="body" onclick="copy('<?= $target->additional_data ?>', this)" class="fas fa-copy"></i></h2>
                                                    <?php } elseif (in_array($deposit_method->tripay_code, ['OVO', 'SHOPEEPAY']) == true) { ?>
                                                    <p class="text-center">Silahkan klik <b>Link Pembayaran</b> diatas untuk melanjutkan Pembayaran.</p>
                                                    <?php } else { ?>
                                                    <p class="text-center">Silahkan lakukan pembayaran dengan menyalin kode VA</p>
                                                    <h2 class="text-center text-primary"><b><?= $target->additional_data ?></b> <i data-toggle="tooltip" data-placement="bottom" title="Copy to clipboard" data-container="body" onclick="copy('<?= $target->additional_data ?>', this)" class="fas fa-copy"></i></h2>
                                            <?php } ?>
                                            <?php } else { ?>
                                                    <h4 class="text-center">Detail Pembayaran:</h4>
                                                    <div class="table-responsive">
                                                        <table class="table table-colored-bordered table-bordered-dark table-hover">
                                                            <tbody>
                                                                <tr>
                                                                    <td>Nama Bank:</td>
                                                                    <td><b><?= $deposit_method->name ?></b></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Nomor Rekening:</td>
                                                                    <td><?= $deposit_method->number_account ?> <i data-toggle="tooltip" data-placement="bottom" title="Copy to clipboard" data-container="body" onclick="copy('<?= $deposit_method->number_account ?>', this)" class="fas fa-copy"></i></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Atas Nama:</td>
                                                                    <td><?= $deposit_method->name_account ?></td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                            <?php } ?>
                                                </div>
                                                <div class="hstack gap-2 justify-content-center  mt-4">
                                                <a href="javascript:;" onclick="modal_open('Batalkan Deposit', '<?= base_url('deposit/cancel/'.$target->id) ?>')" class="btn btn-danger btn-sm round <?= ($target->status <> 'Pending') ? 'disabled' : '' ?>" data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="top" title="Batalkan"><i class="fas fa-times-circle fs-6 me-2"></i>Batalkan</a>
                                                    <a href="javascript:window.print()" class="btn btn-primary btn-sm round"><i class="fas fa-print fs-6 me-2"></i>Print</a>
                                                </div> 
                                            </div> <!-- end col -->
                                        </div>
                                        <!-- end row -->
                                    </div>
                                </div>
                                <!--end card-body-->
                            </div>
                            <!--end card-->
                        </div>
                        <!--end col-->
                    </div>
                    <!--end row-->
<script>

function copy(text, elem) {
        var input = document.createElement('textarea');
        input.innerHTML = text;
        document.body.appendChild(input);
        input.select();
        var result = document.execCommand('copy');
        document.body.removeChild(input);

        $(elem).removeClass("uil uil-copy-alt").addClass("uil-file-check-alt").attr("style", "color: <?= website_config('color_theme') ?>;");
        $(elem).attr("title", "Copied!").tooltip("_fixTitle").tooltip("show").attr("title", "Copy to clipboard").tooltip("_fixTitle");

        setTimeout(() => {
            $(elem).removeClass("uil-file-check-alt").addClass("uil uil-copy-alt").removeAttr("style");
        }, 3000);
        // return result;
    }
</script>