- Timestamp:
- 2009/06/27 20:22:50 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/mypage/LC_Page_Mypage_Change.php
r18083 r18139 272 272 ); 273 273 274 //---- 登録除外用カラム配列275 $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02");276 277 274 $this->arrForm = $this->lfGetCustomerData(); 278 275 $this->arrForm['password'] = DEFAULT_PASSWORD; … … 282 279 //-- POSTデータの引き継ぎ 283 280 $this->arrForm = array_merge($this->arrForm, $_POST); 284 285 if (!isset($this->arrForm['year'])) $this->arrForm['year'] = "";286 if($this->arrForm['year'] == '----') {287 $this->arrForm['year'] = '';288 }289 290 // emailはすべて小文字で処理291 $this->paramToLower($_POST );292 281 293 282 //-- 入力データの変換 … … 431 420 */ 432 421 function checkErrorTotal(&$arrRegistColumn, &$arrMailType, $isMobile = false) { 433 //-- 入力データの変換 434 $this->arrForm = $_POST; 435 $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); 436 437 // emailはすべて小文字で処理 438 $this->paramToLower($arrRegistColumn); 422 // 入力データの変換 423 $this->arrForm = $this->lfConvertParam($_POST, $arrRegistColumn); 439 424 440 425 //エラーチェック … … 541 526 $val =& $array[$key]; 542 527 528 // string 型以外は変換対象外とする 529 if (!is_string($val)) continue; 530 543 531 // 文字変換 544 // XXX 文字列のみを変換するようにした方が良い気もする。545 532 if (strlen($val) > 0) { 546 533 $val = mb_convert_kana($val ,$mb_convert_kana_option); 534 } 535 536 // メールアドレスは小文字に変換 537 if ($key == 'email' || $key == 'email02' || $key == 'email_mobile' || $key == 'email_mobile02') { 538 $val = strtolower($val); 547 539 } 548 540 } … … 630 622 // }}} 631 623 // {{{ mobile functions 632 633 /**634 * TODO635 * @deprecated 未使用?636 */637 function lfRegistDataMobile ($array, $arrRegistColumn,638 $arrRejectRegistColumn) {639 640 // 仮登録641 foreach ($arrRegistColumn as $data) {642 if (strlen($array[ $data["column"] ]) > 0 && ! in_array($data["column"], $arrRejectRegistColumn)) {643 $arrRegist[ $data["column"] ] = $array[ $data["column"] ];644 }645 }646 647 // 誕生日が入力されている場合648 if (strlen($array["year"]) > 0 ) {649 $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";650 }651 652 // パスワードの暗号化653 $arrRegist["password"] = sha1($arrRegist["password"] . ":" . AUTH_MAGIC);654 655 $count = 1;656 while ($count != 0) {657 $uniqid = SC_Utils_Ex::sfGetUniqRandomId("t");658 $count = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($uniqid));659 }660 661 $arrRegist["secret_key"] = $uniqid; // 仮登録ID発行662 $arrRegist["create_date"] = "now()"; // 作成日663 $arrRegist["update_date"] = "now()"; // 更新日664 $arrRegist["first_buy_date"] = ""; // 最初の購入日665 666 667 //-- 仮登録実行668 $this->objQuery->insert("dtb_customer", $arrRegist);669 670 return $uniqid;671 }672 673 624 674 625 //エラーチェック … … 777 728 return $objErr->arrErr; 778 729 } 779 780 // 郵便番号から住所の取得781 function lfGetAddress($zipcode) {782 global $arrPref;783 784 $conn = new SC_DBconn(ZIP_DSN);785 786 // 郵便番号検索文作成787 $zipcode = mb_convert_kana($zipcode ,"n");788 $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";789 790 $data_list = $conn->getAll($sqlse, array($zipcode));791 792 // インデックスと値を反転させる。793 $arrREV_PREF = array_flip($arrPref);794 795 /*796 総務省からダウンロードしたデータをそのままインポートすると797 以下のような文字列が入っているので 対策する。798 ・(1・19丁目)799 ・以下に掲載がない場合800 */801 $town = $data_list[0]['town'];802 $town = ereg_replace("(.*)$","",$town);803 $town = ereg_replace("以下に掲載がない場合","",$town);804 $data_list[0]['town'] = $town;805 $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];806 807 return $data_list;808 }809 810 //顧客情報の取得811 function lfGetCustomerDataMobile(){812 813 //顧客情報取得814 $ret = $this->objQuery->select("*","dtb_customer","customer_id=?", array($this->objCustomer->getValue('customer_id')));815 $arrForm = $ret[0];816 //$arrForm['email'] = $arrForm['email_mobile'];817 818 //メルマガフラグ取得819 // TODO たぶん未使用820 $arrForm['mailmaga_flg'] = $this->objQuery->get("dtb_customer","mailmaga_flg","email_mobile=?", array($this->objCustomer->getValue('email_mobile')));821 822 //誕生日の年月日取得823 if (isset($arrForm['birth'])){824 $birth = split(" ", $arrForm["birth"]);825 list($year, $month, $day) = split("-",$birth[0]);826 827 $arrForm['year'] = $year;828 $arrForm['month'] = $month;829 $arrForm['day'] = $day;830 831 }832 return $arrForm;833 }834 835 /**836 * フォームパラメータの内容を小文字に変換する.837 *838 * @param array $arrParam パラメータ名の配列839 * @return void840 */841 function paramToLower(&$arrParam) {842 foreach ($arrParam as $key => $val) {843 if (!isset($val)) {844 $this->arrForm[$key] = "";845 }elseif($key == 'email' || $key == 'email_mobile'){846 $this->arrForm[$key] = strtolower($val);847 }848 }849 }850 730 } 851 731 ?>
Note: See TracChangeset
for help on using the changeset viewer.