Changeset 15078 for branches/feature-module-update/html/input_zip.php
- Timestamp:
- 2007/07/20 15:58:59 (17 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update
-
Property
svn:ignore
set to
.cache
.settings
.projectOptions
-
Property
svn:ignore
set to
-
branches/feature-module-update/html/input_zip.php
r12157 r15078 15 15 var $tpl_message; 16 16 function CPage() { 17 $this->tpl_message = " ½»½ê¤ò¸¡º÷¤·¤Æ¤¤¤Þ¤¹¡£";17 $this->tpl_message = "住所を検索しています。"; 18 18 } 19 19 } … … 23 23 $objView = new SC_SiteView(false); 24 24 25 // ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯25 // 入力エラーチェック 26 26 $arrErr = fnErrorCheck(); 27 27 28 // ÆþÎÏ¥¨¥é¡¼¤Î¾ì¹ç¤Ï½ªÎ»28 // 入力エラーの場合は終了 29 29 if(count($arrErr) > 0) { 30 30 $objPage->tpl_start = "window.close();"; 31 31 } 32 32 33 // ͹ÊØÈֹ渡º÷ʸºîÀ®33 // 郵便番号検索文作成 34 34 $zipcode = $_GET['zip1'].$_GET['zip2']; 35 35 $zipcode = mb_convert_kana($zipcode ,"n"); … … 38 38 $data_list = $conn->getAll($sqlse, array($zipcode)); 39 39 40 // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£40 // インデックスと値を反転させる。 41 41 $arrREV_PREF = array_flip($arrPref); 42 42 … … 45 45 $town = $data_list[0]['town']; 46 46 /* 47 Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È48 °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç Âкö¤¹¤ë¡£49 ¡¦¡Ê£±¢·£±£¹ÃúÌÜ¡Ë50 ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç47 総務省からダウンロードしたデータをそのままインポートすると 48 以下のような文字列が入っているので 対策する。 49 ・(1~19丁目) 50 ・以下に掲載がない場合 51 51 */ 52 $town = ereg_replace(" ¡Ê.*¡Ë$","",$town);53 $town = ereg_replace(" °Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);52 $town = ereg_replace("(.*)$","",$town); 53 $town = ereg_replace("以下に掲載がない場合","",$town); 54 54 $objPage->tpl_town = $town; 55 55 56 // ͹ÊØÈֹ椬ȯ¸«¤µ¤ì¤¿¾ì¹ç56 // 郵便番号が発見された場合 57 57 if(count($data_list) > 0) { 58 58 $func = "fnPutAddress('" . $_GET['input1'] . "','" . $_GET['input2']. "');"; … … 60 60 $objPage->tpl_start = "window.close();"; 61 61 } else { 62 $objPage->tpl_message = " ³ºÅö¤¹¤ë½»½ê¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£";62 $objPage->tpl_message = "該当する住所が見つかりませんでした。"; 63 63 } 64 64 65 /* ¥Ú¡¼¥¸¤Îɽ¼¨¡¡*/65 /* ページの表示 */ 66 66 $objView->assignobj($objPage); 67 67 $objView->display("input_zip.tpl"); 68 68 69 /* ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯*/69 /* 入力エラーのチェック */ 70 70 function fnErrorCheck() { 71 // ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ÇÛÎó¤Î½é´ü²½71 // エラーメッセージ配列の初期化 72 72 $objErr = new SC_CheckError(); 73 73 74 // ͹ÊØÈÖ¹æ75 $objErr->doFunc( array(" ͹ÊØÈÖ¹æ1",'zip1',ZIP01_LEN ) ,array( "NUM_COUNT_CHECK" ) );76 $objErr->doFunc( array(" ͹ÊØÈÖ¹æ2",'zip2',ZIP02_LEN ) ,array( "NUM_COUNT_CHECK" ) );74 // 郵便番号 75 $objErr->doFunc( array("郵便番号1",'zip1',ZIP01_LEN ) ,array( "NUM_COUNT_CHECK" ) ); 76 $objErr->doFunc( array("郵便番号2",'zip2',ZIP02_LEN ) ,array( "NUM_COUNT_CHECK" ) ); 77 77 78 78 return $objErr->arrErr;
Note: See TracChangeset
for help on using the changeset viewer.