Changeset 18357
- Timestamp:
- 2009/10/30 19:40:52 (17 years ago)
- Location:
- branches/comu-ver2
- Files:
-
- 3 edited
-
data/Smarty/templates/default/site_frame.tpl (modified) (1 diff)
-
data/class/pages/LC_Page_InputZip.php (modified) (4 diffs)
-
html/user_data/packages/default/js/site.js (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/Smarty/templates/default/site_frame.tpl
r18254 r18357 32 32 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/win_op.js"></script> 33 33 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/site.js"></script> 34 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/jquery-1.3.2.min.js"></script> 34 35 <title><!--{$arrSiteInfo.shop_name|escape}--><!--{if $tpl_subtitle|strlen >= 1}--> / <!--{$tpl_subtitle|escape}--><!--{elseif $tpl_title|strlen >= 1}--> / <!--{$tpl_title|escape}--><!--{/if}--></title> 35 36 <!--{if $arrPageLayout.author|strlen >= 1}--> -
branches/comu-ver2/data/class/pages/LC_Page_InputZip.php
r18355 r18357 59 59 // 入力エラーの場合は終了 60 60 if(count($arrErr) > 0) { 61 $this->tpl_start = "window.close();"; 62 SC_Utils::sfDispSiteError(CUSTOMER_ERROR); 61 $tpl_message = ""; 62 foreach($arrErr as $key => $val) { 63 $tpl_message .= preg_replace("/<br \/>/", "\n", $val); 64 } 65 echo $tpl_message; 66 67 // エラー無し 68 } else { 69 // 郵便番号検索文作成 70 $zipcode = $_GET['zip1'].$_GET['zip2']; 71 $zipcode = mb_convert_kana($zipcode ,"n"); 72 73 // 郵便番号検索 74 $data_list = SC_Utils_Ex::sfGetAddress($zipcode); 75 76 // 郵便番号が発見された場合 77 if(!empty($data_list)) { 78 $data = $data_list[0]['state']. "|". $data_list[0]['city']. "|". $data_list[0]['town']; 79 echo $data; 80 81 // 該当無し 82 } else { 83 echo "該当する住所が見つかりませんでした。"; 84 } 63 85 } 64 65 // 郵便番号検索文作成66 $zipcode = $_GET['zip1'].$_GET['zip2'];67 68 $data_list = SC_Utils_Ex::sfGetAddress($zipcode);69 70 // 郵便番号が発見された場合71 if(!empty($data_list)) {72 $this->tpl_state = $data_list[0]['state'];73 $this->tpl_city = $data_list[0]['city'];74 $this->tpl_town = $data_list[0]['town'];75 76 $func = "fnPutAddress('" . $_GET['input1'] . "','" . $_GET['input2']. "');";77 $this->tpl_onload = "$func";78 $this->tpl_start = "window.close();";79 } else {80 $this->tpl_message = "該当する住所が見つかりませんでした。";81 }82 83 /* ページの表示 */84 $objView->assignobj($this);85 $objView->display("input_zip.tpl");86 86 } 87 87 … … 97 97 98 98 /* 入力エラーのチェック */ 99 function fnErrorCheck( ) {99 function fnErrorCheck($array) { 100 100 // エラーメッセージ配列の初期化 101 101 $objErr = new SC_CheckError($array); 102 102 103 103 // 郵便番号 104 $objErr->doFunc( array("郵便番号1",'zip1',ZIP01_LEN ) ,array( "NUM_COUNT_CHECK" ) );105 $objErr->doFunc( array("郵便番号2",'zip2',ZIP02_LEN ) ,array( "NUM_COUNT_CHECK" ) );104 $objErr->doFunc( array("郵便番号1",'zip1',ZIP01_LEN ) ,array( "NUM_COUNT_CHECK", "NUM_CHECK" ) ); 105 $objErr->doFunc( array("郵便番号2",'zip2',ZIP02_LEN ) ,array( "NUM_COUNT_CHECK", "NUM_CHECK" ) ); 106 106 // 親ウィンドウの戻り値を格納するinputタグのnameのエラーチェック 107 107 if (!$this->lfInputNameCheck($array['input1'])) { … … 114 114 return $objErr->arrErr; 115 115 } 116 117 /**118 * エラーチェック119 *120 * @param string $value121 * @return エラーなし:true エラー:false122 */116 117 /** 118 * エラーチェック 119 * 120 * @param string $value 121 * @return エラーなし:true エラー:false 122 */ 123 123 function lfInputNameCheck($value) { 124 124 // 半角英数字と_(アンダーバー)以外の文字を使用していたらエラー … … 126 126 return false; 127 127 } 128 128 129 129 return true; 130 130 } 131 132 131 } 133 132 ?> -
branches/comu-ver2/html/user_data/packages/default/js/site.js
r18257 r18357 36 36 // 郵便番号入力呼び出し. 37 37 function fnCallAddress(php_url, tagname1, tagname2, input1, input2) { 38 zip1 = document.form1[tagname1].value; 39 zip2 = document.form1[tagname2].value; 40 41 if(zip1.length == 3 && zip2.length == 4) { 42 url = php_url + "?zip1=" + zip1 + "&zip2=" + zip2 + "&input1=" + input1 + "&input2=" + input2; 43 window.open(url,"nomenu","width=500,height=350,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 44 } else { 45 alert("郵便番号を正しく入力して下さい。"); 38 zip1 = document.form1[tagname1].value; 39 zip2 = document.form1[tagname2].value; 40 41 if(zip1.length == 3 && zip2.length == 4) { 42 $.get( 43 php_url, 44 {zip1: zip1, zip2: zip2, input1: input1, input2: input2}, 45 function(data) { 46 arrdata = data.split("|"); 47 if (arrdata.length > 1) { 48 fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]); 49 } else { 50 alert(data); 51 } 52 } 53 ); 54 } else { 55 alert("郵便番号を正しく入力して下さい。"); 46 56 } 47 57 } 48 58 49 59 // 郵便番号から検索した住所を渡す. 50 function fnPutAddress(input1, input2) { 51 // 親ウィンドウの存在確認。. 52 if(fnIsopener()) { 53 if(document.form1['state'].value != "") { 54 // 項目に値を入力する. 55 state_id = document.form1['state'].value; 56 town = document.form1['city'].value + document.form1['town'].value; 57 window.opener.document.form1[input1].selectedIndex = state_id; 58 window.opener.document.form1[input2].value = town; 59 } 60 } else { 61 window.close(); 62 } 60 function fnPutAddress(input1, input2, state, city, town) { 61 if(state != "") { 62 // 項目に値を入力する. 63 document.form1[input1].selectedIndex = state; 64 document.form1[input2].value = city + town; 65 } 63 66 } 64 67 … … 79 82 // セレクトボックスに項目を割り当てる. 80 83 function fnSetSelect(name1, name2, val) { 81 sele1 = document.form1[name1]; 84 sele1 = document.form1[name1]; 82 85 sele2 = document.form1[name2]; 83 86 84 87 if(sele1 && sele2) { 85 88 index=sele1.selectedIndex; 86 87 // セレクトボックスのクリア 89 90 // セレクトボックスのクリア 88 91 count=sele2.options.length 89 92 for(i = count; i >= 0; i--) { 90 93 sele2.options[i]=null; 91 94 } 92 95 93 96 // セレクトボックスに値を割り当てる。 94 97 len = lists[index].length … … 163 166 return; 164 167 } 165 break; 168 break; 166 169 default: 167 170 break; … … 214 217 'use_point' 215 218 ); 216 219 217 220 if(!document.form1['point_check'][0].checked) { 218 221 color = "#dddddd"; … … 222 225 flag = false; 223 226 } 224 227 225 228 len = list.length 226 229 for(i = 0; i < len; i++) { … … 253 256 'deliv_tel03' 254 257 ); 255 258 256 259 if(!document.form1['deliv_check'].checked) { 257 260 fnChangeDisabled(list, '#dddddd'); … … 286 289 function fnChangeDisabled(list, color) { 287 290 len = list.length; 288 291 289 292 for(i = 0; i < len; i++) { 290 293 if(document.form1[list[i]]) { … … 297 300 document.form1[list[i]].disabled = true; 298 301 g_savecolor[list[i]] = document.form1[list[i]].style.backgroundColor; 299 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 300 } 302 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 303 } 301 304 } 302 305 } … … 307 310 function fnCheckLogin(formname) { 308 311 var lstitem = new Array(); 309 312 310 313 if(formname == 'login_mypage'){ 311 314 lstitem[0] = 'mypage_login_email'; … … 318 321 var errflg = false; 319 322 var cnt = 0; 320 323 321 324 // 必須項目のチェック 322 325 for(cnt = 0; cnt < max; cnt++) { … … 326 329 } 327 330 } 328 329 // 必須項目が入力されていない場合 331 332 // 必須項目が入力されていない場合 330 333 if(errflg == true) { 331 334 alert('メールアドレス/パスワードを入力して下さい。'); … … 333 336 } 334 337 } 335 338 336 339 // 時間の計測. 337 340 function fnPassTime(){ … … 349 352 } else { 350 353 window.close(); 351 } 354 } 352 355 } 353 356 … … 371 374 // テキストエリアのサイズを変更する. 372 375 function ChangeSize(button, TextArea, Max, Min, row_tmp){ 373 376 374 377 if(TextArea.rows <= Min){ 375 378 TextArea.rows=Max; button.value="小さくする"; row_tmp.value=Max;
Note: See TracChangeset
for help on using the changeset viewer.
