From 77715da174256eb04963240d4374326f576748e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 3 Nov 2017 11:33:00 +0100 Subject: [PATCH] CSV Header angepasst --- cis/private/tools/zeitaufzeichnung.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 4a81868cd..a61aabe07 100755 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -1319,15 +1319,17 @@ function printTableHeadings($fieldheadings, $za_simple = false){ */ function exportAsCSV($data, $delimiter = ',', $fieldheadings, $za_simple = false, $uid) { + $filename = "zeitaufzeichnung_".$uid.".csv"; + header('Content-type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename='.$filename); + $file = fopen('php://output', 'w'); $towrite = getDataForCSV($data, $fieldheadings, $za_simple); foreach ($towrite as $row) { fputcsv($file, $row, $delimiter); } - header('Content-type: text/csv; charset=utf-8'); - header('Content-Disposition: attachment; filename='.$filename); fclose($file); //Abbruch damit HTML markup danach nicht mit exportiert wird exit();