Changeset 17343 for branches/version-2
- Timestamp:
- 2008/06/03 20:26:52 (14 years ago)
- Location:
- branches/version-2/data/class
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php
r16582 r17343 148 148 $header .= "\n"; 149 149 150 $data = $this->lfGetCSVData($arrCsvOutputData, $arrKey);150 $data = SC_Utils_Ex::getCSVData($arrCsvOutputData, $arrKey); 151 151 // CSV出力 152 152 SC_Utils_Ex::sfCSVDownload($header.$data); … … 411 411 return $ret; 412 412 } 413 414 415 //---- CSV出力用データ取得416 function lfGetCSVData( $array, $arrayIndex){417 $return = "";418 for ($i=0; $i<count($array); $i++){419 for ($j=0; $j<count($array[$i]); $j++ ){420 if ( $j > 0 ) $return .= ",";421 $return .= "\"";422 if ( $arrayIndex ){423 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$arrayIndex[$j]] )) ."\"";424 } else {425 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$j] )) ."\"";426 }427 }428 $return .= "\n";429 }430 431 return $return;432 }433 413 } 434 414 ?> -
branches/version-2/data/class/pages/admin/customer/LC_Page_Admin_Customer.php
r17214 r17343 275 275 276 276 //- CSV出力 277 $data = $this->lfGetCSVData($this->search_data, $arrColumn);277 $data = SC_Utils_Ex::getCSVData($this->search_data, $arrColumn); 278 278 279 279 SC_Utils_Ex::sfCSVDownload($header.$data); … … 491 491 } 492 492 } 493 494 //---- CSV出力用データ取得495 function lfGetCSVData( $array, $arrayIndex){496 497 for ($i=0; $i<count($array); $i++){498 499 for ($j=0; $j<count($array[$i]); $j++ ){500 if ( $j > 0 ) $return .= ",";501 $return .= "\"";502 if ( $arrayIndex ){503 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$arrayIndex[$j]] )) ."\"";504 } else {505 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$j] )) ."\"";506 }507 }508 $return .= "\n";509 }510 511 return $return;512 }513 493 } 514 494 ?> -
branches/version-2/data/class/pages/admin/mail/LC_Page_Admin_Mail.php
r16741 r17343 425 425 426 426 if ( $result ){ 427 $return = $this->lfGetCSVData( $result, $arrTitle); 428 } 429 return $return; 430 } 431 432 //---- CSV出力用データ取得 433 function lfGetCSVData( $array, $arrayIndex){ 434 435 for ($i=0; $i<count($array); $i++){ 436 437 for ($j=0; $j<count($array[$i]); $j++ ){ 438 if ( $j > 0 ) $return .= ","; 439 $return .= "\""; 440 if ( $arrayIndex ){ 441 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$arrayIndex[$j]] )) ."\""; 442 } else { 443 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$j] )) ."\""; 444 } 445 } 446 $return .= "\n"; 427 $return = SC_Utils_Ex::getCSVData( $result, $arrTitle); 447 428 } 448 429 return $return; -
branches/version-2/data/class/util/SC_Utils.php
r17229 r17343 1922 1922 1923 1923 /** 1924 * CSV出力用データ取得 1925 * 1926 * @return string 1927 */ 1928 function getCSVData($array, $arrayIndex) { 1929 for ($i = 0; $i < count($array); $i++){ 1930 // インデックスが設定されている場合 1931 if (is_array($arrayIndex) && 0 < count($arrayIndex)){ 1932 for ($j = 0; $j < count($arrayIndex); $j++ ){ 1933 if ( $j > 0 ) $return .= ","; 1934 $return .= "\""; 1935 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$arrayIndex[$j]] )) ."\""; 1936 } 1937 } else { 1938 for ($j = 0; $j < count($array[$i]); $j++ ){ 1939 if ( $j > 0 ) $return .= ","; 1940 $return .= "\""; 1941 $return .= mb_ereg_replace("<","<",mb_ereg_replace( "\"","\"\"",$array[$i][$j] )) ."\""; 1942 } 1943 } 1944 $return .= "\n"; 1945 } 1946 return $return; 1947 } 1948 1949 /** 1924 1950 * 配列をテーブルタグで出力する。 1925 1951 *
Note: See TracChangeset
for help on using the changeset viewer.