<?php
header("Content-Type: text/csv; charset=UTF-8");
header("Content-Disposition: attachment; filename=template_kwitansi.csv");

$output = fopen("php://output", "w");

/* BOM agar Excel Indonesia tidak rusak */
fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF));

/* HEADER KOLOM */
$header = [
    "tanggal (YYYY-MM-DD)",
    "kode_kegiatan",
    "kode_rekening",
    "nobukti",
    "uraian",
    "jumb",
    "satuanb",
    "pengeluaran",
    "yang_menerima"
];

/* TULIS HEADER */
fputcsv($output, $header, ";");

/* CONTOH DATA */
$contoh = [
    "2025-08-28",
    "07.12.02.",
    "5.1.02.02.01.0013",
    "BNU16",
    "HONORARIUM TENAGA KEAMANAN SEKOLAH",
    "1",
    "bln/org",
    "800000",
    "MISBAHUL HASAN"
];

/* TULIS CONTOH */
fputcsv($output, $contoh, ";");

fclose($output);
exit;
