CSV Header angepasst

This commit is contained in:
Andreas Österreicher
2017-11-03 11:33:00 +01:00
parent 3d2df79c6d
commit 77715da174
+4 -2
View File
@@ -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();