/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // ログイン判定 if ($objCustomer->isLoginSuccess()) { $this->sendRedirect($this->getLocation("./index.php")); exit; } else { // クッキー判定 $this->tpl_login_email = $objCookie->getCookie('login_email'); if ($this->tpl_login_email != "") { $this->tpl_login_memory = "1"; } // POSTされてきたIDがある場合は優先する。 if (isset($_POST['mypage_login_email']) && $_POST['mypage_login_email'] != "") { $this->tpl_login_email = $_POST['mypage_login_email']; } } //$objpage内の全てのテンプレート変数をsmartyに格納 $objView->assignobj($this); //パスとテンプレート変数の呼び出し、実行 $objView->display(SITE_FRAME); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $objDb = new SC_Helper_DB_Ex(); //不正アクセス判定 $from = "dtb_order"; $where = "del_flg = 0 AND customer_id = ? AND order_id = ? "; $arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']); //DBに情報があるか判定 $cnt = $objQuery->count($from, $where, $arrval); //ログインしていない、またはDBに情報が無い場合 if (!$objCustomer->isLoginSuccess(true) or $cnt == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } else { //受注詳細データの取得 $this->arrDisp = $this->lfGetOrderData($_POST['order_id']); // 支払い方法の取得 $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); // 配送時間の取得 $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']); $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time'); //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス. * * @return void */ function process() { $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // ログイン判定 if ($objCustomer->isLoginSuccess()) { $this->tpl_login = true; $this->tpl_user_point = $objCustomer->getValue('point'); $this->tpl_name1 = $objCustomer->getValue('name01'); $this->tpl_name2 = $objCustomer->getValue('name02'); } else { // クッキー判定 $this->tpl_login_email = $objCookie->getCookie('login_email'); if ($this->tpl_login_email != "") { $this->tpl_login_memory = "1"; } // POSTされてきたIDがある場合は優先する。 if ($_POST['login_email'] != "") { $this->tpl_login_email = $_POST['login_email']; } } $this->tpl_disable_logout = $this->lfCheckDisableLogout(); $objSubView = new SC_SiteView(); $this->transactionid = $this->getToken(); $objSubView->assignobj($this); $objSubView->display($this->tpl_mainpage); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $conn = new SC_DBConn(); $objCustomer = new SC_Customer(); $objView = new SC_MobileView(); $objView->assign("isLogin", $objCustomer->isLoginSuccess(true)); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のアクション. * * @return void */ function action() { $objCustomer = new SC_Customer(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->arrErr = $this->lfCheckError($objFormParam); if (empty($this->arrErr)) { $email_mobile = $this->lfRegistEmailMobile(strtolower($objFormParam->getValue('email_mobile')), $objCustomer->getValue('customer_id')); $objCustomer->setValue('email_mobile', $email_mobile); $this->tpl_mainpage = 'entry/email_mobile_complete.tpl'; $this->tpl_title = '携帯メール登録完了'; } } $this->tpl_name = $objCustomer->getValue('name01'); $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のプロセス. * * @return void */ function process() { $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); //パスワード・Eメールにある空白をトリム $_POST["mypage_login_email"] = trim($_POST["mypage_login_email"]); $_POST["mypage_login_pass"] = trim($_POST["mypage_login_pass"]); //認証用 $_POST["mypage_login_pass1"] = trim($_POST["mypage_login_pass"]); //最小桁数比較用 $_POST["mypage_login_pass2"] = trim($_POST["mypage_login_pass"]); //最大桁数比較用 // POST値の取得 $this->objFormParam->setParam($_POST); if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } switch ($_POST['mode']) { case 'login': $this->objFormParam->toLower('mypage_login_email'); $arrErr = $this->objFormParam->checkError(); // エラーの場合はエラー画面に遷移 if (count($arrErr) > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); } $arrForm = $this->objFormParam->getHashArray(); // クッキー保存判定 if ($arrForm['mypage_login_memory'] == "1" && $arrForm['mypage_login_email'] != "") { $objCookie->setCookie('login_email', $_POST['mypage_login_email']); } else { $objCookie->setCookie('login_email', ''); } if ($objCustomer->getCustomerDataFromEmailPass($arrForm['mypage_login_pass'], $arrForm['mypage_login_email'], true)) { $this->sendRedirect($this->getLocation("./index.php")); exit; } else { $arrForm['mypage_login_email'] = strtolower($arrForm['mypage_login_email']); $objQuery = new SC_Query(); $where = "(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0"; $ret = $objQuery->count("dtb_customer", $where, array($arrForm['mypage_login_email'], $arrForm['mypage_login_email'])); if ($ret > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); } } break; } }
/** * Page のプロセス. * * @return void */ function process() { $objCustomer = new SC_Customer(); //ログインしていない場合 if (!$objCustomer->isLoginSuccess()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } else { //ログインしている場合 //DBから商品情報の読込 $arrForm = $this->lfGetRealFileName($_GET['product_id']); //ステータスが支払済み以上である事 if ($arrForm["status"] < ORDER_DELIV) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //ファイル情報が無い場合はNG if ($arrForm["realfilename"] == "") { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //ファイルそのものが無い場合もとりあえずNG $realpath = DOWN_SAVE_DIR . $arrForm["realfilename"]; if (!file_exists($realpath)) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //タイプ指定 header("Content-Type: Application/octet-stream"); //ファイル名指定 header("Content-Disposition: attachment; filename=" . $arrForm["filename"]); header("Content-Transfer-Encoding: binary"); //キャッシュ無効化 header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT"); //IE6+SSL環境下は、キャッシュ無しでダウンロードできない header("Cache-Control: private"); header("Pragma: private"); //ファイルサイズ指定 $zv_filesize = filesize($realpath); header("Content-Length: " . $zv_filesize); //ファイル読み込み readfile($realpath); } }
/** * 会員の登録住所を取得する. * * 配列の1番目に会員登録住所, 追加登録住所が存在する場合は2番目以降に * 設定される. * * @param integer $customer_id 会員ID * @return array 会員登録住所, 追加登録住所の配列 */ function getCustomerAddress($customer_id) { if (DB_TYPE != 'sqlsrv') { return parent::getCustomerAddress($customer_id); } else { $objQuery =& SC_Query_Ex::getSingletonInstance(); $from = <<<__EOS__ ( SELECT NULL AS other_deliv_id, customer_id, name01, name02, kana01, kana02, zip01, zip02, pref, addr01, addr02, email, email_mobile, tel01, tel02, tel03, fax01, fax02, fax03 FROM dtb_customer WHERE customer_id = ? UNION ALL SELECT other_deliv_id, customer_id, name01, name02, kana01, kana02, zip01, zip02, pref, addr01, addr02, NULL AS email, NULL AS email_mobile, tel01, tel02, tel03, NULL AS fax01, NULL AS fax02, NULL AS fax03 FROM dtb_other_deliv WHERE customer_id = ? ) AS addrs __EOS__; $objQuery->setOrder("CASE WHEN other_deliv_id is null THEN -1 ELSE 0 END, other_deliv_id DESC"); return $objQuery->select('*', $from, '', array($customer_id, $customer_id)); } }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objCustomer = new SC_Customer(); //ログイン判定 if (!$objCustomer->isLoginSuccess()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } else { //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, "mypage/index.php"); $mode = isset($_POST['mode']) ? $_POST['mode'] : ''; $customerId = $objCustomer->getValue('customer_id'); switch ($mode) { // お届け先の削除 case 'delete': $objForm = $this->initParam(); if ($objForm->checkError()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); exit; } $this->deleteOtherDeliv($customerId, $objForm->getValue('other_deliv_id')); break; // お届け先の表示 // お届け先の表示 default: break; } //別のお届け先情報 $this->arrOtherDeliv = $this->getOtherDeliv($customerId); //お届け先登録数 $this->tpl_linemax = count($this->arrOtherDeliv); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * 複数配送情報を一時保存する. * * 会員ログインしている場合は, その他のお届け先から住所情報を取得する. * * @param integer $uniqid 一時受注テーブルのユニークID * @param SC_FormParam $objFormParam SC_FormParam インスタンス * @param SC_Customer $objCustomer SC_Customer インスタンス * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス * @return void */ public function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objAddress) { $arrParams = $objFormParam->getSwapArray(); foreach ($arrParams as $arrParam) { $other_deliv_id = $arrParam['shipping']; if ($objCustomer->isLoginSuccess(true)) { if ($other_deliv_id != 0) { $otherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id')); if (!$otherDeliv) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。"); SC_Response_Ex::actionExit(); } foreach ($otherDeliv as $key => $val) { $arrValues[$other_deliv_id]['shipping_' . $key] = $val; } } else { $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping'); } } else { $arrValues = $objPurchase->getShippingTemp(); } $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity']; } $objPurchase->clearShipmentItemTemp(); foreach ($arrValues as $shipping_id => $arrVal) { $objPurchase->saveShippingTemp($arrVal, $shipping_id); } foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) { foreach ($arrProductClassIds as $product_class_id => $quantity) { if ($quantity == 0) { continue; } $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity); } } //不必要な配送先を削除 foreach ($_SESSION['shipping'] as $id => $arrShipping) { if (!isset($arrShipping['shipment_item'])) { $objPurchase->unsetOneShippingTemp($id); } } // $arrValues[0] には, 購入者の情報が格納されている $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス. * * @return void */ function process() { $objCustomer = new SC_Customer(); // 不正なURLがPOSTされた場合はエラー表示 if (!$this->isValidToken()) { GC_Utils_Ex::gfPrintLog('invalid access :login_check.php $POST["url"]=' . $_POST['url']); SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); } // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); //パスワード・Eメールにある空白をトリム $_POST["login_email"] = preg_replace('/^[ \\r\\n]*(.*?)[ \\r\\n]*$/u', '$1', $_POST["login_email"]); $_POST["login_pass"] = trim($_POST["login_pass"]); //認証用 $_POST["login_pass1"] = $_POST["login_pass"]; //最小桁数比較用 $_POST["login_pass2"] = $_POST["login_pass"]; //最大桁数比較用 // POST値の取得 $this->objFormParam->setParam($_POST); if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } switch ($_POST['mode']) { case 'login': $this->objFormParam->toLower('login_email'); $arrErr = $this->objFormParam->checkError(); // エラーの場合はエラー画面に遷移 if (count($arrErr) > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); } $arrForm = $this->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->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { $this->sendRedirect($this->getLocation(URL_DIR, array(), false)); exit; } else { $arrForm['login_email'] = strtolower($arrForm['login_email']); $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); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); } } } else { // 入力エラーの場合、元のアドレスに戻す。 $this->sendRedirect($this->getLocation($_POST['url'], array(), false)); exit; } break; case 'logout': // ログイン情報の解放 $objCustomer->EndSession(); $mypage_url_search = strpos('.' . $_POST['url'], "mypage"); //マイページログイン中はログイン画面へ移行 if ($mypage_url_search == 2) { $this->sendRedirect($this->getLocation(URL_DIR . "mypage/login.php", array(), false)); } else { $this->sendRedirect($this->getLocation(URL_DIR, array(), false)); } exit; break; } }
/** * 複数配送情報を一時保存する. * * 会員ログインしている場合は, その他のお届け先から住所情報を取得する. * * @param integer $uniqid 一時受注テーブルのユニークID * @param SC_FormParam $objFormParam SC_FormParam インスタンス * @param SC_Customer $objCustomer SC_Customer インスタンス * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス * @param SC_CartSession $objCartSess SC_CartSession インスタンス * @return void */ function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess, &$objAddress) { $arrParams = $objFormParam->getSwapArray(); foreach ($arrParams as $arrParam) { $other_deliv_id = $arrParam['shipping']; if ($objCustomer->isLoginSuccess(true)) { if ($other_deliv_id != 0) { $otherDeliv = $objAddress->getAddress($other_deliv_id); foreach ($otherDeliv as $key => $val) { $arrValues[$other_deliv_id]['shipping_' . $key] = $val; } } else { $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping'); } } else { $arrValues = $objPurchase->getShippingTemp(); } $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity']; } $objPurchase->clearShipmentItemTemp(); foreach ($arrValues as $shipping_id => $arrVal) { $objPurchase->saveShippingTemp($arrVal, $shipping_id); } foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) { foreach ($arrProductClassIds as $product_class_id => $quantity) { if ($quantity == 0) { continue; } $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity); } } //不必要な配送先を削除 foreach ($_SESSION['shipping'] as $id => $arrShipping) { if (!isset($arrShipping['shipment_item'])) { $objPurchase->unsetOneShippingTemp($id); } } // $arrValues[0] には, 購入者の情報が格納されている $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); $objQuery = new SC_Query(); //ログイン判定 if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } else { //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } if (isset($_POST['no'])) { $this->sendRedirect($this->getLocation("./index.php"), true); exit; } elseif (isset($_POST['complete'])) { //会員削除 $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id'))); $where = "email = ?"; $objCustomer->EndSession(); //完了ページへ $this->sendRedirect($this->getLocation("./refusal_complete.php"), true); exit; } $objView->assignobj($this); $objView->display(SITE_FRAME); }
function doLogin($mode, SC_Customer $objCustomer, SC_Query $objQuery) { $each = false; switch ($mode) { case "pay_cert_for_authory_sold": $each = true; break; default: $each = false; break; } $consumer = $this->getConsumer($objQuery); $netUrl = new Net_URL($_SERVER["SCRIPT_NAME"]); $netUrl->addQueryString("mode", $this->getMode()); $responce = $consumer->complete($netUrl->getURL()); $status = Auth_OpenID_FAILURE; if ($responce) { $status = $responce->status; } else { $responce = "null"; } GC_Utils_Ex::gfPrintLog(print_r(compact("consumer", "responce", "status"), true), DEBUG_LOG_REALFILE); switch ($status) { case Auth_OpenID_CANCEL: SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "処理を中断しました。"); break; default: case Auth_OpenID_FAILURE: $this->doLoginAuone($this->getMode()); $this->sendResponse(); SC_Response_Ex::actionExit(); break; case Auth_OpenID_SUCCESS: $openid = $responce->getDisplayIdentifier(); $customer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId(null, 'au_open_id=? AND status = 2 AND del_flg = 0', array($openid)); GC_Utils_Ex::gfPrintLog(print_r($customer, true), DEBUG_LOG_REALFILE); if (is_array($customer) && isset($customer["email"])) { $objCustomer->setLogin($customer["email"]); } else { GC_Utils_Ex::gfPrintLog(print_r(compact("responce", "status"), true), DEBUG_LOG_REALFILE); if ($each) { // 都度課金時 (ログインルートへ乗せる) SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。<br/><a href='./login.php'>ログイン・会員登録<a>ボタンより会員登録をしてください。"); // ログインへとばすなら // SC_Response_Ex::sendRedirect ( "login.php" ); // SC_Response_Ex::actionExit (); } else { // 都度課金時以外 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。"); } } break; } }
/** * 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); //パスとテンプレート変数の呼び出し、実行 }
/** * ログインした会員の携帯メールアドレス登録があるかどうか * * ログインした会員の携帯メールアドレスの存在をチェックする * * @param SC_Customer $objCustomer SC_Customer インスタンス * @return boolean 会員の携帯メールアドレス登録がある場合 true */ function hasEmailMobile(&$objCustomer) { $objMobile = new SC_Helper_Mobile_Ex(); if ($objCustomer->hasValue('email_mobile')) { return true; } return false; }
/** * カートの内容を計算する. * * カートの内容を計算し, 下記のキーを保持する連想配列を返す. * * - tax: 税額 * - subtotal: カート内商品の小計 * - deliv_fee: カート内商品の合計送料 * - total: 合計金額 * - payment_total: お支払い合計 * - add_point: 加算ポイント * * @param integer $productTypeId 商品種別ID * @param SC_Customer $objCustomer ログイン中の SC_Customer インスタンス * @param integer $use_point 今回使用ポイント * @param integer|array $deliv_pref 配送先都道府県ID. 複数に配送する場合は都道府県IDの配列 * @param integer $charge 手数料 * @param integer $discount 値引き * @param integer $deliv_id 配送業者ID * @param integer $order_pref 注文者の都道府県ID * @param integer $order_country_id 注文者の国 * @return array カートの計算結果の配列 */ public function calculate($productTypeId, &$objCustomer, $use_point = 0, $deliv_pref = '', $charge = 0, $discount = 0, $deliv_id = 0, $order_pref = 0, $order_country_id = 0) { $results = array(); $total_point = $this->getAllProductsPoint($productTypeId); // MEMO: 税金計算は注文者の住所基準 $results['tax'] = $this->getAllProductsTax($productTypeId, $order_pref, $order_country_id); $results['subtotal'] = $this->getAllProductsTotal($productTypeId, $order_pref, $order_country_id); $results['deliv_fee'] = 0; // 商品ごとの送料を加算 if (OPTION_PRODUCT_DELIV_FEE == 1) { $cartItems = $this->getCartList($productTypeId); foreach ($cartItems as $arrItem) { $results['deliv_fee'] += $arrItem['productsClass']['deliv_fee'] * $arrItem['quantity']; } } // 配送業者の送料を加算 if (OPTION_DELIV_FEE == 1 && !SC_Utils_Ex::isBlank($deliv_pref) && !SC_Utils_Ex::isBlank($deliv_id)) { $results['deliv_fee'] += SC_Helper_Delivery_Ex::getDelivFee($deliv_pref, $deliv_id); } // 送料無料チェック if ($this->isDelivFree($productTypeId)) { $results['deliv_fee'] = 0; } // 合計を計算 $results['total'] = $results['subtotal']; $results['total'] += $results['deliv_fee']; $results['total'] += $charge; $results['total'] -= $discount; // お支払い合計 $results['payment_total'] = $results['total'] - $use_point * POINT_VALUE; // 加算ポイントの計算 if (USE_POINT !== false) { $results['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($total_point, $use_point); if ($objCustomer != '') { // 誕生日月であった場合 if ($objCustomer->isBirthMonth()) { $results['birth_point'] = BIRTH_MONTH_POINT; $results['add_point'] += $results['birth_point']; } } if ($results['add_point'] < 0) { $results['add_point'] = 0; } } return $results; }
/** * Page のプロセス. * * @return void */ function process() { global $objCampaignSess; $objView = new SC_SiteView(false); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $objCampaignSess = new SC_CampaignSession(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); $objLoginFormParam = new SC_FormParam(); // ログインフォーム用 $this->lfInitLoginFormParam($objLoginFormParam); // 初期設定 $objLoginFormParam->setParam($_POST); // POST値の取得 // ディレクトリ名を取得 $dir_name = dirname($_SERVER['PHP_SELF']); $arrDir = split('/', $dir_name); $dir_name = $arrDir[count($arrDir) - 1]; /* セッションにキャンペーンデータを書き込む */ // キャンペーンからの遷移という情報を保持 $objCampaignSess->setIsCampaign(); // キャンペーンIDを保持 $campaign_id = $objQuery->get("dtb_campaign", "campaign_id", "directory_name = ? AND del_flg = 0", array($dir_name)); $objCampaignSess->setCampaignId($campaign_id); // キャンペーンディレクトリ名を保持 $objCampaignSess->setCampaignDir($dir_name); // キャンペーンが開催中かをチェック if ($this->lfCheckActive($dir_name, $objQuery)) { $status = CAMPAIGN_TEMPLATE_ACTIVE; $this->is_active = true; } else { $status = CAMPAIGN_TEMPLATE_END; $this->is_active = false; } switch ($_POST['mode']) { // ログインチェック case 'login': $objLoginFormParam->toLower('login_email'); $this->arrErr = $objLoginFormParam->checkError(); $arrForm = $objLoginFormParam->getHashArray(); // クッキー保存判定 if ($arrForm['login_memory'] == "1" && $arrForm['login_email'] != "") { $objCookie->setCookie('login_email', $_POST['login_email']); } else { $objCookie->setCookie('login_email', ''); } if (count($this->arrErr) == 0) { // ログイン判定 if (!$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) { // 仮登録の判定 $where = "email = ? AND status = 1 AND del_flg = 0"; $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'])); if ($ret > 0) { SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); } else { SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); } } else { // 重複申込チェック $orverlapping_flg = $objQuery->get("dtb_campaign", "orverlapping_flg", "campaign_id = ?", array($objCampaignSess->getCampaignId())); if ($orverlapping_flg) { if ($this->lfOverlappingCheck($objCustomer->getValue('customer_id'), $objQuery)) { $this->arrErr['login_email'] = "※ 複数回ご応募することは出来ません。"; } } if (count($this->arrErr) == 0) { // 申込情報を登録 $this->lfRegistCampaignOrder($objCustomer->getValue('customer_id'), $objQuery); // 完了ページへリダイレクト $this->sendRedirect($this->getLocation(CAMPAIGN_URL . "{$dir_name}/complete.php")); exit; } } } break; default: break; } // 入力情報を渡す $this->arrForm = $_POST; $this->dir_name = $dir_name; $this->tpl_dir_name = CAMPAIGN_TEMPLATE_PATH . $dir_name . "/" . $status; //---- ページ表示 $objView->assignobj($this); $objView->display($this->tpl_mainpage); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(false); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $objSiteSess = new SC_SiteSession(); $objCartSess = new SC_CartSession(); //ログイン判定 if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } $this->arrForm = $_POST; //-- データ設定 foreach ($_POST as $key => $val) { if ($key != "mode" && $key != "return" && $key != "submit" && $key != session_name()) { $this->list_data[$key] = $val; } } // ユーザユニークIDの取得と購入状態の正当性をチェック $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); //別のお届け先DB登録用カラム配列 $arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n")); // 戻るボタン用処理 if (!empty($_POST["return"])) { switch ($_POST["mode"]) { case 'complete': $_POST["mode"] = "set2"; break; case 'set2': $_POST["mode"] = "set1"; break; default: $this->sendRedirect($this->getLocation("./deliv.php"), true); exit; } } switch ($_POST['mode']) { case 'set1': $this->arrErr = $this->lfErrorCheck1($this->arrForm); if (count($this->arrErr) == 0 && empty($_POST["return"])) { $this->tpl_mainpage = 'shopping/set1.tpl'; $checkVal = array("pref", "addr01", "addr02", "addr03", "tel01", "tel02", "tel03"); foreach ($checkVal as $key) { unset($this->list_data[$key]); } // 郵便番号から住所の取得 if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") { $address = $this->lfGetAddress($_REQUEST['zip01'] . $_REQUEST['zip02']); $this->arrForm['pref'] = @$address[0]['state']; $this->arrForm['addr01'] = @$address[0]['city'] . @$address[0]['town']; } } else { $checkVal = array("name01", "name02", "kana01", "kana02", "zip01", "zip02"); foreach ($checkVal as $key) { unset($this->list_data[$key]); } } break; case 'set2': $this->arrErr = $this->lfErrorCheck2($this->arrForm); if (count($this->arrErr) == 0 && empty($_POST["return"])) { $this->tpl_mainpage = 'shopping/set2.tpl'; } else { $this->tpl_mainpage = 'shopping/set1.tpl'; $checkVal = array("pref", "addr01", "addr02", "addr03", "tel01", "tel02", "tel03"); foreach ($checkVal as $key) { unset($this->list_data[$key]); } } break; case 'complete': $this->arrErr = $this->lfErrorCheck($this->arrForm); if (count($this->arrErr) == 0) { // 登録 $other_deliv_id = $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer); // 登録済みの別のお届け先を受注一時テーブルに書き込む $this->lfRegistOtherDelivData($uniqid, $objCustomer, $other_deliv_id); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // お支払い方法選択ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true); exit; } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } break; default: $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id'))); if ($deliv_count >= DELIV_ADDR_MAX) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", false, "最大登録件数を超えています。"); } } $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objSiteInfo = $objView->objSiteInfo; $objCustomer = new SC_Customer(); $objDb = new SC_Helper_DB_Ex(); $this->CONF = $objDb->sf_getBasisData(); $arrInfo = $objSiteInfo->data; //-- 本登録完了のためにメールから接続した場合 if ($_GET["mode"] == "regist") { //-- 入力チェック $this->arrErr = $this->lfErrorCheck($_GET); if ($this->arrErr) { $this->tpl_mainpage = 'regist/error.tpl'; $this->tpl_title = 'エラー'; } else { $registSecretKey = $this->lfRegistData($_GET); //本会員登録(フラグ変更) $this->lfSendRegistMail($registSecretKey); //本会員登録完了メール送信 // ログイン済みの状態にする。 $objQuery = new SC_Query(); $email = $objQuery->get("dtb_customer", "email", "secret_key = ?", array($registSecretKey)); $objCustomer->setLogin($email); $this->sendRedirect($this->getLocation("./complete.php"), true); exit; } //-- それ以外のアクセスは無効とする } else { $this->arrErr["id"] = "無効なアクセスです。"; $this->tpl_mainpage = 'regist/error.tpl'; $this->tpl_title = 'エラー'; } //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * 集計情報を元に最終計算を行う. * * @param array $arrData 各種情報 * @param LC_Page $objPage LC_Page インスタンス * @param SC_CartSession $objCartSess SC_CartSession インスタンス * @param array $arrInfo 店舗情報の配列 * @param SC_Customer $objCustomer SC_Customer インスタンス * @return array 最終計算後の配列 */ function sfTotalConfirm($arrData, &$objPage, &$objCartSess, $arrInfo, $objCustomer = "") { // 未定義変数を定義 if (!isset($arrData['deliv_pref'])) { $arrData['deliv_pref'] = ""; } if (!isset($arrData['payment_id'])) { $arrData['payment_id'] = ""; } if (!isset($arrData['charge'])) { $arrData['charge'] = ""; } if (!isset($arrData['use_point'])) { $arrData['use_point'] = ""; } // 商品の合計個数 $total_quantity = $objCartSess->getTotalQuantity(true); // 税金の取得 $arrData['tax'] = $objPage->tpl_total_tax; // 小計の取得 $arrData['subtotal'] = $objPage->tpl_total_pretax; // 合計送料の取得 $arrData['deliv_fee'] = 0; // 商品ごとの送料が有効の場合 if (OPTION_PRODUCT_DELIV_FEE == 1) { $arrData['deliv_fee'] += $objCartSess->getAllProductsDelivFee(); } // 配送業者の送料が有効の場合 if (OPTION_DELIV_FEE == 1) { // 送料の合計を計算する $arrData['deliv_fee'] += $this->sfGetDelivFee($arrData); } // 送料無料の購入数が設定されている場合 if (DELIV_FREE_AMOUNT > 0) { if ($total_quantity >= DELIV_FREE_AMOUNT) { $arrData['deliv_fee'] = 0; } } // 送料無料条件が設定されている場合 if ($arrInfo['free_rule'] > 0) { // 小計が無料条件を超えている場合 if ($arrData['subtotal'] >= $arrInfo['free_rule']) { $arrData['deliv_fee'] = 0; } } // 合計の計算 $arrData['total'] = $objPage->tpl_total_pretax; // 商品合計 $arrData['total'] += $arrData['deliv_fee']; // 送料 $arrData['total'] += $arrData['charge']; // 手数料 // お支払い合計 $arrData['payment_total'] = $arrData['total'] - $arrData['use_point'] * POINT_VALUE; // 加算ポイントの計算 if (USE_POINT === false) { $arrData['add_point'] = 0; } else { $arrData['add_point'] = SC_Utils::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo); if ($objCustomer != "") { // 誕生日月であった場合 if ($objCustomer->isBirthMonth()) { $arrData['birth_point'] = BIRTH_MONTH_POINT; $arrData['add_point'] += $arrData['birth_point']; } } } if ($arrData['add_point'] < 0) { $arrData['add_point'] = 0; } return $arrData; }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { //---- ページ初期設定 $objDb = new SC_Helper_DB_Ex(); $objMobile = new SC_Helper_Mobile_Ex(); $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 $objConn = new SC_DbConn(); $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); $objDate = new SC_Date(START_BIRTH_YEAR, date("Y", strtotime("now"))); // 空メール if (isset($_SESSION['mobile']['kara_mail_from'])) { $_POST['email'] = $_SESSION['mobile']['kara_mail_from']; $this->tpl_kara_mail_from = $_POST['email']; } elseif (MOBILE_USE_KARA_MAIL) { $token = $objMobile->gfPrepareKaraMail('entry/index.php'); if ($token !== false) { $this->tpl_mainpage = 'entry/mail.tpl'; $this->tpl_title = '会員登録(空メール)'; $this->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN; $this->tpl_from_address = $CONF['email03']; } } // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); //---- 登録用カラム配列 $arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "email", "convert" => "a"), array("column" => "email2", "convert" => "a"), array("column" => "email_mobile", "convert" => "a"), array("column" => "email_mobile2", "convert" => "a"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"), array("column" => "fax01", "convert" => "n"), array("column" => "fax02", "convert" => "n"), array("column" => "fax03", "convert" => "n"), array("column" => "sex", "convert" => "n"), array("column" => "job", "convert" => "n"), array("column" => "birth", "convert" => "n"), array("column" => "reminder", "convert" => "n"), array("column" => "reminder_answer", "convert" => "aKV"), array("column" => "password", "convert" => "a"), array("column" => "password02", "convert" => "a"), array("column" => "mailmaga_flg", "convert" => "n")); //---- 登録除外用カラム配列 $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); if ($_SERVER["REQUEST_METHOD"] == "POST") { //-- POSTデータの引き継ぎ $this->arrForm = $_POST; if (isset($this->arrForm['year']) && $this->arrForm['year'] == '----') { $this->arrForm['year'] = ''; } $this->arrForm['email'] = strtolower($this->arrForm['email']); // emailはすべて小文字で処理 //-- 入力データの変換 $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); // 戻るボタン用処理 if (!empty($_POST["return"])) { switch ($_POST["mode"]) { case "complete": $_POST["mode"] = "set3"; break; case "confirm": $_POST["mode"] = "set2"; break; default: $_POST["mode"] = "set1"; break; } } //-- 入力エラーチェック if ($_POST["mode"] == "set1") { $this->arrErr = $this->lfErrorCheck1($this->arrForm); $this->tpl_mainpage = 'entry/index.tpl'; $this->tpl_title = '会員登録(1/3)'; } elseif ($_POST["mode"] == "set2") { $this->arrErr = $this->lfErrorCheck2($this->arrForm); $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; } else { $this->arrErr = $this->lfErrorCheck3($this->arrForm); $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; } foreach ($this->arrForm as $key => $val) { $this->{$key} = $val; } if ($this->arrErr || !empty($_POST["return"])) { // 入力エラーのチェック //-- データの設定 if ($_POST["mode"] == "set1") { $checkVal = array("email", "password", "reminder", "reminder_answer", "name01", "name02", "kana01", "kana02"); } elseif ($_POST["mode"] == "set2") { $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); } else { $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); } foreach ($this->arrForm as $key => $val) { if ($key != "mode" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } } else { //-- テンプレート設定 if ($_POST["mode"] == "set1") { $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; } elseif ($_POST["mode"] == "set2") { $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") { $address = $this->lfGetAddress($_REQUEST['zip01'] . $_REQUEST['zip02']); $this->pref = @$address[0]['state']; $this->addr01 = @$address[0]['city'] . @$address[0]['town']; } } elseif ($_POST["mode"] == "confirm") { //パスワード表示 $passlen = strlen($this->arrForm['password']); $this->passlen = $this->lfPassLen($passlen); //メール受け取り if (!isset($this->arrForm['mailmaga_flg'])) { $this->arrForm['mailmaga_flg'] = ""; } if (strtolower($this->arrForm['mailmaga_flg']) == "on") { $this->arrForm['mailmaga_flg'] = "2"; } else { $this->arrForm['mailmaga_flg'] = "3"; } $this->tpl_mainpage = 'entry/confirm.tpl'; $this->tpl_title = '会員登録(確認ページ)'; } //-- データ設定 unset($this->list_data); if ($_POST["mode"] == "set1") { $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); } elseif ($_POST["mode"] == "set2") { $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); } else { $checkVal = array(); } foreach ($this->arrForm as $key => $val) { if ($key != "mode" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } //-- 仮登録と完了画面 if ($_POST["mode"] == "complete") { // 確認画面で再度エラーチェックを行う。(画面1) $arrErr = $this->lfErrorCheck1($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/index.tpl'; $this->tpl_title = '会員登録(1/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } // 確認画面で再度エラーチェックを行う。(画面2) $arrErr = $this->lfErrorCheck2($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } // 確認画面で再度エラーチェックを行う。(画面3) $arrErr = $this->lfErrorCheck3($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } $this->CONF = $CONF; $this->uniqid = $this->lfRegistData($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL, true, $this->arrForm["email"]); // 空メールを受信済みの場合はすぐに本登録完了にする。 if (isset($_SESSION['mobile']['kara_mail_from'])) { $param = array("mode" => "regist", "id" => $this->uniqid, session_name() => session_id()); $this->sendRedirect($this->getLocation(MOBILE_URL_DIR . "regist/index.php", $param)); exit; } $this->tpl_mainpage = 'entry/complete.tpl'; $this->tpl_title = '会員登録(完了ページ)'; $objMobile->sfMobileSetExtSessionId('id', $this->uniqid, 'regist/index.php'); // 仮登録完了メール送信 $this->to_name01 = $_POST['name01']; $this->to_name02 = $_POST['name02']; $objMailText = new SC_MobileView(); $objMailText->assignobj($this); $objHelperMail = new SC_Helper_Mail_Ex(); $objQuery = new SC_Query(); // 仮会員が有効の場合 if (CUSTOMER_CONFIRM_MAIL == true) { // Moba8パラメーターを保持する場合はカラム追加 if (isset($_SESSION['a8'])) { $this->etc_value = "&a8=" . $_SESSION['a8']; } $subject = $objHelperMail->sfMakeSubject($objQuery, $objMailText, $this, '会員登録のご確認'); $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); } else { $subject = $objHelperMail->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご完了'); $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); // ログイン状態にする $objCustomer->setLogin($_POST["email"]); } $objMail = new SC_SendMail(); $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"], $CONF["email01"]); // 宛先の設定 $name = $_POST["name01"] . $_POST["name02"] . " 様"; $objMail->setTo($_POST["email"], $name); $objMail->sendMail(); // 完了ページに移動させる。 $this->sendRedirect($this->getLocation("./complete.php"), true); exit; } } } //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { define("HISTORY_NUM", 5); $objView = new SC_MobileView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $pageNo = isset($_GET['pageno']) ? (int) $_GET['pageno'] : 0; // TODO // ログインチェック if (!isset($_SESSION['customer'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } $col = "order_id, create_date, payment_id, payment_total"; $from = "dtb_order"; $where = "del_flg = 0 AND customer_id=?"; $arrval = array($objCustomer->getvalue('customer_id')); $order = "order_id DESC"; $linemax = $objQuery->count($from, $where, $arrval); $this->tpl_linemax = $linemax; // 取得範囲の指定(開始行番号、行数のセット) $objQuery->setlimitoffset(HISTORY_NUM, $pageNo); // 表示順序 $objQuery->setorder($order); //購入履歴の取得 $this->arrOrder = $objQuery->select($col, $from, $where, $arrval); // next if ($pageNo + HISTORY_NUM < $linemax) { $next = "<a href='history.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>次へ→</a>"; } else { $next = ""; } // previous if ($pageNo - HISTORY_NUM > 0) { $previous = "<a href='history.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>←前へ</a>"; } elseif ($pageNo == 0) { $previous = ""; } else { $previous = "<a href='history.php?pageno=0'>←前へ</a>"; } // bar if ($next != '' && $previous != '') { $bar = " | "; } else { $bar = ""; } $this->tpl_strnavi = $previous . $bar . $next; $objView->assignobj($this); //$objpage内の全てのテンプレート変数をsmartyに格納 $objView->display(SITE_FRAME); //パスとテンプレート変数の呼び出し、実行 }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(false); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $ParentPage = MYPAGE_DELIVADDR_URL; // GETでページを指定されている場合には指定ページに戻す if (isset($_GET['page'])) { $ParentPage = htmlspecialchars($_GET['page'], ENT_QUOTES); } else { if (isset($_POST['ParentPage'])) { $ParentPage = htmlspecialchars($_POST['ParentPage'], ENT_QUOTES); } } $this->ParentPage = $ParentPage; //ログイン判定 if (!$objCustomer->isLoginSuccess()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } if (!isset($_GET['other_deliv_id'])) { $_GET['other_deliv_id'] = ""; } if ($_POST['mode'] == "") { $_SESSION['other_deliv_id'] = $_GET['other_deliv_id']; } if ($_GET['other_deliv_id'] != "") { //不正アクセス判定 $flag = $objQuery->count("dtb_other_deliv", "customer_id=? AND other_deliv_id=?", array($objCustomer->getValue("customer_id"), $_SESSION['other_deliv_id'])); if (!$objCustomer->isLoginSuccess() || $flag == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } } //別のお届け先DB登録用カラム配列 $arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n")); if ($_GET['other_deliv_id'] != "") { //別のお届け先情報取得 $arrOtherDeliv = $objQuery->select("*", "dtb_other_deliv", "other_deliv_id=? ", array($_SESSION['other_deliv_id'])); $this->arrForm = $arrOtherDeliv[0]; } switch ($_POST['mode']) { case 'edit': $_POST = $this->lfConvertParam($_POST, $arrRegistColumn); $this->arrErr = $this->lfErrorCheck($_POST); if ($this->arrErr) { foreach ($_POST as $key => $val) { if ($val != "") { $this->arrForm[$key] = $val; } } } else { //別のお届け先登録数の取得 $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id'))); if ($deliv_count < DELIV_ADDR_MAX or isset($_POST['other_deliv_id'])) { if (strlen($_POST['other_deliv_id'] != 0)) { $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=? and other_deliv_id = ?", array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id'])); if ($deliv_count == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } else { $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer); } } else { $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer); } } if ($_POST['ParentPage'] == MYPAGE_DELIVADDR_URL || $_POST['ParentPage'] == URL_DELIV_TOP) { $this->tpl_onload = "fnUpdateParent('" . $this->getLocation($_POST['ParentPage']) . "'); window.close();"; } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } } break; } $objView->assignobj($this); $objView->display($this->tpl_mainpage); }
function lfCheckError() { if ($_POST['mode'] == "add_favorite") { $objCustomer = new SC_Customer(); $objErr = new SC_CheckError(); $customer_id = $objCustomer->getValue('customer_id'); if (SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id))) { $objErr->arrErr['add_favorite' . $favorite_product_id] = "※ この商品は既にお気に入りに追加されています。<br />"; } } else { // 入力データを渡す。 $arrRet = $this->objFormParam->getHashArray(); $objErr = new SC_CheckError($arrRet); $objErr->arrErr = $this->objFormParam->checkError(); // 複数項目チェック if ($this->tpl_classcat_find1) { $objErr->doFunc(array("規格1", "classcategory_id1"), array("EXIST_CHECK")); } if ($this->tpl_classcat_find2) { $objErr->doFunc(array("規格2", "classcategory_id2"), array("EXIST_CHECK")); } } return $objErr->arrErr; }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); //セッション情報を最新の状態に更新する $objCustomer->updateSession(); //ログイン判定 if (!$objCustomer->isLoginSuccess(true)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } else { //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * 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); }
/** * セッションに保持している情報を破棄する. * * 通常、受注処理(completeOrder)完了後に呼び出され、 * セッション情報を破棄する. * * 決済モジュール画面から確認画面に「戻る」場合を考慮し、 * セッション情報を破棄しないカスタマイズを、モジュール側で * 加える機会を与える. * * $orderId が使われていない。 * * @param integer $orderId 注文番号 * @param SC_CartSession $objCartSession カート情報のインスタンス * @param SC_Customer $objCustomer SC_Customer インスタンス * @param integer $cartKey 登録を行うカート情報のキー */ public function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartKey) { // カートの内容を削除する. $objCartSession->delAllProducts($cartKey); SC_SiteSession_Ex::unsetUniqId(); // セッションの配送情報を破棄する. $this->unsetAllShippingTemp(true); $objCustomer->updateSession(); }
function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true) { $objPage = new LC_Page(); $objSiteInfo = new SC_SiteInfo(); $arrInfo = $objSiteInfo->data; $objPage->arrInfo = $arrInfo; $objQuery = new SC_Query(); if ($subject == "" && $header == "" && $footer == "") { // メールテンプレート情報の取得 $where = "template_id = ?"; $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id)); $objPage->tpl_header = $arrRet[0]['header']; $objPage->tpl_footer = $arrRet[0]['footer']; $tmp_subject = $arrRet[0]['subject']; } else { $objPage->tpl_header = $header; $objPage->tpl_footer = $footer; $tmp_subject = $subject; } // 受注情報の取得 $where = "order_id = ?"; $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id)); $arrOrder = $arrRet[0]; $arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id)); $objPage->Message_tmp = $arrOrder['message']; // 顧客情報の取得 $customer_id = $arrOrder['customer_id']; $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); $arrCustomer = isset($arrRet[0]) ? $arrRet[0] : ""; $objPage->arrCustomer = $arrCustomer; $objPage->arrOrder = $arrOrder; //その他決済情報 if ($arrOrder['memo02'] != "") { $arrOther = unserialize($arrOrder['memo02']); foreach ($arrOther as $other_key => $other_val) { if (SC_Utils_Ex::sfTrim($other_val["value"]) == "") { $arrOther[$other_key]["value"] = ""; } } $objPage->arrOther = $arrOther; } // 都道府県変換 $objPage->arrOrder['deliv_pref'] = $this->arrPref[$objPage->arrOrder['deliv_pref']]; $objPage->arrOrderDetail = $arrOrderDetail; $objCustomer = new SC_Customer(); $objPage->tpl_user_point = $objCustomer->getValue('point'); $objMailView = new SC_SiteView(); // メール本文の取得 $objMailView->assignobj($objPage); $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]); // メール送信処理 $objSendMail = new SC_SendMail_Ex(); $bcc = $arrInfo['email01']; $from = $arrInfo['email03']; $error = $arrInfo['email04']; $tosubject = $this->sfMakeSubject($objQuery, $objMailView, $objPage, $tmp_subject); $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); $objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " " . $arrOrder["order_name02"] . " 様"); // 送信フラグ:trueの場合は、送信する。 if ($send) { if ($objSendMail->sendMail()) { $this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body); } } return $objSendMail; }