From 28e25f1a38bbb1ca722b6c39bbf637106cd580ca Mon Sep 17 00:00:00 2001 From: Christian Paminger Date: Tue, 24 Jun 2014 22:19:49 +0000 Subject: [PATCH] AddOn - Reports --- vilesci/statistik/statistik_sql.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vilesci/statistik/statistik_sql.php b/vilesci/statistik/statistik_sql.php index fb27ebe3a..0a8173c37 100644 --- a/vilesci/statistik/statistik_sql.php +++ b/vilesci/statistik/statistik_sql.php @@ -113,11 +113,18 @@ switch ($outputformat) echo $html; break; case 'csv': + header("Content-type: text/csv"); + header("Content-Disposition: attachment; filename=data.csv"); + header("Pragma: no-cache"); + header("Expires: 0"); echo $csv; break; case 'json': + header("Content-type: application/json"); + header("Content-Disposition: attachment; filename=data.json"); + header("Pragma: no-cache"); + header("Expires: 0"); //$array= array_map("str_getcsv",explode("\n", $csv)); - echo json_encode($json); } ?>