<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo @$title ?></title>
    <style type="text/css">
    body {
        font-family: tahoma;
        font-size: 8pt;
    }
    hr { 
        display: block;
        margin-top: 0.5em;
        margin-bottom: 0.5em;
        margin-left: auto;
        margin-right: auto;
        border-style: inset;
        border-width: 1px;
    } 
    .container {
        padding: 10px 15px 10px 15px;
        aspect-ratio: 100 / 29;
    }
    .tabelku {
        width: 100%;
        font-size: 8pt;
        font-family: calibri; 
        border-collapse: collapse;
    }
    .tabelku  td {
        padding-left:5px;
        border-bottom: 1px double black;
    }
    </style>
</head>
<body>
<div class="container">
    <table width="100%">
    <tr>
        <td width="15%">Tanggal: <?php echo @$tanggal ?></td>
        <th>SURAT MUTASI BARANG KELUAR</th>
        <td width="15%">Nomor: <?php echo @$kode ?></td>
    </tr>
    </table>
    <hr>
    <table width="100%">
    <tr>
        <td width="50%">
            <h3>Dari:</h3>
            <strong><?php echo @$toko ?></strong><br>
            <?php echo @$alamat ?><br>
            <?php echo @$telepon ?>
        </td>
        <td>
            <h3>Kepada:</h3>
            <strong><?php echo @$nmtoko ?></strong><br>
            <?php echo @$alamattoko ?><br>
            <?php echo @$telepontoko ?>
        </td>
    </tr> 
    </table>
    <br>
    <table class="tabelku" border="0">
    <thead>
    <tr>
        <th style="text-align: center;">#</th>
        <th style="text-align: left;">Kode Barang</th>
        <th style="text-align: left;">Barcode</th>
        <th style="text-align: left;">Nama Barang</th>
        <th style="text-align: center;">Jumlah</th>
        <th style="text-align: right;">Harga Satuan</th>
        <th style="text-align: right;">Total Harga</th>
    </tr>
    </thead>
    <tbody>
    <?php
    $no=1;
    $sub=0;
    $ongkir=0;
    if (@$databarang) {
        foreach ($databarang as $hasil) {
            ?>
            <tr>
                <td><?php echo $no ?></td>
                <td><?php echo $hasil->kode_barang ?></td>
                <td><?php echo $hasil->barcode ?></td>
                <td><?php echo $hasil->barang ?></td>
                <td style="text-align: center;"><?php echo $hasil->jumlah_mutasi.' '.$hasil->satuan ?></td>
                <td style="text-align: right;"><?php echo 'Rp '.number_format($hasil->harga_beli,0,',','.') ?></td>
                <td style="text-align: right;"><?php echo 'Rp '.number_format($hasil->total_harga,0,',','.') ?></td>
            </tr>
            <?php
            $no++;
            $sub=$sub+$hasil->total_harga;
        }
    }
    ?>
    </tbody>
    </table>
    <table class="tabelku">
    <tbody>
    <tr>
        <th style="text-align: left;">Total</th>
        <th style="text-align: right;"><?php echo 'Rp '.number_format($sub,0,',','.') ?></th>
    </tr>
    </tbody>
    </table>
</div>
<script type="text/javascript">
    window.print();
</script>
</body>
</html>