| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * This file is part of EC-CUBE |
|---|
| 4 | * |
|---|
| 5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 6 | * |
|---|
| 7 | * http://www.lockon.co.jp/ |
|---|
| 8 | * |
|---|
| 9 | * This program is free software; you can redistribute it and/or |
|---|
| 10 | * modify it under the terms of the GNU General Public License |
|---|
| 11 | * as published by the Free Software Foundation; either version 2 |
|---|
| 12 | * of the License, or (at your option) any later version. |
|---|
| 13 | * |
|---|
| 14 | * This program is distributed in the hope that it will be useful, |
|---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | * GNU General Public License for more details. |
|---|
| 18 | * |
|---|
| 19 | * You should have received a copy of the GNU General Public License |
|---|
| 20 | * along with this program; if not, write to the Free Software |
|---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 22 | */ |
|---|
| 23 | require_once("../require.php"); |
|---|
| 24 | |
|---|
| 25 | // 認証可否の判定 |
|---|
| 26 | $objSess = new SC_Session(); |
|---|
| 27 | sfIsSuccess($objSess); |
|---|
| 28 | |
|---|
| 29 | $data = lfGetCSVData(); |
|---|
| 30 | sfCSVDownload($data); |
|---|
| 31 | exit(); |
|---|
| 32 | |
|---|
| 33 | function lfGetCSVData() { |
|---|
| 34 | global $arrAUTHORITY; |
|---|
| 35 | global $arrWORK; |
|---|
| 36 | |
|---|
| 37 | $oquery = new SC_Query(); |
|---|
| 38 | $cols = "authority,name,department,login_id,work"; |
|---|
| 39 | $oquery->setwhere("del_flg <> 1"); |
|---|
| 40 | $oquery->andwhere("member_id <> ".ADMIN_ID); |
|---|
| 41 | $oquery->setoption("ORDER BY rank DESC"); |
|---|
| 42 | $list_data = $oquery->select($cols, "dtb_member"); |
|---|
| 43 | $max = count($list_data); |
|---|
| 44 | |
|---|
| 45 | for($i = 0; $i < $max; $i++ ){ |
|---|
| 46 | $line = ""; |
|---|
| 47 | $line .= "\"".$arrAUTHORITY[$list_data[$i]['authority']]."\","; |
|---|
| 48 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['name']); |
|---|
| 49 | $line .= "\"".$tmp."\","; |
|---|
| 50 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['department']); |
|---|
| 51 | $line .= "\"".$tmp."\","; |
|---|
| 52 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['login_id']); |
|---|
| 53 | $line .= "\"".$tmp."\","; |
|---|
| 54 | $line .= "\"".$arrWORK[$list_data[$i]['work']]."\"\n"; |
|---|
| 55 | $data .= $line; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | $header = "\"権限\",\"名前\",\"所属\",\"ログインID\",\"稼働状況\"\n"; |
|---|
| 59 | |
|---|
| 60 | return $header.$data; |
|---|
| 61 | } |
|---|
| 62 | ?> |
|---|