- Timestamp:
- 2011/01/18 20:06:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage.php
r19915 r19959 50 50 parent::init(); 51 51 $this->tpl_title = 'MYページ'; 52 $this->tpl_subtitle = '購入履歴一覧'; 52 if (Net_UserAgent_Mobile::isMobile() === true){ 53 $this->tpl_subtitle = 'MYページ'; 54 } else { 55 $this->tpl_subtitle = '購入履歴一覧'; 56 } 53 57 $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl'; 54 58 $this->tpl_mainno = 'mypage'; … … 64 68 function process() { 65 69 parent::process(); 66 if (Net_UserAgent_Mobile::isMobile() === true){ 67 $this->mobileAction(); 68 } else { 69 $this->action(); 70 } 70 $this->action(); 71 71 $this->sendResponse(); 72 72 } … … 83 83 84 84 // 退会判定用情報の取得 85 $this->tpl_login = $objCustomer->isLoginSuccess( );85 $this->tpl_login = $objCustomer->isLoginSuccess(true); 86 86 87 87 // ログインチェック 88 if(!$objCustomer->isLoginSuccess( )) {88 if(!$objCustomer->isLoginSuccess(true)) { 89 89 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 90 90 }else { … … 109 109 $this->tpl_linemax = $linemax; 110 110 111 // ページ送りの取得 112 $objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX); 113 $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 114 $startno = $objNavi->start_row; 111 if (Net_UserAgent_Mobile::isMobile() === true){ 112 define ("HISTORY_NUM", 5); // TODO 113 $pageNo = isset($_GET['pageno']) ? (int) $_GET['pageno'] : 0; // TODO 115 114 116 // 取得範囲の指定(開始行番号、行数のセット) 117 $objQuery->setLimitOffset(SEARCH_PMAX, $startno); 115 // ページ送りの取得 116 // next 117 if ($pageNo + HISTORY_NUM < $linemax) { 118 $next = "<a href='index.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>次へ→</a>"; 119 } else { 120 $next = ""; 121 } 122 123 // previous 124 if ($pageNo - HISTORY_NUM > 0) { 125 $previous = "<a href='index.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>←前へ</a>"; 126 } elseif ($pageNo == 0) { 127 $previous = ""; 128 } else { 129 $previous = "<a href='index.php?pageno=0'>←前へ</a>"; 130 } 131 132 // bar 133 if ($next != '' && $previous != '') { 134 $bar = " | "; 135 } else { 136 $bar = ""; 137 } 138 139 $this->tpl_strnavi = $previous . $bar . $next; 140 141 // 取得範囲の指定(開始行番号、行数のセット) 142 $objQuery->setLimitOffset(HISTORY_NUM, $pageNo); 143 } else { 144 // ページ送りの取得 145 $objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX); 146 $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 147 $startno = $objNavi->start_row; 148 149 // 取得範囲の指定(開始行番号、行数のセット) 150 $objQuery->setLimitOffset(SEARCH_PMAX, $startno); 151 } 152 118 153 // 表示順序 119 154 $objQuery->setOrder($order); … … 126 161 $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); 127 162 128 }129 130 /**131 * Page のAction(モバイル).132 *133 * @return void134 */135 function mobileAction() {136 $objQuery = new SC_Query();137 $objCustomer = new SC_Customer();138 // クッキー管理クラス139 $objCookie = new SC_Cookie(COOKIE_EXPIRE);140 // パラメータ管理クラス141 $objFormParam = new SC_FormParam();142 // パラメータ情報の初期化143 $this->lfInitParam($objFormParam);144 // POST値の取得145 $objFormParam->setParam($_POST);146 147 // 携帯端末IDが一致する会員が存在するかどうかをチェックする。148 $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();149 150 if (!isset($_POST['mode'])) $_POST['mode'] = "";151 152 // ログイン処理153 if($_POST['mode'] == 'login') {154 $objFormParam->toLower('login_email');155 $arrErr = $objFormParam->checkError();156 $arrForm = $objFormParam->getHashArray();157 158 // クッキー保存判定159 if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") {160 $objCookie->setCookie('login_email', $_POST['login_email']);161 } else {162 $objCookie->setCookie('login_email', '');163 }164 165 if (count($arrErr) == 0){166 if($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) ||167 $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {168 // ログインが成功した場合は携帯端末IDを保存する。169 $objCustomer->updateMobilePhoneId();170 171 /*172 * email がモバイルドメインでは無く,173 * 携帯メールアドレスが登録されていない場合174 */175 $objMobile = new SC_Helper_Mobile_Ex();176 if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {177 if (!$objCustomer->hasValue('email_mobile')) {178 SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php');179 exit;180 }181 }182 } else {183 $objQuery = new SC_Query;184 $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";185 $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));186 187 if($ret > 0) {188 SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);189 } else {190 SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);191 }192 }193 }194 }195 196 /*197 * ログインチェック198 * 携帯メールの登録を必須にする場合は isLoginSuccess(false) にする199 */200 if(!$objCustomer->isLoginSuccess(true)) {201 $this->tpl_mainpage = 'mypage/login.tpl';202 foreach ($objFormParam->getHashArray() as $key => $val) {203 $this->$key = $val;204 }205 if (empty($arrErr)) $arrErr = array();206 $this->arrErr = $arrErr;207 }else {208 //マイページトップ顧客情報表示用209 $this->CustomerName1 = $objCustomer->getvalue('name01');210 $this->CustomerName2 = $objCustomer->getvalue('name02');211 $this->CustomerPoint = $objCustomer->getvalue('point');212 }213 163 } 214 164
Note: See TracChangeset
for help on using the changeset viewer.