<?php
// Set headers to force download of a CSV file
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="sample_students.csv"');

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

// Define CSV headers
$headers = ['ADM', 'Username', 'Email', 'Phone Number', 'Class', 'Stream', 'Status'];

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

// Optional: Add a sample row
// fputcsv($output, ['S001', 'JohnDoe', 'john.doe@example.com', '123-456-7890', 'JSS1', 'A', 'active']);
// fputcsv($output, ['S002', 'JaneSmith', 'jane.smith@example.com', '098-765-4321', 'JSS2', 'B', 'active']);

// Close the output stream
fclose($output);
exit();
?>
