<?php
require_once __DIR__ . '/../lib/core.php';
dc_require_login();

$filename = 'doors-backup-' . date('Ymd-His') . '.csv';

header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="' . $filename . '"');

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