source: temp/trunk/html/admin/order/index_csv.php @ 1328

Revision 1328, 1.2 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(ROOT_DIR."data/include/csv_output.inc");
3/*------  /admin/contents/inpuiry.php ¤«¤é¤â¸Æ¤Ó½Ð¤·¤Þ¤¹¡£(11/18 fukuda) ---*/
4
5// CSV½ÐÎϥǡ¼¥¿¤òºîÀ®¤¹¤ë¡£
6function lfGetCSV($from, $where, $option, $arrval, $arrCsvOutputCols = "") {
7    global $arrCVSCOL;
8
9    //$cols = sfGetCommaList($arrCVSCOL);
10    $cols = sfGetCommaList($arrCsvOutputCols);
11   
12    $objQuery = new SC_Query();
13    $objQuery->setoption($option);
14   
15    $list_data = $objQuery->select($cols, $from, $where, $arrval); 
16
17    $max = count($list_data);
18    for($i = 0; $i < $max; $i++) {
19        // ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£
20        $data .= lfMakeCSV($list_data[$i]);
21    }
22    return $data;
23}
24
25// ³Æ¹àÌܤòCSV½ÐÎÏÍѤËÊÑ´¹¤¹¤ë¡£
26function lfMakeCSV($list) {
27    global $arrPref;
28    global $arrJob;
29    global $arrORDERSTATUS;
30   
31    $line = "";
32   
33    foreach($list as $key => $val) {
34        $tmp = "";
35        switch($key) {
36        case 'order_pref':
37            $tmp = $arrPref[$val];
38            break;
39        case 'order_job':
40            $tmp = $arrJob[$val];
41            break;
42        case 'status':
43            $tmp = $arrORDERSTATUS[$val];
44            break;
45        default:
46            $tmp = $val;
47            break;
48        }
49
50        $tmp = ereg_replace("[\",]", " ", $tmp);
51        $line .= "\"".$tmp."\",";
52    }
53    // ʸËö¤Î","¤òÊÑ´¹
54    $line = ereg_replace(",$", "\n", $line);
55    return $line;
56}
57
58?>
Note: See TracBrowser for help on using the repository browser.