/**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     $objQuery = new SC_Query();
     $objSiteSess = new SC_SiteSession();
     //ログイン判定
     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");
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'confirm':
             $this->tpl_mainpage = TEMPLATE_DIR . 'mypage/refusal_confirm.tpl';
             $this->tpl_title = "MYページ/退会手続き(確認ページ)";
             // 確認ページを経由したことを登録
             $objSiteSess->setRegistFlag();
             // hiddenにuniqidを埋め込む
             $this->tpl_uniqid = $objSiteSess->getUniqId();
             break;
         case 'complete':
             // 正しい遷移かどうかをチェック
             $this->lfIsValidMovement($objSiteSess);
             //会員削除
             $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id')));
             $objCustomer->EndSession();
             //完了ページへ
             $this->sendRedirect($this->getLocation("./refusal_complete.php"));
             exit;
     }
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * ログイン済みの場合の遷移先を取得する.
  *
  * 商品種別IDが, ダウンロード商品の場合は, 会員情報を受注一時情報に保存し,
  * 支払方法選択画面のパスを返す.
  * それ以外は, お届け先選択画面のパスを返す.
  *
  * @param integer $product_type_id 商品種別ID
  * @param string $uniqid 受注一時テーブルのユニークID
  * @param SC_Customer $objCustomer SC_Customer インスタンス
  * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
  * @param SC_SiteSession $objSiteSess SC_SiteSession インスタンス
  * @return string 遷移先のパス
  */
 function getNextLocation($product_type_id, $uniqid, &$objCustomer, &$objPurchase, &$objSiteSess)
 {
     switch ($product_type_id) {
         case PRODUCT_TYPE_DOWNLOAD:
             $objPurchase->saveOrderTemp($uniqid, array(), $objCustomer);
             $objSiteSess->setRegistFlag();
             return 'payment.php';
         case PRODUCT_TYPE_NORMAL:
         default:
             return 'deliv.php';
     }
 }
Example #3
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     // 買い物を続ける場合
     if (!isset($_REQUEST['continue'])) {
         $_REQUEST['continue'] = "";
     }
     if ($_REQUEST['continue']) {
         $this->sendRedirect($this->getLocation(MOBILE_URL_SITE_TOP), true);
         exit;
     }
     $objView = new SC_MobileView(false);
     $objCartSess = new SC_CartSession("", false);
     $objSiteSess = new SC_SiteSession();
     $objSiteInfo = $objView->objSiteInfo;
     $objCustomer = new SC_Customer();
     $objDb = new SC_Helper_DB_Ex();
     // 基本情報の取得
     $arrInfo = $objSiteInfo->data;
     // 商品購入中にカート内容が変更された。
     if ($objCartSess->getCancelPurchase()) {
         $this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";
     }
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'confirm':
             // カート内情報の取得
             $arrRet = $objCartSess->getCartList();
             $max = count($arrRet);
             $cnt = 0;
             for ($i = 0; $i < $max; $i++) {
                 // 商品規格情報の取得
                 $arrData = $objDb->sfGetProductsClass($arrRet[$i]['id']);
                 // DBに存在する商品
                 if ($arrData != "") {
                     $cnt++;
                 }
             }
             // カート商品が1件以上存在する場合
             if ($cnt > 0) {
                 // 正常に登録されたことを記録しておく
                 $objSiteSess->setRegistFlag();
                 $pre_uniqid = $objSiteSess->getUniqId();
                 // 注文一時IDの発行
                 $objSiteSess->setUniqId();
                 $uniqid = $objSiteSess->getUniqId();
                 // エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ
                 if ($pre_uniqid != "") {
                     $sqlval['order_temp_id'] = $uniqid;
                     $where = "order_temp_id = ?";
                     $objQuery = new SC_Query();
                     $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));
                 }
                 // カートを購入モードに設定
                 $objCartSess->saveCurrentCart($uniqid);
                 // 購入ページへ
                 $this->sendRedirect(MOBILE_URL_SHOP_TOP, true);
                 exit;
             }
             break;
         default:
             break;
     }
     if (!isset($_GET['mode'])) {
         $_GET['mode'] = "";
     }
     /*
      * FIXME sendRedirect() を使った方が良いが無限ループしてしまう...
      */
     switch ($_GET['mode']) {
         case 'up':
             $objCartSess->upQuantity($_GET['cart_no']);
             SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
             break;
         case 'down':
             $objCartSess->downQuantity($_GET['cart_no']);
             SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
             break;
         case 'delete':
             $objCartSess->delProduct($_GET['cart_no']);
             SC_Utils_Ex::sfReload(session_name() . "=" . session_id());
             break;
     }
     // カート集計処理
     if (empty($arrData)) {
         $arrData = array();
     }
     $objDb->sfTotalCart($this, $objCartSess, $arrInfo);
     $this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo, $objCustomer);
     $this->arrInfo = $arrInfo;
     // ログイン判定
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = true;
         $this->tpl_user_point = $objCustomer->getValue('point');
         $this->tpl_name = $objCustomer->getValue('name01');
     }
     // 送料無料までの金額を計算
     $tpl_deliv_free = $this->arrInfo['free_rule'] - $this->tpl_total_pretax;
     $this->tpl_deliv_free = $tpl_deliv_free;
     // 前頁のURLを取得
     $this->tpl_prev_url = $objCartSess->getPrevURL();
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // レイアウトデザインを取得
     $helper = new SC_Helper_PageLayout_Ex();
     $helper->sfGetPageLayout($this, false, "products/detail.php");
     // ログイン中のユーザが商品をお気に入りにいれる処理
     if ($objCustomer->isLoginSuccess() === true && strlen($_POST['mode']) > 0 && $_POST['mode'] == "add_favorite" && strlen($_POST['favorite_product_id']) > 0) {
         // 値の正当性チェック
         if (!SC_Utils_Ex::sfIsInt($_POST['favorite_product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_POST['favorite_product_id'], "del_flg = 0 AND status = 1")) {
             SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
             exit;
         } else {
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $customer_id = $objCustomer->getValue('customer_id');
                 $this->lfRegistFavoriteProduct($customer_id, $_POST['favorite_product_id']);
             }
         }
     }
     // パラメータ管理クラス
     $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($_GET['admin']) && $_GET['admin'] == 'on') {
         SC_Utils_Ex::sfIsSuccess(new SC_Session());
         $status = true;
         $where = "del_flg = 0";
     } else {
         $status = false;
         $where = "del_flg = 0 AND status = 1";
     }
     if (isset($_POST['mode']) && $_POST['mode'] != "") {
         $tmp_id = $_POST['product_id'];
     } else {
         $tmp_id = $_GET['product_id'];
     }
     // 値の正当性チェック
     if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) {
         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->lfMakeSelect($tmp_id);
     // 商品IDをFORM内に保持する。
     $this->tpl_product_id = $tmp_id;
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         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'];
                 if (!empty($_POST['gmo_oneclick'])) {
                     $objCartSess->delAllProducts();
                 }
                 // 規格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'));
                 if (!empty($_POST['gmo_oneclick'])) {
                     $objSiteSess = new SC_SiteSession();
                     $objSiteSess->setRegistFlag();
                     $objCartSess->saveCurrentCart($objSiteSess->getUniqId());
                     $this->sendRedirect($this->getLocation(URL_DIR . 'user_data/gmopg_oneclick_confirm.php', array(), true));
                     exit;
                 }
                 $this->sendRedirect($this->getLocation(URL_CART_TOP));
                 exit;
             }
             break;
         default:
             break;
     }
     $objQuery = new SC_Query();
     // DBから商品情報を取得する。
     $arrRet = $objQuery->select("*, (SELECT count(*) FROM dtb_customer_favorite_products WHERE product_id = alldtl.product_id AND customer_id = ?) AS favorite_count", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($objCustomer->getValue('customer_id'), $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'];
     }
     // サブタイトルを取得
     $arrCategory_id = $objDb->sfGetCategoryId($arrRet[0]['product_id'], '', $status);
     $arrFirstCat = $objDb->sfGetFirstCat($arrCategory_id[0]);
     $this->tpl_subtitle = $arrFirstCat['name'];
     // 関連カテゴリを取得
     $this->arrRelativeCat = $objDb->sfGetMultiCatTree($tmp_id);
     // 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);
     // トラックバック情報の取得
     // トラックバック機能の稼働状況チェック
     if (SC_Utils_Ex::sfGetSiteControlFlg(SITE_CONTROL_TRACKBACK) != 1) {
         $this->arrTrackbackView = "OFF";
     } else {
         $this->arrTrackbackView = "ON";
         $this->arrTrackback = $this->lfGetTrackbackData($tmp_id);
     }
     $this->trackback_url = TRACKBACK_TO_URL . $tmp_id;
     // タイトルに商品名を入れる
     $this->tpl_title = "商品詳細 " . $this->arrProduct["name"];
     //オススメ商品情報表示
     $this->arrRecommend = $this->lfPreGetRecommendProducts($tmp_id);
     //この商品を買った人はこんな商品も買っています
     $this->arrRelateProducts = $this->lfGetRelateProducts($tmp_id);
     $this->lfConvertParam();
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
Example #5
0
        $this->tpl_labor = CF_LABOR;
        // 結果応答(1:結果あり、2:結果なし)
        $this->tpl_result = CF_RESULT;
        // キャンセルURL
        $this->tpl_cancelurl = CF_CANCELURL;
        /*
         session_start時のno-cacheヘッダーを抑制することで
         「戻る」ボタン使用時の有効期限切れ表示を抑制する。
         private-no-expire:クライアントのキャッシュを許可する。
        */
        session_cache_limiter('private-no-expire');
    }
}
$objPage = new LC_Page();
$objView = new SC_SiteView();
$objSiteSess = new SC_SiteSession();
$objCartSess = new SC_CartSession();
$objCampaignSess = new SC_CampaignSession();
$objCustomer = new SC_Customer();
$objSiteInfo = $objView->objSiteInfo;
$arrInfo = $objSiteInfo->data;
// 注文一時IDの取得
$uniqid = $objSiteSess->getUniqId();
// ローン決済の戻り値をチェックする。
if ($_GET['tranno'] == $uniqid) {
    // ローン決済受付番号をDBに書き込む
    $sqlval['loan_result'] = $_GET['receiptno'];
    $objQuery = new SC_Query();
    $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid));
    // 正常に登録されたことを記録しておく
    $objSiteSess->setRegistFlag();