<?php
/**
 * Create CSV Template for Arsip Import
 */

header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="template_arsip.csv"');

// CSV Headers
$headers = [
    'nomor_perkara',
    'nomor_arsip', 
    'no_ruang',
    'no_lemari',
    'no_rak',
    'no_berkas'
];

// Sample data
$sample_data = [
    ['123/Pdt.P/2024/PN Wtp', '001', 'A', '01', '001', '001'],
    ['124/Pdt.P/2024/PN Wtp', '002', 'A', '01', '001', '002'],
    ['125/Pdt.P/2024/PN Wtp', '003', 'A', '01', '002', '001'],
    ['126/Pid.B/2024/PN Wtp', '004', 'B', '02', '001', '001'],
    ['127/Pid.B/2024/PN Wtp', '005', 'B', '02', '001', '002']
];

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

// Write headers
fputcsv($output, $headers);

// Write sample data
foreach ($sample_data as $row) {
    fputcsv($output, $row);
}

fclose($output);
?>
