/** * 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() { $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 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 mobileProcess() { $objCustomer = new SC_Customer(); $objCartSess = new SC_CartSession(); //受注詳細データの取得 $arrDisp = $this->lfGetOrderDetail($_POST['order_id']); //ログインしていない、またはDBに情報が無い場合 if (!$objCustomer->isLoginSuccess(true) or count($arrDisp) == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } for ($num = 0; $num < count($arrDisp); $num++) { $product_id = $arrDisp[$num]['product_id']; $cate_id1 = $arrDisp[$num]['classcategory_id1']; $cate_id2 = $arrDisp[$num]['classcategory_id2']; $quantity = $arrDisp[$num]['quantity']; $objCartSess->addProduct(array($product_id, $cate_id1, $cate_id2), $quantity); } $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); }
/** * 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); } }
/** * 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); }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $objDb = new SC_Helper_DB_Ex(); // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, "mypage/index.php"); //不正アクセス判定 $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() || $cnt == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } 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'); } $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank")); $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); }
/** * 複数配送情報を一時保存する. * * 会員ログインしている場合は, その他のお届け先から住所情報を取得する. * * @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); }
/** * * @param unknown $config * @param SC_Customer $objCustomer */ function doContBillCancel($config, SC_Customer $objCustomer, $continueAccountId = array()) { $objQuery = SC_Query_Ex::getSingletonInstance(); if (!$objCustomer->isLoginSuccess()) { $this->doLogin($this->getMode(), $objCustomer, $objQuery); } if ($this->check_course(true, false)) { $customer_id = $objCustomer->getValue("customer_id"); $where = "customer_id = ?\n AND transaction_status = ?\n AND continue_account_id IS NOT NULL\n AND pay_status = ?\n AND del_flg = 0"; $arrWhereVal = array($customer_id, 40, 20); $arrResult = $objQuery->select("*", "cp_dtb_customer_transaction", $where, $arrWhereVal); if (count($arrResult) == 0) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。"); } foreach ($arrResult as $row) { $curl = $this->curl_init(); // FIXME 継続課金解約 $continueAccountId = $row["continue_account_id"]; $post = $this->getPost("ContBillCancel", $config, compact("continueAccountId")); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); $result = $this->curl_result($curl); $result["post_history"] = $post; $this->check_result($result, false); $this->doConditionInquiryForPayTranStat($config, $row, true); } } else { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。"); } $ammount = $row["ammount"]; if ($this->check_course(true, false)) { SC_Response_Ex::sendRedirect("refusal_complete.php", compact("ammount")); } elseif ($objCustomer->isLoginSuccess()) { $status = "1"; SC_Helper_Customer_Ex::sfEditCustomerData(compact("status"), $objCustomer->getValue("customer_id")); // 退会後 ログアウト $objCustomer->EndSession(); SC_Response_Ex::sendRedirect("refusal_complete.php", compact("ammount")); } }
/** * 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); }
/** * 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); //パスとテンプレート変数の呼び出し、実行 }
/** * 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 のプロセス(モバイル). * * FIXME 要リファクタリング * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); $objQuery = new SC_Query(); $objDb = new SC_Helper_DB_Ex(); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); // POST値の取得 $this->objFormParam->setParam($_POST); // ファイル管理クラス $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR); // ファイル情報の初期化 $this->lfInitFile(); if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } if (!empty($_POST['mode'])) { $tmp_id = $_POST['product_id']; } else { $tmp_id = $_GET['product_id']; } // 値の正当性チェック if (!SC_Utils_Ex::sfIsInt($tmp_id) || !$objDb->sfIsRecord("dtb_products", "product_id", $tmp_id, 'del_flg = 0 AND status = 1')) { SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); } // ログイン判定 if ($objCustomer->isLoginSuccess(true)) { //お気に入りボタン表示 $this->tpl_login = true; /* 閲覧ログ機能は現在未使用 $table = "dtb_customer_reading"; $where = "customer_id = ? "; $arrval[] = $objCustomer->getValue('customer_id'); //顧客の閲覧商品数 $rpcnt = $objQuery->count($table, $where, $arrval); //閲覧数が設定数以下 if ($rpcnt < CUSTOMER_READING_MAX){ //閲覧履歴に新規追加 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); } else { //閲覧履歴の中で一番古いものを削除して新規追加 $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?"; $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id"))); $where = "customer_id = ? AND update_date = ? "; $arrval = array($objCustomer->getValue("customer_id"), $old); //削除 $objQuery->delete($table, $where, $arrval); //追加 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); } */ } // 規格選択セレクトボックスの作成 $this->lfMakeSelectMobile($this, $tmp_id); // 商品IDをFORM内に保持する。 $this->tpl_product_id = $tmp_id; switch ($_POST['mode']) { case 'select': // 規格1が設定されている場合 if ($this->tpl_classcat_find1) { // templateの変更 $this->tpl_mainpage = "products/select_find1.tpl"; break; } case 'select2': $this->arrErr = $this->lfCheckError(); // 規格1が設定されている場合 if ($this->tpl_classcat_find1 and $this->arrErr['classcategory_id1']) { // templateの変更 $this->tpl_mainpage = "products/select_find1.tpl"; break; } // 規格2が設定されている場合 if ($this->tpl_classcat_find2) { $this->arrErr = array(); $this->tpl_mainpage = "products/select_find2.tpl"; break; } case 'selectItem': $this->arrErr = $this->lfCheckError(); // 規格1が設定されている場合 if ($this->tpl_classcat_find2 and $this->arrErr['classcategory_id2']) { // templateの変更 $this->tpl_mainpage = "products/select_find2.tpl"; break; } // 商品数の選択を行う $this->tpl_mainpage = "products/select_item.tpl"; break; case 'cart': // 入力値の変換 $this->objFormParam->convParam(); $this->arrErr = $this->lfCheckError(); if (count($this->arrErr) == 0) { $objCartSess = new SC_CartSession(); $classcategory_id1 = $_POST['classcategory_id1']; $classcategory_id2 = $_POST['classcategory_id2']; // 規格1が設定されていない場合 if (!$this->tpl_classcat_find1) { $classcategory_id1 = '0'; } // 規格2が設定されていない場合 if (!$this->tpl_classcat_find2) { $classcategory_id2 = '0'; } $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); exit; } break; default: break; } $objQuery = new SC_Query(); // DBから商品情報を取得する。 $arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id)); $this->arrProduct = $arrRet[0]; // 商品コードの取得 $code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code"; $arrProductCode = $objQuery->getall($code_sql, array($tmp_id)); $arrProductCode = SC_Utils_Ex::sfswaparray($arrProductCode); $this->arrProductCode = $arrProductCode["product_code"]; // 購入制限数を取得 if ($this->arrProduct['sale_unlimited'] == 1 || $this->arrProduct['sale_limit'] > SALE_LIMIT_MAX) { $this->tpl_sale_limit = SALE_LIMIT_MAX; } else { $this->tpl_sale_limit = $this->arrProduct['sale_limit']; } // サブタイトルを取得 $arrFirstCat = $objDb->sfGetFirstCat($arrRet[0]['category_id']); $tpl_subtitle = $arrFirstCat['name']; $this->tpl_subtitle = $tpl_subtitle; // DBからのデータを引き継ぐ $this->objUpFile->setDBFileList($this->arrProduct); // ファイル表示用配列を渡す $this->arrFile = $this->objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true); // 支払方法の取得 $this->arrPayment = $this->lfGetPayment(); // 入力情報を渡す $this->arrForm = $this->objFormParam->getFormParamList(); //レビュー情報の取得 $this->arrReview = $this->lfGetReviewData($tmp_id); // タイトルに商品名を入れる $this->tpl_title = "商品詳細 " . $this->arrProduct["name"]; //オススメ商品情報表示 $this->arrRecommend = $this->lfPreGetRecommendProducts($tmp_id); //この商品を買った人はこんな商品も買っています $this->arrRelateProducts = $this->lfGetRelateProducts($tmp_id); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * 会員情報から SQL文の値を生成する. * * @param string $uniqid ユニークID * @param array $sqlval SQL の値の配列 * @return array 会員情報を含んだ SQL の値の配列 */ function sfGetCustomerSqlVal($uniqid, $sqlval) { $objCustomer = new SC_Customer(); // 会員情報登録処理 if ($objCustomer->isLoginSuccess(true)) { // 登録データの作成 $sqlval['order_temp_id'] = $uniqid; $sqlval['update_date'] = 'Now()'; $sqlval['customer_id'] = $objCustomer->getValue('customer_id'); $sqlval['order_name01'] = $objCustomer->getValue('name01'); $sqlval['order_name02'] = $objCustomer->getValue('name02'); $sqlval['order_kana01'] = $objCustomer->getValue('kana01'); $sqlval['order_kana02'] = $objCustomer->getValue('kana02'); $sqlval['order_sex'] = $objCustomer->getValue('sex'); $sqlval['order_zip01'] = $objCustomer->getValue('zip01'); $sqlval['order_zip02'] = $objCustomer->getValue('zip02'); $sqlval['order_pref'] = $objCustomer->getValue('pref'); $sqlval['order_addr01'] = $objCustomer->getValue('addr01'); $sqlval['order_addr02'] = $objCustomer->getValue('addr02'); $sqlval['order_tel01'] = $objCustomer->getValue('tel01'); $sqlval['order_tel02'] = $objCustomer->getValue('tel02'); $sqlval['order_tel03'] = $objCustomer->getValue('tel03'); if (defined('MOBILE_SITE')) { $email_mobile = $objCustomer->getValue('email_mobile'); if (empty($email_mobile)) { $sqlval['order_email'] = $objCustomer->getValue('email'); } else { $sqlval['order_email'] = $email_mobile; } } else { $sqlval['order_email'] = $objCustomer->getValue('email'); } $sqlval['order_job'] = $objCustomer->getValue('job'); $sqlval['order_birth'] = $objCustomer->getValue('birth'); } return $sqlval; }
/** * 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); }
/** * 会員情報を受注情報にコピーする. * * ユーザーがログインしていない場合は何もしない. * 会員情報を $dest の order_* へコピーする. * customer_id は強制的にコピーされる. * * @param array $dest コピー先の配列 * @param SC_Customer $objCustomer SC_Customer インスタンス * @param string $prefix コピー先の接頭辞. デフォルト order * @param array $keys コピー対象のキー * @return void */ function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order', $keys = array('name01', 'name02', 'kana01', 'kana02', 'sex', 'zip01', 'zip02', 'pref', 'addr01', 'addr02', 'tel01', 'tel02', 'tel03', 'job', 'birth', 'email')) { if ($objCustomer->isLoginSuccess(true)) { foreach ($keys as $key) { if (in_array($key, $keys)) { $dest[$prefix . '_' . $key] = $objCustomer->getValue($key); } } if (Net_UserAgent_Mobile::isMobile() && in_array('email', $keys)) { $email_mobile = $objCustomer->getValue('email_mobile'); if (empty($email_mobile)) { $dest[$prefix . '_email'] = $objCustomer->getValue('email'); } else { $dest[$prefix . '_email'] = $email_mobile; } } $dest['customer_id'] = $objCustomer->getValue('customer_id'); $dest['update_date'] = 'CURRENT_TIMESTAMP'; } }
/** * Add product to authenticated user's favorites. (for Smart phone) * * @param SC_Customer $objCustomer * @return void */ public function doAddFavoriteSphone(SC_Customer $objCustomer) { // ログイン中のユーザが商品をお気に入りにいれる処理(スマートフォン用) if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) { $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam); if (count($this->arrErr) == 0) { if ($this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) { $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite_sphone', array($this)); print 'true'; SC_Response_Ex::actionExit(); } } print 'error'; SC_Response_Ex::actionExit(); } }
/** * 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); }
/** * 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); }
/** * 複数配送情報を一時保存する. * * 会員ログインしている場合は, その他のお届け先から住所情報を取得する. * * @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) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $arrParams = $objFormParam->getSwapArray(); foreach ($arrParams as $arrParam) { $other_deliv_id = $arrParam['shipping']; if ($objCustomer->isLoginSuccess(true)) { if ($other_deliv_id != 0) { $otherDeliv = $objQuery->select('*', 'dtb_other_deliv', 'other_deliv_id = ?', array($other_deliv_id)); foreach ($otherDeliv[0] 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); } } // $arrValues[0] には, 購入者の情報が格納されている $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer); }
/** * 会員情報を受注情報にコピーする. * * ユーザーがログインしていない場合は何もしない. * 会員情報を $dest の order_* へコピーする. * customer_id は強制的にコピーされる. * * @param array $dest コピー先の配列 * @param SC_Customer $objCustomer SC_Customer インスタンス * @param string $prefix コピー先の接頭辞. デフォルト order * @param array $keys コピー対象のキー * @return void */ public function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order', $keys = array('name01', 'name02', 'kana01', 'kana02', 'company_name', 'sex', 'zip01', 'zip02', 'country_id', 'zipcode', 'pref', 'addr01', 'addr02', 'tel01', 'tel02', 'tel03', 'fax01', 'fax02', 'fax03', 'job', 'birth', 'email')) { if ($objCustomer->isLoginSuccess(true)) { foreach ($keys as $key) { if (in_array($key, $keys)) { $dest[$prefix . '_' . $key] = $objCustomer->getValue($key); } } if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && in_array('email', $keys)) { $email_mobile = $objCustomer->getValue('email_mobile'); if (empty($email_mobile)) { $dest[$prefix . '_email'] = $objCustomer->getValue('email'); } else { $dest[$prefix . '_email'] = $email_mobile; } } $dest['customer_id'] = $objCustomer->getValue('customer_id'); $dest['update_date'] = 'CURRENT_TIMESTAMP'; } }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objSiteSess = new SC_SiteSession(); $objCartSess = new SC_CartSession(); $objCustomer = new SC_Customer(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // パラメータ管理クラス $this->objFormParam = new SC_FormParam(); // パラメータ情報の初期化 $this->lfInitParam(); // POST値の取得 $this->lfConvertEmail($_POST["login_email"]); $this->lfConvertLoginPass($_POST["login_pass"]); $this->objFormParam->setParam($_POST); $this->objLoginFormParam = new SC_FormParam(); // ログインフォーム用 $this->lfInitLoginFormParam(); // 初期設定 $this->objLoginFormParam->setParam($_POST); // POST値の取得 // ユーザユニークIDの取得と購入状態の正当性をチェック $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess); $this->tpl_uniqid = $uniqid; if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } // ログインチェック if ($_POST['mode'] != 'login' && !$objCustomer->isLoginSuccess(true)) { // 不正アクセスとみなす SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } switch ($_POST['mode']) { case 'login': $this->objLoginFormParam->toLower('login_email'); $this->arrErr = $this->objLoginFormParam->checkError(); $arrForm = $this->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->getCustomerDataFromMobilePhoneIdPass($arrForm['login_pass']) && !$objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { // 仮登録の判定 $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); } } } else { // ログインページに戻る $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_TOP), true); exit; } // ログインが成功した場合は携帯端末IDを保存する。 $objCustomer->updateMobilePhoneId(); /* * 携帯メールアドレスが登録されていない場合は, * 携帯メールアドレス登録画面へ遷移 */ $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; } } break; // 削除 // 削除 case 'delete': if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) { $objQuery = new SC_Query(); $where = "other_deliv_id = ?"; $arrRet = $objQuery->delete("dtb_other_deliv", $where, array($_POST['other_deliv_id'])); $this->objFormParam->setValue('select_addr_id', ''); } break; // 会員登録住所に送る // 会員登録住所に送る case 'customer_addr': // お届け先がチェックされている場合には更新処理を行う if ($_POST['deli'] != "") { // 会員情報の住所を受注一時テーブルに書き込む $this->lfRegistDelivData($uniqid, $objCustomer); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // お支払い方法選択ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true); exit; } else { // エラーを返す $arrErr['deli'] = '※ お届け先を選択してください。'; } break; // 登録済みの別のお届け先に送る // 登録済みの別のお届け先に送る case 'other_addr': // お届け先がチェックされている場合には更新処理を行う if ($_POST['deli'] != "") { if (SC_Utils_Ex::sfIsInt($_POST['other_deliv_id'])) { $objQuery = new SC_Query(); $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 != 1) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } // 登録済みの別のお届け先を受注一時テーブルに書き込む $this->lfRegistOtherDelivData($uniqid, $objCustomer, $_POST['other_deliv_id']); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // お支払い方法選択ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_PAYMENT), true); exit; } } else { // エラーを返す $arrErr['deli'] = '※ お届け先を選択してください。'; } break; // 前のページに戻る // 前のページに戻る case 'return': // 確認ページへ移動 $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); exit; break; default: $objQuery = new SC_Query(); $where = "order_temp_id = ?"; $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid)); $this->objFormParam->setParam($arrRet[0]); break; } /** 表示処理 **/ // 会員登録住所の取得 $col = "name01, name02, pref, addr01, addr02, zip01, zip02"; $where = "customer_id = ?"; $objQuery = new SC_Query(); $arrCustomerAddr = $objQuery->select($col, "dtb_customer", $where, array($_SESSION['customer']['customer_id'])); // 別のお届け先住所の取得 $col = "other_deliv_id, name01, name02, pref, addr01, addr02, zip01, zip02"; $objQuery->setorder("other_deliv_id DESC"); $objOtherAddr = $objQuery->select($col, "dtb_other_deliv", $where, array($_SESSION['customer']['customer_id'])); $this->arrAddr = $arrCustomerAddr; $cnt = 1; foreach ($objOtherAddr as $val) { $this->arrAddr[$cnt] = $val; $cnt++; } // 入力値の取得 if (!isset($arrErr)) { $arrErr = array(); } $this->arrForm = $this->objFormParam->getFormParamList(); $this->arrErr = $arrErr; $objView->assignobj($this); $objView->display(SITE_FRAME); }