<?php

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment;filename= Laporan_pengiriman.xls");
header("Content-Transfer-Encoding: binary ");

?>
<!doctype html>
<html lang="en">

<head>
    <h1>Laporan Pengiriman</h1>
</head>
<table border="1" rules="all">
    <thead>
        <th>#</th>
        <th>Tgl Kirim</th>
        <th>SKU</th>
        <th>Barang</th>
        <th>Qty</th>
    </thead>
    <tbody>
        <?php
        $i = 1;
        foreach ($data as $dt) {
            echo "<tr>";
            echo "<td>" . $i . "</td>";
            echo "<td>" . $dt['tanggal_kirim'] . "</td>";
            echo "<td>" . $dt['sku'] . "</td>";
            echo "<td>" . $dt['barang'] . "</td>";
            echo "<td>" . $dt['qty_kirim'] . "</td>";
            echo "</tr>";
            $i++;
        }
        ?>
    </tbody>
</table>

</html>