Exemplo n.º 1
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $objView = new SC_MobileView();
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     // パラメータ管理クラス
     $objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam($objFormParam);
     // POST値の取得
     $objFormParam->setParam($_POST);
     // 携帯端末IDが一致する会員が存在するかどうかをチェックする。
     $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // ログイン処理
     if ($_POST['mode'] == 'login') {
         $objFormParam->toLower('login_email');
         $arrErr = $objFormParam->checkError();
         $arrForm = $objFormParam->getHashArray();
         // クッキー保存判定
         if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") {
             $objCookie->setCookie('login_email', $_POST['login_email']);
         } else {
             $objCookie->setCookie('login_email', '');
         }
         if (count($arrErr) == 0) {
             if ($objCustomer->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) || $objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {
                 // ログインが成功した場合は携帯端末IDを保存する。
                 $objCustomer->updateMobilePhoneId();
                 /*
                  * email がモバイルドメインでは無く,
                  * 携帯メールアドレスが登録されていない場合
                  */
                 $objMobile = new SC_Helper_Mobile_Ex();
                 if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) {
                     if (!$objCustomer->hasValue('email_mobile')) {
                         $this->sendRedirect($this->getLocation("../entry/email_mobile.php"), true);
                         exit;
                     }
                 }
             } else {
                 $objQuery = new SC_Query();
                 $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
                 $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));
                 if ($ret > 0) {
                     SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR, "", false, "", true);
                 } else {
                     SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR, "", false, "", true);
                 }
             }
         }
     }
     /*
      * ログインチェック
      * 携帯メールの登録を必須にする場合は isLoginSuccess(false) にする
      */
     if (!$objCustomer->isLoginSuccess(true)) {
         $this->tpl_mainpage = 'mypage/login.tpl';
         $objView->assignArray($objFormParam->getHashArray());
         if (empty($arrErr)) {
             $arrErr = array();
         }
         $objView->assignArray(array("arrErr" => $arrErr));
     } else {
         //マイページトップ顧客情報表示用
         $this->CustomerName1 = $objCustomer->getvalue('name01');
         $this->CustomerName2 = $objCustomer->getvalue('name02');
     }
     $objView->assignobj($this);
     //$objpage内の全てのテンプレート変数をsmartyに格納
     $objView->display(SITE_FRAME);
     //パスとテンプレート変数の呼び出し、実行
 }
Exemplo n.º 2
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $conn = new SC_DBConn();
     $objView = new SC_MobileView();
     $objSiteSess = new SC_SiteSession();
     $objCartSess = new SC_CartSession();
     $objCustomer = new SC_Customer();
     $objCookie = new SC_Cookie();
     $this->objFormParam = new SC_FormParam();
     // フォーム用
     $helperMobile = new SC_Helper_Mobile_Ex();
     $this->lfInitParam();
     // パラメータ情報の初期化
     $this->objFormParam->setParam($_POST);
     // POST値の取得
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
     $this->tpl_uniqid = $uniqid;
     // ログインチェック
     if ($objCustomer->isLoginSuccess(true)) {
         // すでにログインされている場合は、お届け先設定画面に転送
         $this->sendRedirect($this->getLocation('./deliv.php'), true);
         exit;
     }
     // 携帯端末IDが一致する会員が存在するかどうかをチェックする。
     $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId();
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'nonmember_confirm':
             $this->lfSetNonMember($this);
             // ※breakなし
         // ※breakなし
         case 'confirm':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->objFormParam->toLower('order_mail');
             $this->objFormParam->toLower('order_mail_check');
             $this->arrErr = $this->lfCheckError();
             // 入力エラーなし
             if (count($this->arrErr) == 0) {
                 // DBへのデータ登録
                 $this->lfRegistData($uniqid);
                 // お届け先のコピー
                 $this->lfCopyDeliv($uniqid, $_POST);
                 // 正常に登録されたことを記録しておく
                 $objSiteSess->setRegistFlag();
                 // お支払い方法選択ページへ移動
                 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true);
                 exit;
             }
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             // 確認ページへ移動
             $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true);
             exit;
             break;
         case 'nonmember':
             $this->lfSetNonMember($this);
             // ※breakなし
         // ※breakなし
         default:
             if ($_GET['from'] == 'nonmember') {
                 $this->lfSetNonMember($this);
             }
             // ユーザユニークIDの取得
             $uniqid = $objSiteSess->getUniqId();
             $objQuery = new SC_Query();
             $where = "order_temp_id = ?";
             $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
             if (empty($arrRet)) {
                 $arrRet = array(array('order_email' => "", 'order_birth' => ""));
             }
             // DB値の取得
             $this->objFormParam->setParam($arrRet[0]);
             $this->objFormParam->setValue('order_email_check', $arrRet[0]['order_email']);
             $this->objFormParam->setDBDate($arrRet[0]['order_birth']);
             break;
     }
     // クッキー判定
     $this->tpl_login_email = $objCookie->getCookie('login_email');
     if ($this->tpl_login_email != "") {
         $this->tpl_login_memory = "1";
     }
     // 選択用日付の取得
     $objDate = new SC_Date(START_BIRTH_YEAR);
     $this->arrYear = $objDate->getYear('', 1950);
     // 日付プルダウン設定
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     if ($this->year == '') {
         $this->year = '----';
     }
     // 入力値の取得
     $this->arrForm = $this->objFormParam->getFormParamList();
     if ($this->arrForm['year']['value'] == "") {
         $this->arrForm['year']['value'] = '----';
     }
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }