<?php
// get/template_po.php
// File ini untuk generate Template Excel

 $filename = "Template_Import_PO.xls";

// Header untuk download file Excel
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Pragma: no-cache");
header("Expires: 0");

// Judul Kolom (Urutan baru dengan Supplier)
 $headers = array(
    "No PO",
    "Tanggal (Y-m-d)",
    "Supplier",           // KOLOM BARU
    "Kode Barang",
    "Nama Barang",
    "Qty",
    "Unit",
    "Harga",
    "Status (pending/completed)",
    "Komentar"
);

// Tampilkan Header
echo implode("\t", $headers) . "\n";

// Tampilkan 1 baris contoh data
 $sample = array(
    "PO-2023-001",
    date('Y-m-d'),
    "PT. Maju Jaya",      // CONTOH SUPPLIER
    "BRG-001",
    "Bearing 6205",
    "10",
    "pcs",
    "150000",
    "pending",
    "Contoh isi komentar"
);

echo implode("\t", $sample) . "\n";

exit;
?>