<?php 
    $barang = $this -> db -> get_where('barang', ['kode' => $kode]) -> row();
?>
<div class="row justify-content-end">
    <div class="col-4">
        <div class="input-group">
            <input type="number" class="form-control nochange text-center" id="inp_jml_print" value="1">
            <button class="btn btn-light border fa fa-print px-3" id="btn_barcode_print" data-id="<?= $barang -> id ?>"></button>
        </div>
    </div>
</div>

<div class="alert bg-light mt-4">
    <div class="d-flex justify-content-between align-items-between">
        <div class="flex-grow-1">
            <p class="mb-0">
                <?= $barang -> nama ?>
            </p>
            <small>
                Kode: <?= $barang -> kode ?>
            </small>
        </div>
        <div class="text-end ps-2">
            <?php 
                $generator = new Picqer\Barcode\BarcodeGeneratorJPG();
                echo '<img src="data:image/png;base64,' . 
                    base64_encode($generator -> getBarcode($kode, $generator::TYPE_CODE_128, 1, 40)) . 
                '">';
            ?>
        </div>
    </div>
</div>


