source: branches/feature-module-update/html/admin/contents/campaign_csv.php @ 15080

Revision 15080, 1.1 KB checked in by nanasess, 17 years ago (diff)

svn properties 設定

  • svn:mime-type - application/x-httpd-php; charset=UTF-8
  • svn:keywords - Id
  • Property svn:keywords set to Id
  • Property svn:mime-type set to application/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once(DATA_PATH . "include/csv_output.inc");
8
9// CSV出力データを作成する。
10function lfGetCSV($from, $where, $option, $arrval, $arrCsvOutputCols = "") {
11    global $arrCVSCOL;
12
13    //$cols = sfGetCommaList($arrCVSCOL);
14    $cols = sfGetCommaList($arrCsvOutputCols);
15   
16    $objQuery = new SC_Query();
17    $objQuery->setoption($option);
18   
19    $list_data = $objQuery->select($cols, $from, $where, $arrval); 
20
21    $max = count($list_data);
22    for($i = 0; $i < $max; $i++) {
23        // 各項目をCSV出力用に変換する。
24        $data .= lfMakeCSV($list_data[$i]);
25    }
26    return $data;
27}
28
29// 各項目をCSV出力用に変換する。
30function lfMakeCSV($list) {
31    global $arrPref;
32   
33    $line = "";
34   
35    foreach($list as $key => $val) {
36        $tmp = "";
37        switch($key) {
38        case 'order_pref':
39            $tmp = $arrPref[$val];
40            break;
41        default:
42            $tmp = $val;
43            break;
44        }
45
46        $tmp = ereg_replace("[\",]", " ", $tmp);
47        $line .= "\"".$tmp."\",";
48    }
49    // 文末の","を変換
50    $line = ereg_replace(",$", "\n", $line);
51    return $line;
52}
53
54?>
Note: See TracBrowser for help on using the repository browser.