コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 /**
  * Page のプロセス(モバイル).
  *
  * @return void
  */
 function mobileProcess()
 {
     $objView = new SC_MobileView();
     $objSiteSess = new SC_SiteSession();
     $objCartSess = new SC_CartSession();
     $this->objCustomer = new SC_Customer();
     $objDb = new SC_Helper_DB_Ex();
     $objSiteInfo = $objView->objSiteInfo;
     $arrInfo = $objSiteInfo->data;
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     // ユーザユニークIDの取得と購入状態の正当性をチェック
     $uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
     // ユニークIDを引き継ぐ
     $this->tpl_uniqid = $uniqid;
     // 会員ログインチェック
     if ($this->objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = '******';
         $this->tpl_user_point = $this->objCustomer->getValue('point');
     }
     // 金額の取得 (購入途中で売り切れた場合にはこの関数内にてその商品の個数が0になる)
     $objDb->sfTotalCart($this, $objCartSess, $arrInfo);
     if (empty($arrData)) {
         $arrData = array();
     }
     $this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo);
     // カート内の商品の売り切れチェック
     $objCartSess->chkSoldOut($objCartSess->getCartList(), true);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // 戻るボタンの処理
     if (!empty($_POST['return'])) {
         switch ($_POST['mode']) {
             case 'confirm':
                 $_POST['mode'] = 'payment';
                 break;
             default:
                 // 正常な推移であることを記録しておく
                 $objSiteSess->setRegistFlag();
                 $this->sendRedirect(MOBILE_URL_SHOP_TOP, true);
                 exit;
         }
     }
     switch ($_POST['mode']) {
         // 支払い方法指定 → 配達日時指定
         case 'deliv_date':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($this->arrData);
             if (!isset($this->arrErr['payment_id'])) {
                 // 支払い方法の入力エラーなし
                 $this->tpl_mainpage = 'shopping/deliv_date.tpl';
                 $this->tpl_title = "配達日時指定";
                 break;
             } else {
                 // ユーザユニークIDの取得
                 $uniqid = $objSiteSess->getUniqId();
                 // 受注一時テーブルからの情報を格納
                 $this->lfSetOrderTempData($uniqid);
             }
             break;
         case 'confirm':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($this->arrData);
             // 入力エラーなし
             if (count($this->arrErr) == 0) {
                 // DBへのデータ登録
                 $this->lfRegistData($uniqid);
                 // 正常に登録されたことを記録しておく
                 $objSiteSess->setRegistFlag();
                 // 確認ページへ移動
                 $this->sendRedirect($this->getLocation(MOBILE_URL_SHOP_CONFIRM), true);
                 exit;
             } else {
                 // ユーザユニークIDの取得
                 $uniqid = $objSiteSess->getUniqId();
                 // 受注一時テーブルからの情報を格納
                 $this->lfSetOrderTempData($uniqid);
                 if (!isset($this->arrErr['payment_id'])) {
                     // 支払い方法の入力エラーなし
                     $this->tpl_mainpage = 'shopping/deliv_date.tpl';
                     $this->tpl_title = "配達日時指定";
                 }
             }
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             // 非会員の場合
             // 正常な推移であることを記録しておく
             $objSiteSess->setRegistFlag();
             $this->sendRedirect(MOBILE_URL_SHOP_TOP, true);
             exit;
             break;
             // 支払い方法が変更された場合
         // 支払い方法が変更された場合
         case 'payment':
             // ここのbreakは、意味があるので外さないで下さい。
             break;
         default:
             // 受注一時テーブルからの情報を格納
             $this->lfSetOrderTempData($uniqid);
             break;
     }
     // 店舗情報の取得
     $arrInfo = $objSiteInfo->data;
     // 購入金額の取得得
     $total_pretax = $objCartSess->getAllProductsTotal($arrInfo);
     // 支払い方法の取得
     $this->arrPayment = $this->lfGetPayment($total_pretax);
     // 配送時間の取得
     $arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
     $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
     // 配送日一覧の取得
     $this->arrDelivDate = $this->lfGetDelivDate();
     $this->arrForm = $this->objFormParam->getFormParamList();
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
コード例 #4
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objSiteInfo = new SC_SiteInfo();
     $objDb = new SC_Helper_DB_Ex();
     $arrInfo = $objSiteInfo->data;
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // 検索パラメータの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrSearchHidden[$key] = $val;
         }
     }
     // 表示モード判定
     if (isset($_GET['order_id']) && SC_Utils_Ex::sfIsInt($_GET['order_id'])) {
         $this->disp_mode = true;
         $order_id = $_GET['order_id'];
     } else {
         $order_id = $_POST['order_id'];
     }
     $this->tpl_order_id = $order_id;
     // DBから受注情報を読み込む
     $this->lfGetOrderData($order_id);
     switch ($_POST['mode']) {
         case 'pre_edit':
         case 'order_id':
             break;
         case 'edit':
         case 'add':
             // POST情報で上書き
             $this->objFormParam->setParam($_POST);
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             $this->arrErr = array_merge((array) $this->arrErr, (array) $this->lfCheek($arrInfo, $_POST['mode']));
             if (count($this->arrErr) == 0) {
                 if ($_POST['mode'] == 'add') {
                     $order_id = $this->lfRegistNewData();
                     $this->tpl_order_id = $order_id;
                     $this->tpl_mode = 'edit';
                     $arrData['order_id'] = $order_id;
                     $this->objFormParam->setParam($arrData);
                     $text = "'新規受注を登録しました。'";
                 } else {
                     $this->lfRegistData($_POST['order_id']);
                     $text = "'受注履歴を編集しました。'";
                 }
                 // DBから受注情報を再読込
                 $this->lfGetOrderData($order_id);
                 $this->tpl_onload = "window.alert(" . $text . ");";
             }
             break;
             // 再計算
         // 再計算
         case 'cheek':
             // POST情報で上書き
             $this->objFormParam->setParam($_POST);
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $this->arrErr = $this->lfCheek($arrInfo, $_POST['mode']);
             }
             break;
             /* ペイジェント決済モジュール連携用 */
         /* ペイジェント決済モジュール連携用 */
         case 'paygent_order':
             $this->paygent_return = sfPaygentOrder($_POST['paygent_type'], $order_id);
             break;
             /* 商品削除*/
         /* 商品削除*/
         case 'delete_product':
             $delete_no = $_POST['delete_no'];
             foreach ($_POST as $key => $val) {
                 if (is_array($val)) {
                     foreach ($val as $k => $v) {
                         if ($k != $delete_no) {
                             $arrData[$key][] = $v;
                         }
                     }
                 } else {
                     $arrData[$key] = $val;
                 }
             }
             // 情報上書き
             $this->objFormParam->setParam($arrData);
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $this->arrErr = $this->lfCheek($arrInfo, $_POST['mode']);
             }
             break;
             /* 商品追加ポップアップより商品選択後、商品情報取得*/
         /* 商品追加ポップアップより商品選択後、商品情報取得*/
         case 'select_product_detail':
             // POST情報で上書き
             $this->objFormParam->setParam($_POST);
             if (!empty($_POST['add_product_id'])) {
                 $this->lfInsertProduct($_POST['add_product_id'], $_POST['add_classcategory_id1'], $_POST['add_classcategory_id2']);
             } elseif (!empty($_POST['edit_product_id'])) {
                 $this->lfUpdateProduct($_POST['edit_product_id'], $_POST['edit_classcategory_id1'], $_POST['edit_classcategory_id2'], $_POST['no']);
             }
             $arrData = $_POST;
             foreach ($this->arrForm as $key => $val) {
                 if (is_array($val)) {
                     $arrData[$key] = $this->arrForm[$key]['value'];
                 } else {
                     $arrData[$key] = $val;
                 }
             }
             // 情報上書き
             $this->objFormParam->setParam($arrData);
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $this->arrErr = $this->lfCheek($arrInfo, $_POST['mode']);
             }
             break;
             /* 顧客検索ポップアップより顧客指定後、顧客情報取得*/
         /* 顧客検索ポップアップより顧客指定後、顧客情報取得*/
         case 'search_customer':
             // POST情報で上書き
             $this->objFormParam->setParam($_POST);
             // 検索結果から顧客IDを指定された場合、顧客情報をフォームに代入する
             $this->lfSetCustomerInfo($_POST['edit_customer_id']);
             break;
             /* F-REGI決済モジュール連携用 */
         /* F-REGI決済モジュール連携用 */
         case 'fregi_status':
             $objFregiConfig = new LC_Page_Mdl_Fregi_Config();
             $this->fregi_err = $objFregiConfig->getSaleInfo($order_id, $this->arrDisp);
             $this->lfGetOrderData($order_id);
             break;
         case 'fregi_card':
             $objFregiConfig = new LC_Page_Mdl_Fregi_Config();
             $this->fregi_card_err = $objFregiConfig->setCardInfo($_POST['card_status'], $order_id, $this->arrDisp);
             $this->lfGetOrderData($order_id);
             break;
             /* SPS決済モジュール連携用 */
         /* SPS決済モジュール連携用 */
         case 'sps_request':
             $objErr = new SC_CheckError($_POST);
             $objErr->doFunc(array("年", "sps_year"), array('EXIST_CHECK'));
             $objErr->doFunc(array("月", "sps_month"), array('EXIST_CHECK'));
             $objErr->doFunc(array("日", "sps_date"), array('EXIST_CHECK'));
             $objErr->doFunc(array("売上・返金日", "sps_year", "sps_month", "sps_date"), array("CHECK_DATE"));
             if ($objErr->arrErr) {
                 $this->arrErr = $objErr->arrErr;
                 break;
             }
             $sps_return = sfSpsRequest($order_id, $_POST['request_type']);
             // DBから受注情報を再読込
             $this->lfGetOrderData($order_id);
             $this->tpl_onload = "window.alert('" . $sps_return . "');";
             break;
             /* GMOPG連携用 */
         /* GMOPG連携用 */
         case 'gmopg_order_edit':
             require_once MODULE_PATH . 'mdl_gmopg/class/LC_Mdl_GMOPG_OrderEdit.php';
             $objGMOOrderEdit = new LC_MDL_GMOPG_OrderEdit();
             $this->gmopg_order_edit_result = $objGMOOrderEdit->proccess();
             $this->lfGetOrderData($order_id);
             break;
         default:
             break;
     }
     // 支払い方法の取得
     $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
     // 配送時間の取得
     $arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
     $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
     $this->arrForm = $this->objFormParam->getFormParamList();
     $this->product_count = count($this->arrForm['quantity']['value']);
     // アンカーを設定
     if (isset($_POST['anchor_key']) && !empty($_POST['anchor_key'])) {
         $anchor_hash = "location.hash='#" . $_POST['anchor_key'] . "'";
     } else {
         $anchor_hash = "";
     }
     $this->tpl_onload .= $anchor_hash;
     $this->arrInfo = $arrInfo;
     /**
      * SPS決済 クレジット判定用処理
      */
     if (file_exists(MODULE_PATH . 'mdl_sps/request.php') === TRUE) {
         $objQuery = new SC_Query();
         $this->paymentType = $objQuery->getall("SELECT module_code, memo03 FROM dtb_payment WHERE payment_id = ? ", array($this->arrForm["payment_id"]['value']));
         $objDate = new SC_Date();
         $objDate->setStartYear(RELEASE_YEAR);
         $this->arrYear = $objDate->getYear();
         $this->arrMonth = $objDate->getMonth();
         $this->arrDay = $objDate->getDay();
     }
     $objView->assignobj($this);
     // 表示モード判定
     if (!$this->disp_mode) {
         $objView->display(MAIN_FRAME);
     } else {
         $objView->display('order/disp.tpl');
     }
 }