<?php
// api/download_sample_csv.php
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="calendar_import_sample.csv"');

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

// Headers
fputcsv($output, ['Date (YYYY-MM-DD)', 'Title', 'Time (HH:MM)', 'Prayer Room Time (HH:MM)', 'Description']);

// Sample Row 1
fputcsv($output, [date('Y-m-d', strtotime('+1 day')), 'Workers Meeting', '18:00', '17:30', 'Weekly preparatory meeting']);

// Sample Row 2
fputcsv($output, [date('Y-m-d', strtotime('+7 days')), 'Combined Service', '09:00', '08:30', 'Monthly joint service']);

fclose($output);
exit;
