Changeset 18544
- Timestamp:
- 2010/02/03 15:17:02 (14 years ago)
- bzr:base-revision:
- ohkouchi@loop-az.jp-20100202103421-3rbbop6uzpfn6g0j
- bzr:committer:
- Kentaro Ohkouchi <ohkouchi@loop-az.jp>
- bzr:file-ids:
data/class/helper/SC_Helper_CSV.php 15535@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_CSV.php- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- ohkouchi@loop-az.jp-20100203061657-95zs5i4upxoc23qk
- bzr:revno:
- 2154
- bzr:revprop:branch-nick:
- branches/comu-ver2
- bzr:root:
- branches/comu-ver2
- bzr:text-parents:
data/class/helper/SC_Helper_CSV.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/comu-ver2:18234- bzr:timestamp:
- 2010-02-03 15:16:57.414999962 +0900
- bzr:user-agent:
- bzr2.0.4+bzr-svn1.0.1
- svn:original-date:
- 2010-02-03T06:16:57.415000Z
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/helper/SC_Helper_CSV.php
r18234 r18544 99 99 } 100 100 101 102 101 // CSVを送信する。(商品) 103 102 function sfDownloadProductsCsv($where, $arrval, $order) { … … 117 116 ,$arrval 118 117 ); 119 118 120 119 // 規格分類名一覧 121 120 if (in_array('classcategory_id1', $arrOutputCols) || in_array('classcategory_id2', $arrOutputCols)) { … … 125 124 126 125 $outputArray = array(); 127 126 128 127 // ヘッダ行 129 128 $outputArray[] = $arrOutput['disp_name']; 130 129 131 130 // データ行 132 131 foreach ($dataRows as $row) { … … 146 145 "category_id", 147 146 "product_id = ?", 148 array($row['product_id']));149 150 151 152 153 154 155 156 157 158 return ture;147 array($row['product_id'])); 148 } 149 150 $outputArray[] = $row; 151 } 152 153 // CSVを送信する。 154 $this->lfDownloadCsv($outputArray); 155 156 // 成功終了 157 return true; 159 158 } 160 159 … … 201 200 function sfDownloadCategoryCsv() { 202 201 203 204 205 202 // CSV出力タイトル行の作成 203 $arrOutput = SC_Utils_Ex::sfSwapArray($this->sfgetCsvOutput(5, " WHERE csv_id = 5 AND status = 1")); 204 if (count($arrOutput) <= 0) return false; // 失敗終了 206 205 $arrOutputCols = $arrOutput['col']; 207 206 … … 214 213 ,'del_flg = 0' 215 214 ); 216 215 217 216 $outputArray = array(); 218 217 219 218 // ヘッダ行 220 219 $outputArray[] = $arrOutput['disp_name']; 221 220 222 221 // データ行 223 222 foreach ($dataRows as $row) { 224 223 $outputArray[] = $row; 225 224 } 226 225 227 226 // CSVを送信する。 228 227 $this->lfDownloadCsv($outputArray, 'category'); 229 228 230 229 // 成功終了 231 return t ure;230 return true; 232 231 } 233 232 … … 254 253 function lfMakeCSV($list) { 255 254 $line = ""; 256 257 foreach($list as $key => $val) { 255 256 eset($list); 257 while(list($key, $val) = each($list)){ 258 258 $tmp = ""; 259 259 switch($key) { 260 261 262 263 264 265 266 260 case 'order_pref': 261 case 'deliv_pref': 262 $tmp = $this->arrPref[$val]; 263 break; 264 default: 265 $tmp = $val; 266 break; 267 267 } 268 268 … … 278 278 function lfMakeReviewCSV($list) { 279 279 $line = ""; 280 281 foreach($list as $key => $val){280 reset($list); 281 while(list($key, $val) = each($list)){ 282 282 $tmp = ""; 283 283 switch($key) { … … 307 307 // 各項目をCSV出力用に変換する。(トラックバック) 308 308 function lfMakeTrackbackCSV($list) { 309 310 309 $line = ""; 311 312 foreach($list as $key => $val){310 reset($list); 311 while(list($key, $val) = each($list)){ 313 312 $tmp = ""; 314 313 switch($key) { … … 404 403 ); 405 404 } 406 405 406 407 407 /** 408 408 * 1次元配列を1行のCSVとして返す … … 410 410 */ 411 411 function sfArrayToCsv($fields, $delimiter = ',', $enclosure = '"', $arrayDelimiter = '|') { 412 412 413 413 if( strlen($delimiter) != 1 ) { 414 414 trigger_error('delimiter must be a single character', E_USER_WARNING); 415 415 return ""; 416 416 } 417 417 418 418 if( strlen($enclosure) < 1 ) { 419 419 trigger_error('enclosure must be a single character', E_USER_WARNING); 420 420 return ""; 421 421 } 422 422 423 423 foreach (array_keys($fields) as $key) { 424 424 $field =& $fields[$key]; 425 425 426 426 // 配列を「|」区切りの文字列に変換する 427 427 if (is_array($field)) { 428 428 $field = implode($arrayDelimiter, $field); 429 429 } 430 430 431 431 /* enclose a field that contains a delimiter, an enclosure character, or a newline */ 432 432 if ( … … 437 437 } 438 438 } 439 439 440 440 return implode($delimiter, $fields); 441 441 } 442 442 443 443 /** 444 444 * CSVを送信する。
Note: See TracChangeset
for help on using the changeset viewer.