ここの情報は古いです。ご理解頂いた上でお取り扱いください。
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2008 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class admin_do_csv_user_analysis_date_month extends OpenPNE_Action |
---|
8 | { |
---|
9 | function isSecure() |
---|
10 | { |
---|
11 | session_cache_limiter('public'); |
---|
12 | return true; |
---|
13 | } |
---|
14 | |
---|
15 | function handleError($errors) |
---|
16 | { |
---|
17 | admin_client_redirect('user_analysis_date_month', array_shift($errors)); |
---|
18 | } |
---|
19 | |
---|
20 | function execute($requests) |
---|
21 | { |
---|
22 | $csv = '"月","人数"' . "\n"; |
---|
23 | $csv = mb_convert_encoding($csv, 'SJIS', 'UTF-8'); |
---|
24 | |
---|
25 | $analysis_date_month = get_analysis_date_month(); |
---|
26 | foreach ($analysis_date_month as $key => $value) { |
---|
27 | $csv .= sprintf("\"%s\",%d\n", $key, $value); |
---|
28 | } |
---|
29 | |
---|
30 | //IE以外の場合、キャッシュをさせないヘッダを出力 |
---|
31 | if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') === false) { |
---|
32 | send_nocache_headers(true); |
---|
33 | } |
---|
34 | header("Content-Type: application/octet-stream"); |
---|
35 | header("Content-Disposition: attachment; filename=user_analysis_date_month.csv"); |
---|
36 | echo $csv; |
---|
37 | exit; |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.
Download in other formats: