[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/26: New function header_csv($filename)
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/26: New function header_csv($filename) |
Date: |
Wed, 11 Aug 2021 11:08:08 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 6e935c9326198ce209407cb6bffba7b0d2e6858b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Jul 27 12:18:28 2021 +0200
New function header_csv($filename)
---
include/lib/ac_common.php | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index 3dd5261..64a7834 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -1204,6 +1204,21 @@ function display_menu($p_menuid)
}
/**
+ * @brief Send an header CSV with a filename
+ * @param string $p_filename , file name , caution , it must be sanitized
BEFORE calling this function
+ */
+function header_csv($p_filename)
+{
+
+ header('Pragma: public');
+ header('Content-type: application/csv');
+ header("Content-Disposition: attachment;filename=\"{$p_filename}\"",
+ FALSE);
+ header('Cache-Control: no-store, no-cache, must-revalidate');
+ header('Expires: Sun, 1 Jan 2000 12:00:00 GMT');
+ header('Last-Modified: '.gmdate('D, d M Y H:i:s').'GMT');
+}
+/**
* Put in superglobal (get,post,request) the value contained in
* the parameter field (me_parameter)
* @param $array [key] [value]
- [Noalyss-commit] [noalyss] branch master updated (61b50d7 -> 07fedf5), Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 01/26: Cosmetic #0002047: Historique : montant total n'est pas dans la bonne colonne, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 02/26: Bug The detailled report of sales without VAT does not give any result, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 03/26: New function header_csv($filename),
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/26: Merge branch 'master' into b-orion, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 04/26: Code documentation, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 08/26: Task #0002050: Mobile : menu différent, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 06/26: Merge branch 'master' into b-orion, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 07/26: Documentation for Doxygen, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 12/26: Code cleaning : extra information are now a fonction, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 10/26: Documentation doxygen, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 19/26: cosmetic : fix icon in followup for the trash can, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 16/26: cosmetic : flashing color for h2.error, Dany De Bontridder, 2021/08/11
- [Noalyss-commit] [noalyss] 24/26: Code cleaning Improve doc and test, Dany De Bontridder, 2021/08/11