source: branches/feature-module-update/html/admin/order/index_csv.php @ 15532

Revision 15532, 1.3 KB checked in by nanasess, 17 years ago (diff)

svn:mime-type 修正

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/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/*------  /admin/contents/inpuiry.php からも呼び出します。(11/18 fukuda) ---*/
9
10// CSV出力データを作成する。
11function lfGetCSV($from, $where, $option, $arrval, $arrCsvOutputCols = "") {
12    global $arrCVSCOL;
13
14    //$cols = sfGetCommaList($arrCVSCOL);
15    $cols = sfGetCommaList($arrCsvOutputCols);
16   
17    $objQuery = new SC_Query();
18    $objQuery->setoption($option);
19   
20    $list_data = $objQuery->select($cols, $from, $where, $arrval); 
21
22    $max = count($list_data);
23    for($i = 0; $i < $max; $i++) {
24        // 各項目をCSV出力用に変換する。
25        $data .= lfMakeCSV($list_data[$i]);
26    }
27    return $data;
28}
29
30// 各項目をCSV出力用に変換する。
31function lfMakeCSV($list) {
32    global $arrPref;
33    global $arrJob;
34    global $arrORDERSTATUS;
35   
36    $line = "";
37   
38    foreach($list as $key => $val) {
39        $tmp = "";
40        switch($key) {
41        case 'order_pref':
42            $tmp = $arrPref[$val];
43            break;
44        case 'order_job':
45            $tmp = $arrJob[$val];
46            break;
47        case 'status':
48            $tmp = $arrORDERSTATUS[$val];
49            break;
50        default:
51            $tmp = $val;
52            break;
53        }
54
55        $tmp = ereg_replace("[\",]", " ", $tmp);
56        $line .= "\"".$tmp."\",";
57    }
58    // 文末の","を変換
59    $line = ereg_replace(",$", "\n", $line);
60    return $line;
61}
62
63?>
Note: See TracBrowser for help on using the repository browser.