<?php 
    $produk    = $this -> app -> get_produk(['id' => $id]);
    $getvar    = $this -> app -> get_detail_varian($varian, $sub);
    $transaksi = $this -> db -> get_where('transaksi_detail', ['id' => $trx]) -> row();
    $diskon    = count($produk -> varian) == 0 ? $produk -> diskon : $getvar -> diskon;
    $harga     = count($produk -> varian) == 0 ? $produk -> harga : $getvar -> harga;
?>

<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>Catatan</h2>
    </div>
</div>
<div class="modal-body">
    <div class="prd-card-detail d-flex justify-content-between ">
        <div class="_img">
            <img src="<?= $this -> app -> get_img_produk($produk -> id)  ?>" alt="img">
        </div>
        <div class="_text">
            <p class="truncate-2 mb-1">
                <?= $produk -> nama ?>
            </p>
            <div class="harga-prd d-flex align-items-center">
                <?php if($diskon > 0) : ?>                    
                    <p class="_normal">
                        <?= format_uang($harga - $diskon) ?>
                    </p>
                    <p class="_coret">
                        <?= format_uang($harga) ?>
                    </p>

                <?php else: ?>
                    <p class="_normal">
                        <?= format_uang($harga) ?>
                    </p>
                <?php endif ?>
                
            </div>                           
        </div>
    </div>

    <div class="my-3">
        <p class="mb-1">Catatan</p>
        <textarea class="note-inp form-control"data-trx="<?= $trx ?>" ><?= $transaksi -> catatan ?></textarea>
    </div>
</div>
<div class="modal-footer">
    <button class="btn btn-primary px-3 simpan_note">
        Simpan
    </button>
</div>