/**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objProduct = new SC_Product_Ex();
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     switch ($this->getMode()) {
         case 'delete_favorite':
             // お気に入り削除
             $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id']));
             break;
         case 'getList':
             // スマートフォン版のもっと見るボタン用
             // ページ送り用
             if (isset($_POST['pageno'])) {
                 $this->tpl_pageno = intval($_POST['pageno']);
             }
             $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
             $this->arrFavorite = $objProduct->setPriceTaxTo($this->arrFavorite);
             echo SC_Utils_Ex::jsonEncode($this->arrFavorite);
             SC_Response_Ex::actionExit();
             break;
     }
     // ページ送り用
     if (isset($_POST['pageno'])) {
         $this->tpl_pageno = intval($_POST['pageno']);
     }
     $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
 /**
  * Page のプロセス.
  *
  * POST パラメーター "mode" が register の場合は登録処理を行う.
  * 登録処理の後, 自ページをリロードし, GET パラメーター "mode" を付与する.
  * 登録に成功し, GET パラメーター "mode" の値が success の場合は
  * 「登録に成功しました」というメッセージをポップアップで表示する.
  * 登録に失敗し, GET パラメーター "mode" の値が failure の場合は
  * 「登録に失敗しました」というメッセージをポップアップで表示する.
  *
  * TODO Transaction Token を使用する
  *
  * @return void
  */
 function process()
 {
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess(new SC_Session());
     switch ($_POST["mode"]) {
         case "register":
             if ($this->register($_POST['ga_ua'])) {
                 SC_Response_Ex::reload(array("mode" => "success"), true);
                 exit;
             } else {
                 SC_Response_Ex::reload(array("mode" => "failure"), true);
                 exit;
             }
             break;
         default:
     }
     switch ($_GET["mode"]) {
         case "success":
             $this->tpl_onload .= "window.alert('登録に成功しました。');";
             break;
         case "failure":
             $this->tpl_onload .= "window.alert('登録に失敗しました。');";
             break;
         default:
     }
     $objView = new SC_AdminView_Ex();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Beispiel #3
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     switch ($this->getMode()) {
         case 'login':
             //ログイン処理
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->lfDoLogin($objFormParam->getValue('login_id'));
                 SC_Response_Ex::sendRedirect(ADMIN_HOME_URLPATH);
             } else {
                 // ブルートフォースアタック対策
                 // ログイン失敗時に遅延させる
                 sleep(LOGIN_RETRY_INTERVAL);
                 SC_Utils_Ex::sfDispError(LOGIN_ERROR);
             }
             break;
         default:
             break;
     }
     // 管理者ログインテンプレートフレームの設定
     $this->setTemplate(LOGIN_FRAME);
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     switch ($this->getMode()) {
         case 'delete_favorite':
             // お気に入り削除
             $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id']));
             break;
         case 'getList':
             // スマートフォン版のもっと見るボタン用
             // ページ送り用
             if (isset($_POST['pageno'])) {
                 $this->tpl_pageno = intval($_POST['pageno']);
             }
             $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
             SC_Product_Ex::setPriceTaxTo($this->arrFavorite);
             // 一覧メイン画像の指定が無い商品のための処理
             foreach ($this->arrFavorite as $key => $val) {
                 $this->arrFavorite[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']);
             }
             echo SC_Utils_Ex::jsonEncode($this->arrFavorite);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     // ページ送り用
     if (isset($_POST['pageno'])) {
         $this->tpl_pageno = intval($_POST['pageno']);
     }
     $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $arrParam = $_REQUEST;
     list($response_outer, $arrResponse) = SC_Api_Operation::doApiAction($arrParam);
     SC_Api_Operation_Ex::sendApiResponse('xml', $response_outer, $arrResponse);
     SC_Response_Ex::actionExit();
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     SC_Response_Ex::sendRedirect(DIR_INDEX_PATH);
 }
Beispiel #7
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     //ページ送り用
     $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX, 'pageno=#page#', SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE);
     $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row);
     switch ($this->getMode()) {
         case 'getList':
             echo SC_Utils_Ex::jsonEncode($this->arrOrder);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     // 支払い方法の取得
     $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList();
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
     $this->json_payment = SC_Utils::jsonEncode($this->arrPayment);
     $this->json_customer_order_status = SC_Utils::jsonEncode($this->arrCustomerOrderStatus);
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'confirm':
             // トークンを設定
             $this->refusal_transactionid = $this->getRefusalToken();
             $this->tpl_mainpage = 'mypage/refusal_confirm.tpl';
             $this->tpl_subtitle = '退会手続き(確認ページ)';
             break;
         case 'complete':
             // トークン入力チェック
             if (!$this->isValidRefusalToken()) {
                 // エラー画面へ遷移する
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
                 SC_Response_Ex::actionExit();
             }
             $objCustomer = new SC_Customer_Ex();
             $this->lfDeleteCustomer($objCustomer->getValue('customer_id'));
             $objCustomer->EndSession();
             SC_Response_Ex::sendRedirect('refusal_complete.php');
             break;
         default:
             if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
                 $this->refusal_transactionid = $this->getRefusalToken();
             }
             break;
     }
 }
Beispiel #9
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     $this->template = MAIN_FRAME;
     //IP制限チェック
     $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
     if (is_array($allow_hosts) && count($allow_hosts) > 0) {
         if (array_search($_SERVER['REMOTE_ADDR'], $allow_hosts) === FALSE) {
             SC_Utils_Ex::sfDispError(AUTH_ERROR);
         }
     }
     //SSL制限チェック
     if (ADMIN_FORCE_SSL == TRUE) {
         if (SC_Utils_Ex::sfIsHTTPS() === false) {
             SC_Response_Ex::sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE);
         }
     }
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     // スーパーフックポイントを実行.
     $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
     $objPlugin->doAction('LC_Page_preProcess', array($this));
     // トランザクショントークンの検証と生成
     $this->doValidToken(true);
     $this->setTokenTo();
     // ローカルフックポイントを実行
     $parent_class_name = get_parent_class($this);
     $objPlugin->doAction($parent_class_name . '_action_before', array($this));
     $class_name = get_class($this);
     if ($class_name != $parent_class_name) {
         $objPlugin->doAction($class_name . '_action_before', array($this));
     }
 }
Beispiel #10
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     $this->template = MAIN_FRAME;
     //IP制限チェック
     $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
     if (is_array($allow_hosts) && count($allow_hosts) > 0) {
         if (array_search($_SERVER["REMOTE_ADDR"], $allow_hosts) === FALSE) {
             SC_Utils_Ex::sfDispError(AUTH_ERROR);
         }
     }
     //SSL制限チェック
     if (ADMIN_FORCE_SSL == TRUE) {
         if (SC_Utils_Ex::sfIsHTTPS() === false) {
             SC_Response_Ex::sendRedirect($_SERVER["REQUEST_URI"], $_GET, FALSE, TRUE);
         }
     }
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     // プラグインクラス生成
     $this->objPlagin = new SC_Helper_Plugin_Ex();
     $this->objPlagin->preProcess($this);
     // トランザクショントークンの検証と生成
     $this->doValidToken(true);
     $this->setTokenTo();
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id'));
     if (empty($arrMailView)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->tpl_subject = $arrMailView[0]['subject'];
     $this->tpl_body = $arrMailView[0]['mail_body'];
     if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) {
         $this->setTemplate('mypage/mail_view.tpl');
     } else {
         $this->tpl_title = 'メール履歴詳細';
         $this->tpl_mainpage = 'mypage/mail_view.tpl';
     }
     switch ($this->getMode()) {
         case 'getDetail':
             echo SC_Utils_Ex::jsonEncode($arrMailView);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function action()
 {
     $objSiteSess = new SC_SiteSession_Ex();
     $objCartSess = new SC_CartSession_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $this->tpl_uniqid);
     $this->tpl_addrmax = count($this->addrs);
     $this->lfInitParam($objFormParam);
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     switch ($this->getMode()) {
         case 'confirm':
             $objFormParam->setParam($_POST);
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 // フォームの情報を一時保存しておく
                 $_SESSION['multiple_temp'] = $objFormParam->getHashArray();
                 $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, $objCustomer, $objPurchase, $objCartSess);
                 $objSiteSess->setRegistFlag();
                 SC_Response_Ex::sendRedirect("payment.php");
                 exit;
             }
             break;
         default:
             $this->setParamToSplitItems($objFormParam, $objCartSess);
     }
     // 前のページから戻ってきた場合
     if ($_GET['from'] == 'multiple') {
         $objFormParam->setParam($_SESSION['multiple_temp']);
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $arrParam = $_REQUEST;
     list($response_outer, $arrResponse) = SC_Api_Operation_Ex::doApiAction($arrParam);
     if (isset($arrParam["callback"])) {
         $arrResponse["callback"] = $arrParam["callback"];
     }
     SC_Api_Operation_Ex::sendApiResponse('json', $response_outer, $arrResponse);
     SC_Response_Ex::actionExit();
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     //受注詳細データの取得
     $arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
     //ログインしていない、またはDBに情報が無い場合
     if (empty($arrOrderDetail)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->lfAddCartProducts($arrOrderDetail);
     SC_Response_Ex::sendRedirect(CART_URLPATH);
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     switch ($this->getMode()) {
         case 'confirm':
             $this->tpl_mainpage = 'mypage/refusal_confirm.tpl';
             $this->tpl_subtitle = '退会手続き(確認ページ)';
             break;
         case 'complete':
             $objCustomer = new SC_Customer_Ex();
             $this->lfDeleteCustomer($objCustomer->getValue('customer_id'));
             $objCustomer->EndSession();
             SC_Response_Ex::sendRedirect('refusal_complete.php');
     }
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     //受注詳細データの取得
     $arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
     //ログインしていない、またはDBに情報が無い場合
     if (empty($arrOrderDetail)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->lfAddCartProducts($arrOrderDetail);
     SC_Response_Ex::sendRedirect(CART_URL);
 }
 /**
  * Page のプロセス。
  *
  * @return void
  */
 public function action()
 {
     SC_Response_Ex::sendHttpStatus(500);
     $this->tpl_error = 'システムエラーが発生しました。<br />大変お手数ですが、サイト管理者までご連絡ください。';
     if (DEBUG_MODE) {
         echo '<div class="debug">';
         echo '<div>▼▼▼ デバッグ情報ここから ▼▼▼</div>';
         echo '<pre>';
         echo htmlspecialchars($this->sfGetErrMsg(), ENT_QUOTES, CHAR_CODE);
         echo '</pre>';
         echo '<div>▲▲▲ デバッグ情報ここまで ▲▲▲</div>';
         echo '</div>';
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objFormParam = new SC_FormParam_Ex();
     $this->initForm($objFormParam, $_GET);
     switch ($this->getMode()) {
         // PHP INFOを表示
         case 'info':
             phpinfo();
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     $this->arrSystemInfo = $this->getSystemInfo();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objFormParam = new SC_FormParam_Ex();
     // パラメーターの初期化
     $this->initParam($objFormParam, $_GET);
     // パラメーターの検証
     if ($objFormParam->checkError() || !SC_Utils_ex::sfIsInt($id = $objFormParam->getValue('id'))) {
         GC_Utils_Ex::gfPrintLog("error id={$id}");
         SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR);
     }
     $id = $objFormParam->getValue('id');
     // レコードの削除
     $this->deleteMember($id);
     // リダイレクト
     $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno');
     SC_Response_Ex::sendRedirect($url);
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getvalue('customer_id');
     //ページ送り用
     $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'fnNaviPage', NAVI_PMAX, 'pageno=#page#', SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE);
     $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row);
     switch ($this->getMode()) {
         case 'getList':
             echo SC_Utils_Ex::jsonEncode($this->arrOrder);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     // 支払い方法の取得
     $this->arrPayment = SC_Helper_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method');
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // カートが空かどうかを確認する。
     $objCartSess = new SC_CartSession_Ex();
     $arrCartKeys = $objCartSess->getKeys();
     $this->tpl_cart_empty = true;
     foreach ($arrCartKeys as $cart_key) {
         if (count($objCartSess->getCartList($cart_key)) > 0) {
             $this->tpl_cart_empty = false;
             break;
         }
     }
     // メインテンプレートを設定
     if (CUSTOMER_CONFIRM_MAIL == true) {
         // 仮会員登録完了
         $this->tpl_mainpage = 'entry/complete.tpl';
     } else {
         // 本会員登録完了
         SC_Response_Ex::sendRedirectFromUrlPath('regist/complete.php');
     }
 }
 /**
  * Page のプロセス。
  *
  * @return void
  */
 function action()
 {
     switch ($this->type) {
         case LOGIN_ERROR:
             $this->tpl_error = 'IDまたはパスワードが正しくありません。<br />もう一度ご確認のうえ、再度入力してください。';
             break;
         case ACCESS_ERROR:
             $this->tpl_error = 'ログイン認証の有効期限切れの可能性があります。<br />もう一度ご確認のうえ、再度ログインしてください。';
             break;
         case AUTH_ERROR:
             $this->tpl_error = 'このページにはアクセスできません';
             SC_Response_Ex::sendHttpStatus(403);
             break;
         case INVALID_MOVE_ERRORR:
             $this->tpl_error = '不正なページ移動です。<br />もう一度ご確認のうえ、再度入力してください。';
             break;
         default:
             $this->tpl_error = 'エラーが発生しました。<br />もう一度ご確認のうえ、再度ログインしてください。';
             break;
     }
 }
 /**
  * Page のプロセス。
  *
  * @return void
  */
 function action()
 {
     switch ($this->type) {
         case LOGIN_ERROR:
             $this->tpl_error = t('c_The ID or password is not correct.<br />Check and reenter the ID and password._01');
             break;
         case ACCESS_ERROR:
             $this->tpl_error = t('c_Your login session has expired.<br /> Please log in again._01');
             break;
         case AUTH_ERROR:
             $this->tpl_error = t('c_You cannot access this page_01');
             SC_Response_Ex::sendHttpStatus(403);
             break;
         case INVALID_MOVE_ERRORR:
             $this->tpl_error = t('c_Illegal page migration.<br />Check page again._01');
             break;
         default:
             $this->tpl_error = t('c_An error has occurred.<br />Check and log in again._01');
             break;
     }
 }
Beispiel #24
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'regist':
             //-- 本登録完了のためにメールから接続した場合
             //-- 入力チェック
             $this->arrErr = $this->lfCheckError($_GET);
             if ($this->arrErr) {
                 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, $this->arrErr['id']);
             }
             $registSecretKey = $this->lfRegistData($_GET);
             //本会員登録(フラグ変更)
             $this->lfSendRegistMail($registSecretKey);
             //本会員登録完了メール送信
             SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($registSecretKey)));
             break;
             //-- それ以外のアクセスは無効とする
         //-- それ以外のアクセスは無効とする
         default:
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, '無効なアクセスです。');
             break;
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParamSearchCustomer($objFormParam);
     $objFormParam->setParam($_POST);
     // パラメーター読み込み
     $this->arrHidden = $objFormParam->getSearchArray();
     // 入力パラメーターチェック
     $this->arrErr = SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam);
     $this->arrForm = $objFormParam->getFormParamList();
     if (!SC_Utils_Ex::isBlank($this->arrErr)) {
         return;
     }
     // モードによる処理切り替え
     switch ($this->getMode()) {
         // 配信先検索
         case 'search':
         case 'back':
             list($this->tpl_linemax, $this->arrResults, $this->objNavi) = SC_Helper_Customer_Ex::sfGetSearchData($objFormParam->getHashArray());
             $this->arrPagenavi = $this->objNavi->arrPagenavi;
             break;
             // input:検索結果画面「配信内容を設定する」押下後
         // input:検索結果画面「配信内容を設定する」押下後
         case 'input':
             $this->tpl_mainpage = 'mail/input.tpl';
             break;
             // template:テンプレート選択時
         // template:テンプレート選択時
         case 'template':
         case 'regist_back':
             $this->tpl_mainpage = 'mail/input.tpl';
             if (SC_Utils_Ex::sfIsInt($_POST['template_id']) === true) {
                 $this->lfAddParamSelectTemplate($objFormParam);
                 $this->lfGetTemplateData($objFormParam, $_POST['template_id']);
                 // regist_back時、subject,bodyにはテンプレートを読み込むのではなく、入力内容で上書き
                 if ($this->getMode() == 'regist_back') {
                     $objFormParam->setParam($_POST);
                 }
             }
             break;
         case 'regist_confirm':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/input_confirm.tpl';
             }
             break;
         case 'regist_complete':
             $this->tpl_mainpage = 'mail/input.tpl';
             $this->lfAddParamSelectTemplate($objFormParam);
             $objFormParam->setParam($_POST);
             $this->arrErr = $objFormParam->checkError();
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $this->tpl_mainpage = 'mail/index.tpl';
                 SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam));
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             }
             break;
             // query:配信履歴から「確認」
         // query:配信履歴から「確認」
         case 'query':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 $this->arrSearchData = $this->lfGetMailQuery();
             }
             $this->setTemplate('mail/query.tpl');
             break;
             // query:配信履歴から「再送信」
         // query:配信履歴から「再送信」
         case 'retry':
             if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
                 SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']);
                 // DB登録・送信
                 SC_Response_Ex::sendRedirect('./history.php');
             } else {
                 $this->tpl_onload = "window.alert('メール送信IDが正しくありません');";
             }
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objDb = new SC_Helper_DB_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $objProduct = new SC_Product_Ex();
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     // パラメーター情報の初期化
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $this->arrHidden = $objFormParam->getSearchArray();
     $this->arrForm = $objFormParam->getFormParamList();
     switch ($this->getMode()) {
         case 'delete':
             // 商品、子テーブル(商品規格)、会員お気に入り商品の削除
             $this->doDelete('product_id = ?', array($objFormParam->getValue('product_id')));
             // 件数カウントバッチ実行
             $objDb->sfCountCategory($objQuery);
             $objDb->sfCountMaker($objQuery);
             // 削除後に検索結果を表示するため breakしない
             // 検索パラメーター生成後に処理実行するため breakしない
         // 削除後に検索結果を表示するため breakしない
         // 検索パラメーター生成後に処理実行するため breakしない
         case 'csv':
         case 'delete_all':
         case 'search':
             $objFormParam->convParam();
             $objFormParam->trimParam();
             $this->arrErr = $this->lfCheckError($objFormParam);
             $arrParam = $objFormParam->getHashArray();
             if (count($this->arrErr) == 0) {
                 $where = 'del_flg = 0';
                 $arrWhereVal = array();
                 foreach ($arrParam as $key => $val) {
                     if ($val == '') {
                         continue;
                     }
                     $this->buildQuery($key, $where, $arrWhereVal, $objFormParam, $objDb);
                 }
                 $order = 'update_date DESC';
                 /* -----------------------------------------------
                  * 処理を実行
                  * ----------------------------------------------- */
                 switch ($this->getMode()) {
                     // CSVを送信する。
                     case 'csv':
                         $objCSV = new SC_Helper_CSV_Ex();
                         // CSVを送信する。正常終了の場合、終了。
                         $objCSV->sfDownloadCsv(1, $where, $arrWhereVal, $order, true);
                         SC_Response_Ex::actionExit();
                         // 全件削除(ADMIN_MODE)
                     // 全件削除(ADMIN_MODE)
                     case 'delete_all':
                         $this->doDelete($where, $arrWhereVal);
                         break;
                         // 検索実行
                     // 検索実行
                     default:
                         // 行数の取得
                         $this->tpl_linemax = $this->getNumberOfLines($where, $arrWhereVal);
                         // ページ送りの処理
                         $page_max = SC_Utils_Ex::sfGetSearchPageMax($objFormParam->getValue('search_page_max'));
                         // ページ送りの取得
                         $objNavi = new SC_PageNavi_Ex($this->arrHidden['search_pageno'], $this->tpl_linemax, $page_max, 'fnNaviSearchPage', NAVI_PMAX);
                         $this->arrPagenavi = $objNavi->arrPagenavi;
                         // 検索結果の取得
                         $this->arrProducts = $this->findProducts($where, $arrWhereVal, $page_max, $objNavi->start_row, $order, $objProduct);
                         // 各商品ごとのカテゴリIDを取得
                         if (count($this->arrProducts) > 0) {
                             foreach ($this->arrProducts as $key => $val) {
                                 $this->arrProducts[$key]['categories'] = $objDb->sfGetCategoryId($val['product_id'], 0, true);
                                 $objDb->g_category_on = false;
                             }
                         }
                 }
             }
             break;
     }
     // カテゴリの読込
     list($this->arrCatKey, $this->arrCatVal) = $objDb->sfGetLevelCatList(false);
     $this->arrCatList = $this->lfGetIDName($this->arrCatKey, $this->arrCatVal);
 }
 /**
  * モバイル端末以外ダウンロード処理
  *
  * @param string $realpath ダウンロードファイルパス
  * @param string $sdown_filename ダウンロード時の指定ファイル名
  */
 function lfDownload($realpath, $sdown_filename)
 {
     // 拡張子を取得
     $extension = pathinfo($realpath, PATHINFO_EXTENSION);
     $contentType = $this->defaultContentType;
     // 拡張ContentType判定(拡張子をキーに拡張ContentType対象か判断)
     if (isset($this->arrContentType[$extension])) {
         // 拡張ContentType対象の場合は、ContentTypeを変更
         $contentType = $this->arrContentType[$extension];
     }
     header('Content-Type: ' . $contentType);
     //ファイル名指定
     header('Content-Disposition: attachment; filename="' . $sdown_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);
     //ファイル読み込み
     $handle = fopen($realpath, 'rb');
     if ($handle === false) {
         SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true);
         SC_Response_Ex::actionExit();
     }
     while (!feof($handle)) {
         echo fread($handle, DOWNLOAD_BLOCK * 1024);
         SC_Utils_Ex::sfFlush();
         SC_Utils_Ex::extendTimeOut();
     }
     fclose($handle);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objCartSess = new SC_CartSession_Ex();
     $objSiteSess = new SC_SiteSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objFormParam = $this->lfInitParam($_POST);
     $this->mode = $this->getMode();
     // モバイル対応
     if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
         if (isset($_GET['cart_no'])) {
             $objFormParam->setValue('cart_no', $_GET['cart_no']);
         }
         if (isset($_GET['cartKey'])) {
             $objFormParam->setValue('cartKey', $_GET['cartKey']);
         }
     }
     $this->cartKeys = $objCartSess->getKeys();
     foreach ($this->cartKeys as $key) {
         // 商品購入中にカート内容が変更された。
         if ($objCartSess->getCancelPurchase($key)) {
             $this->tpl_message .= "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。\n";
         }
     }
     $cart_no = $objFormParam->getValue('cart_no');
     $cartKey = $objFormParam->getValue('cartKey');
     // エラーチェック
     $arrError = $objFormParam->checkError();
     if (isset($arrError) && !empty($arrError)) {
         SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND);
         SC_Response_Ex::actionExit();
     }
     switch ($this->mode) {
         case 'confirm':
             // カート内情報の取得
             $cartList = $objCartSess->getCartList($cartKey);
             // カート商品が1件以上存在する場合
             if (count($cartList) > 0) {
                 // カートを購入モードに設定
                 $this->lfSetCurrentCart($objSiteSess, $objCartSess, $cartKey);
                 // 購入ページへ
                 SC_Response_Ex::sendRedirect(SHOPPING_URL);
                 SC_Response_Ex::actionExit();
             }
             break;
         case 'up':
             //1個追加
             $objCartSess->upQuantity($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'down':
             //1個減らす
             $objCartSess->downQuantity($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'setQuantity':
             //数量変更
             $objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         case 'delete':
             //カートから削除
             $objCartSess->delProduct($cart_no, $cartKey);
             SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
             SC_Response_Ex::actionExit();
             break;
         default:
             break;
     }
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $totalIncTax = 0;
     foreach ($this->cartKeys as $key) {
         // カート集計処理
         $this->tpl_message .= $objCartSess->checkProducts($key);
         $this->tpl_total_inctax[$key] = $objCartSess->getAllProductsTotal($key);
         $totalIncTax += $this->tpl_total_inctax[$key];
         $this->tpl_total_tax[$key] = $objCartSess->getAllProductsTax($key);
         // ポイント合計
         $this->tpl_total_point[$key] = $objCartSess->getAllProductsPoint($key);
         $this->arrData[$key] = $objCartSess->calculate($key, $objCustomer);
         // 送料無料チェック
         $this->arrData[$key]['is_deliv_free'] = $objCartSess->isDelivFree($key);
         // 送料無料までの金額を計算
         $this->tpl_deliv_free[$key] = $this->arrInfo['free_rule'] - $this->tpl_total_inctax[$key];
     }
     //商品の合計金額をセット
     $this->tpl_all_total_inctax = $totalIncTax;
     $this->tpl_category_id = $objFormParam->getValue('category_id');
     // ログイン判定
     if ($objCustomer->isLoginSuccess(true)) {
         $this->tpl_login = true;
         $this->tpl_user_point = $objCustomer->getValue('point');
         $this->tpl_name = $objCustomer->getValue('name01');
     }
     // 前頁のURLを取得
     // TODO: SC_CartSession::setPrevURL()利用不可。
     $this->lfGetCartPrevUrl($_SESSION, $_SERVER['HTTP_REFERER']);
     $this->tpl_prev_url = isset($_SESSION['cart_prev_url']) ? $_SESSION['cart_prev_url'] : '';
     // すべてのカートの内容を取得する
     $this->cartItems = $objCartSess->getAllCartList();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->lfInitParam($this->tpl_mode, $objFormParam);
     $objFormParam->setParam($_GET);
     $this->arrErr = $objFormParam->checkError();
     $this->arrForm = $objFormParam->getHashArray();
     $this->tpl_zip_download_url_empty = !defined('ZIP_DOWNLOAD_URL') || strlen(ZIP_DOWNLOAD_URL) === 0 || ZIP_DOWNLOAD_URL === false;
     $this->tpl_zip_function_not_exists = !function_exists('zip_open');
     $this->tpl_skip_update_csv = $this->tpl_zip_download_url_empty || $this->tpl_zip_function_not_exists;
     if ($this->exec) {
         if (!empty($this->arrErr)) {
             trigger_error('', E_USER_ERROR);
         }
         switch ($this->tpl_mode) {
             // 自動登録
             case 'auto':
                 $this->lfAutoCommitZip();
                 break;
                 // DB手動登録
             // DB手動登録
             case 'manual':
                 $this->insertMtbZip($this->arrForm['startRowNum']);
                 break;
         }
         SC_Response_Ex::actionExit();
     }
     switch ($this->tpl_mode) {
         // 削除
         case 'delete':
             $this->lfDeleteZip();
             // 進捗・完了画面を表示しない
             $this->tpl_mode = null;
             break;
             // 郵便番号CSV更新
         // 郵便番号CSV更新
         case 'update_csv':
             $this->lfDownloadZipFileFromJp();
             $this->lfExtractZipFile();
             // 進捗・完了画面を表示しない
             $this->tpl_mode = null;
             break;
             // 自動登録時の郵便番号CSV更新
             // XXX iframe内にエラー表示しない様、ここでlfDownloadZipFileFromJp()を呼ぶ。
         // 自動登録時の郵便番号CSV更新
         // XXX iframe内にエラー表示しない様、ここでlfDownloadZipFileFromJp()を呼ぶ。
         case 'auto':
             if (!$this->tpl_skip_update_csv) {
                 $this->lfDownloadZipFileFromJp();
                 $this->lfExtractZipFile();
             }
             break;
     }
     $this->tpl_line = $this->countZipCsv();
     $this->tpl_count_mtb_zip = $this->countMtbZip();
     $this->tpl_csv_datetime = $this->lfGetCsvDatetime();
     // XXX PHP4 を切捨てたら、ダウンロードの必要性チェックなども行いたい
     // $arrHeader = get_headers(ZIP_DOWNLOAD_URL, 1);
 }
 /**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     $objAddress = new SC_Helper_Address_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     switch ($this->getMode()) {
         // お届け先の削除
         case 'delete':
             if ($objFormParam->checkError()) {
                 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                 SC_Response_Ex::actionExit();
             }
             $objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'));
             break;
             // スマートフォン版のもっと見るボタン用
         // スマートフォン版のもっと見るボタン用
         case 'getList':
             $arrData = $objFormParam->getHashArray();
             //別のお届け先情報
             $arrOtherDeliv = $objAddress->getList($customer_id, ($arrData['pageno'] - 1) * SEARCH_PMAX);
             //県名をセット
             $arrOtherDeliv = $this->setPref($arrOtherDeliv, $this->arrPref);
             $arrOtherDeliv['delivCount'] = count($arrOtherDeliv);
             $this->arrOtherDeliv = $arrOtherDeliv;
             echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv);
             SC_Response_Ex::actionExit();
             break;
             // お届け先の表示
         // お届け先の表示
         default:
             break;
     }
     //別のお届け先情報
     $this->arrOtherDeliv = $objAddress->getList($customer_id);
     //お届け先登録数
     $this->tpl_linemax = count($this->arrOtherDeliv);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }