1 | <?php |
---|
2 | /* |
---|
3 | * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved. |
---|
4 | * |
---|
5 | * http://www.lockon.co.jp/ |
---|
6 | */ |
---|
7 | require_once("../require.php"); |
---|
8 | |
---|
9 | // ǧ¾Ú²ÄÈݤÎȽÄê |
---|
10 | $objSess = new SC_Session(); |
---|
11 | sfIsSuccess($objSess); |
---|
12 | |
---|
13 | $data = lfGetCSVData(); |
---|
14 | sfCSVDownload($data); |
---|
15 | exit(); |
---|
16 | |
---|
17 | function lfGetCSVData() { |
---|
18 | global $arrAUTHORITY; |
---|
19 | global $arrWORK; |
---|
20 | |
---|
21 | $oquery = new SC_Query(); |
---|
22 | $cols = "authority,name,department,login_id,work"; |
---|
23 | $oquery->setwhere("del_flg <> 1"); |
---|
24 | $oquery->andwhere("member_id <> ".ADMIN_ID); |
---|
25 | $oquery->setoption("ORDER BY rank DESC"); |
---|
26 | $list_data = $oquery->select($cols, "dtb_member"); |
---|
27 | $max = count($list_data); |
---|
28 | |
---|
29 | for($i = 0; $i < $max; $i++ ){ |
---|
30 | $line = ""; |
---|
31 | $line .= "\"".$arrAUTHORITY[$list_data[$i]['authority']]."\","; |
---|
32 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['name']); |
---|
33 | $line .= "\"".$tmp."\","; |
---|
34 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['department']); |
---|
35 | $line .= "\"".$tmp."\","; |
---|
36 | $tmp = ereg_replace("\"","\"\"",$list_data[$i]['login_id']); |
---|
37 | $line .= "\"".$tmp."\","; |
---|
38 | $line .= "\"".$arrWORK[$list_data[$i]['work']]."\"\n"; |
---|
39 | $data .= $line; |
---|
40 | } |
---|
41 | |
---|
42 | $header = "\"¸¢¸Â\",\"̾Á°\",\"½ê°\",\"¥í¥°¥¤¥óID\",\"²ÔƯ¾õ¶·\"\n"; |
---|
43 | |
---|
44 | return $header.$data; |
---|
45 | } |
---|
46 | ?> |
---|