source: temp/trunk/html/admin/system/member_csv.php @ 1328

Revision 1328, 1.1 KB checked in by naka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2require_once("../require.php");
3
4// ǧ¾Ú²ÄÈݤÎȽÄê
5$objSess = new SC_Session();
6sfIsSuccess($objSess);
7
8$data = lfGetCSVData();
9sfCSVDownload($data);
10exit();
11
12function lfGetCSVData() {
13    global $arrAUTHORITY;
14    global $arrWORK;
15   
16    $oquery = new SC_Query();
17    $cols = "authority,name,department,login_id,work";
18    $oquery->setwhere("delete <> 1");
19    $oquery->andwhere("member_id <> ".ADMIN_ID);
20    $oquery->setoption("ORDER BY rank DESC");
21    $list_data = $oquery->select($cols, "dtb_member");
22    $max = count($list_data);
23   
24    for($i = 0; $i < $max; $i++ ){
25        $line = "";
26        $line .= "\"".$arrAUTHORITY[$list_data[$i]['authority']]."\",";
27        $tmp = ereg_replace("\"","\"\"",$list_data[$i]['name']);
28        $line .= "\"".$tmp."\",";
29        $tmp = ereg_replace("\"","\"\"",$list_data[$i]['department']);
30        $line .= "\"".$tmp."\",";
31        $tmp = ereg_replace("\"","\"\"",$list_data[$i]['login_id']);
32        $line .= "\"".$tmp."\",";
33        $line .= "\"".$arrWORK[$list_data[$i]['work']]."\"\n";
34        $data .= $line;
35    }
36   
37    $header = "\"¸¢¸Â\",\"̾Á°\",\"½ê°\",\"¥í¥°¥¤¥óID\",\"²ÔƯ¾õ¶·\"\n";
38   
39    return $header.$data;
40}
41?>
Note: See TracBrowser for help on using the repository browser.