- Timestamp:
- 2009/10/29 21:10:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/entry/LC_Page_Entry.php
r18353 r18355 469 469 470 470 if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") { 471 $address = $this->lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);471 $address = SC_Utils_Ex::sfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']); 472 472 $this->pref = @$address[0]['state']; 473 473 $this->addr01 = @$address[0]['city'] . @$address[0]['town']; … … 836 836 // {{{ mobile functions 837 837 838 // 郵便番号から住所の取得839 function lfGetAddress($zipcode) {840 841 $conn = new SC_DBconn(ZIP_DSN);842 843 // 郵便番号検索文作成844 $zipcode = mb_convert_kana($zipcode ,"n");845 $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";846 847 $data_list = $conn->getAll($sqlse, array($zipcode));848 849 // インデックスと値を反転させる。850 $arrREV_PREF = array_flip($this->arrPref);851 852 /*853 総務省からダウンロードしたデータをそのままインポートすると854 以下のような文字列が入っているので 対策する。855 ・(1・19丁目)856 ・以下に掲載がない場合857 */858 $town = $data_list[0]['town'];859 $town = ereg_replace("(.*)$","",$town);860 $town = ereg_replace("以下に掲載がない場合","",$town);861 $data_list[0]['town'] = $town;862 $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];863 864 return $data_list;865 }866 867 838 //---- 入力エラーチェック 868 839 function lfErrorCheck1($array) {
Note: See TracChangeset
for help on using the changeset viewer.