Source for file LC_Page_InputZip.php
Documentation is available at LC_Page_InputZip.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_InputZip.php 18734 2010-06-22 08:45:33Z nanasess $
$this->tpl_message = "住所を検索しています。";
$conn = new SC_DBconn(ZIP_DSN);
$this->tpl_start = "window.close();";
$zipcode = $_GET['zip1']. $_GET['zip2'];
$zipcode = mb_convert_kana($zipcode ,"n");
$sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
$data_list = $conn->getAll($sqlse, array($zipcode));
if (empty($data_list)) $data_list = array();
$masterData = new SC_DB_MasterData_Ex();
$arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
if (!empty($data_list)) {
$this->tpl_state = isset ($arrREV_PREF[$data_list[0]['state']])
? $arrREV_PREF[$data_list[0]['state']] : "";
$this->tpl_city = isset ($data_list[0]['city']) ? $data_list[0]['city'] : "";
$town = isset ($data_list[0]['town']) ? $data_list[0]['town'] : "";
総務省からダウンロードしたデータをそのままインポートすると
$func = "fnPutAddress('" . $_GET['input1'] . "','" . $_GET['input2']. "');";
$this->tpl_start = "window.close();";
$this->tpl_message = "該当する住所が見つかりませんでした。";
$objView->assignobj($this);
$objView->display("input_zip.tpl");
$objErr->doFunc( array("郵便番号1",'zip1',ZIP01_LEN ) ,array( "NUM_COUNT_CHECK" ) );
$objErr->doFunc( array("郵便番号2",'zip2',ZIP02_LEN ) ,array( "NUM_COUNT_CHECK" ) );
// 親ウィンドウの戻り値を格納するinputタグのnameのエラーチェック
$objErr->arrErr['input1'] = "※ 入力形式が不正です。<br />";
$objErr->arrErr['input2'] = "※ 入力形式が不正です。<br />";
* @return エラーなし:true エラー:false
// 半角英数字と_(アンダーバー)以外の文字を使用していたらエラー
if(strlen($value) > 0 && !ereg("^[a-zA-Z0-9_]+$", $value)) {
Documentation generated on Fri, 24 Feb 2012 13:59:28 +0900 by Seasoft
|