Example #1
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objReview ReviewHelper */
     $objReview = Application::alias('eccube.helper.review');
     // パラメーター情報の初期化
     $objFormParam = Application::alias('eccube.form_param');
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     // 検索ワードの引き継ぎ
     $this->arrSearchHidden = $objFormParam->getSearchArray();
     $this->arrForm = $objFormParam->getHashArray();
     switch ($this->getMode()) {
         // 登録
         case 'complete':
             $this->arrErr = $objFormParam->checkError();
             // エラー無し
             if (Utils::isBlank($this->arrErr)) {
                 // レビュー情報の更新
                 $arrValues = $objFormParam->getDbArray();
                 $objReview->save($arrValues);
                 // レビュー情報のDB取得
                 $this->arrForm = $objReview->get($this->arrForm['review_id']);
                 $this->tpl_onload = "alert('登録が完了しました。');";
             }
             break;
         default:
             // レビュー情報のDB取得
             $this->arrForm = $objReview->get($this->arrForm['review_id']);
             break;
     }
 }
Example #2
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // チェック後のデータを格納
     $arrClean = array();
     // $_GET['move'] が想定値かどうかチェック
     switch ($_GET['move']) {
         case 'up':
         case 'down':
             $arrClean['move'] = $_GET['move'];
             break;
         default:
             $arrClean['move'] = '';
             break;
     }
     // 正当な数値であればOK
     if (Utils::sfIsInt($_GET['id'])) {
         $arrClean['id'] = $_GET['id'];
         switch ($arrClean['move']) {
             case 'up':
                 $this->lfRunkUp($arrClean['id']);
                 break;
             case 'down':
                 $this->lfRunkDown($arrClean['id']);
                 break;
             default:
                 break;
         }
         // エラー処理
     } else {
         GcUtils::gfPrintLog('error id=' . $_GET['id']);
     }
     // ページの表示
     Application::alias('eccube.response')->sendRedirect(ADMIN_SYSTEM_URLPATH);
 }
Example #3
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 public function process()
 {
     // 入力エラーチェック
     $arrErr = $this->fnErrorCheck($_GET);
     // 入力エラーの場合は終了
     if (count($arrErr) > 0) {
         $tpl_message = '';
         foreach ($arrErr as $val) {
             $tpl_message .= preg_replace("/<br \\/>/", "\n", $val);
         }
         echo $tpl_message;
         // エラー無し
     } else {
         // 郵便番号検索文作成
         $zipcode = $_GET['zip1'] . $_GET['zip2'];
         // 郵便番号検索
         $arrAdsList = Utils::sfGetAddress($zipcode);
         // 郵便番号が発見された場合
         if (!empty($arrAdsList)) {
             $data = $arrAdsList[0]['state'] . '|' . $arrAdsList[0]['city'] . '|' . $arrAdsList[0]['town'];
             echo $data;
             // 該当無し
         } else {
             echo '該当する住所が見つかりませんでした。';
         }
     }
 }
Example #4
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     if (strpos(HTTPS_URL, 'https://') !== FALSE) {
         $this->tpl_enable_ssl = TRUE;
     }
     $objFormParam = Application::alias('eccube.form_param');
     // パラメーターの初期化
     $this->initParam($objFormParam, $_POST);
     if (count($_POST) > 0) {
         // エラーチェック
         $arrErr = $objFormParam->checkError();
         $this->arrForm = $objFormParam->getHashArray();
         //設定ファイルの権限チェック
         if (!is_writable(CONFIG_REALFILE)) {
             $arrErr['all'] = CONFIG_REALFILE . ' を変更する権限がありません。';
         }
         //管理画面ディレクトリのチェック
         $this->lfCheckAdminArea($this->arrForm, $arrErr);
         if (Utils::isBlank($arrErr) && $this->lfUpdateAdminData($this->arrForm)) {
             $this->tpl_onload = "window.alert('管理機能の設定を変更しました。URLを変更した場合は、新しいURLにアクセスしてください。');";
         } else {
             $this->tpl_onload = "window.alert('設定内容に誤りがあります。設定内容を確認してください。');";
             $this->arrErr = array_merge($arrErr, $this->arrErr);
         }
     } else {
         $admin_dir = str_replace('/', '', ADMIN_DIR);
         $this->arrForm = array('admin_dir' => $admin_dir, 'admin_force_ssl' => ADMIN_FORCE_SSL, 'admin_allow_hosts' => '');
         if (defined('ADMIN_ALLOW_HOSTS')) {
             $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);
             $this->arrForm['admin_allow_hosts'] = implode("\n", $allow_hosts);
         }
     }
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // パラメーター管理クラス
     $objFormParam = Application::alias('eccube.form_param');
     $this->initParam($objFormParam);
     $objFormParam->setParam($_POST);
     $mode = $this->getMode();
     switch ($mode) {
         // ON/OFF
         case 'update_use':
             // エラーチェック
             $this->arrErr = $objFormParam->checkError();
             if (!(count($this->arrErr) > 0)) {
                 $arrPluginHookpointUse = $objFormParam->getValue('plugin_hookpoint_use');
                 $plugin_hookpoint_id = $objFormParam->getValue('plugin_hookpoint_id');
                 $use_flg = $arrPluginHookpointUse[$plugin_hookpoint_id] == 1 ? 1 : 0;
                 PluginUtil::setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg);
                 // Smartyコンパイルファイルをクリア
                 Utils::clearCompliedTemplate();
             }
             break;
         default:
             break;
     }
     // DBからプラグイン情報を取得
     $arrRet = PluginUtil::getPluginHookPointList();
     // 競合チェック
     $this->arrConflict = PluginUtil::checkConflictPlugin();
     $arrHookPoint = array();
     foreach ($arrRet as $key => $val) {
         $arrHookPoint[$val['hook_point']][$val['plugin_id']] = $val;
     }
     $this->arrHookPoint = $arrHookPoint;
 }
Example #6
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // パラメーター管理クラス
     $objFormParam = Application::alias('eccube.form_param');
     // パラメーター設定
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     // パラメーター読み込み
     $this->arrForm = $objFormParam->getFormParamList();
     // 入力パラメーターチェック
     $this->arrErr = $this->lfCheckError($objFormParam);
     if (Utils::isBlank($this->arrErr)) {
         // POSTのモードがsearchなら会員検索開始
         switch ($this->getMode()) {
             case 'search':
                 list($this->tpl_linemax, $this->arrCustomer, $this->objNavi) = $this->lfDoSearch($objFormParam->getHashArray());
                 $this->tpl_strnavi = $this->objNavi->strnavi;
                 break;
             default:
                 break;
         }
     }
     $this->setTemplate($this->tpl_mainpage);
 }
 /**
  * Page を初期化する.
  *
  * @return void
  */
 public 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) {
             Utils::sfDispError(AUTH_ERROR);
         }
     }
     //SSL制限チェック
     if (ADMIN_FORCE_SSL == TRUE) {
         if (Utils::sfIsHTTPS() === false) {
             Application::alias('eccube.response')->sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE);
         }
     }
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = Application::alias('eccube.display');
     // スーパーフックポイントを実行.
     $objPlugin = PluginHelper::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));
     }
 }
Example #8
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     if (!Utils::sfIsInt($_GET['send_id'])) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id'));
     if (empty($arrMailView)) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->tpl_subject = $arrMailView[0]['subject'];
     $this->tpl_body = $arrMailView[0]['mail_body'];
     if (Application::alias('eccube.display')->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 Utils::jsonEncode($arrMailView);
             Application::alias('eccube.response')->actionExit();
             break;
         default:
             break;
     }
 }
Example #9
0
 /**
  * 実行履歴の取得
  *
  * @param  integer $search_pageno 表示したいページ番号
  * @return array(  integer 全体件数, mixed メール配信データ一覧配列, mixed PageNaviオブジェクト)
  */
 public function lfDoSearch($search_pageno = 1)
 {
     // 引数の初期化
     if (Utils::sfIsInt($search_pageno) === false) {
         $search_pageno = 1;
     }
     //
     $objSelect = Application::alias('eccube.query');
     // 一覧データ取得用
     $objQuery = Application::alias('eccube.query');
     // 件数取得用
     // 該当全体件数の取得
     $linemax = $objQuery->count('dtb_send_history', 'del_flg = 0');
     // 一覧データの取得
     $objSelect->setOrder('start_date DESC, send_id DESC');
     $col = '*';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id) AS count_all';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 1) AS count_sent';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 2) AS count_error';
     $col .= ',(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag IS NULL) AS count_unsent';
     // ページ送りの取得
     $offset = SEARCH_PMAX * ($search_pageno - 1);
     $objSelect->setLimitOffset(SEARCH_PMAX, $offset);
     $arrResult = $objSelect->select($col, 'dtb_send_history', ' del_flg = 0');
     /* @var $objNavi PageNavi */
     $objNavi = Application::alias('eccube.page_navi', $search_pageno, $linemax, SEARCH_PMAX);
     return array($linemax, $arrResult, $objNavi->arrPagenavi);
 }
Example #10
0
 /**
  * ブロックファイルに応じて tpl_mainpage を設定する
  *
  * @param  string $bloc_file ブロックファイル名
  * @return void
  */
 public function setTplMainpage($bloc_file)
 {
     if (Utils::isAbsoluteRealPath($bloc_file)) {
         $this->tpl_mainpage = $bloc_file;
     } else {
         $this->tpl_mainpage = Application::alias('eccube.helper.page_layout')->getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file;
     }
     $this->setTemplate($this->tpl_mainpage);
 }
Example #11
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $send_id = $_GET['send_id'];
     if (Utils::sfIsInt($send_id)) {
         $mailHistory = $this->getMailHistory($send_id);
         $this->tpl_subject = $mailHistory[0]['subject'];
         $this->tpl_body = $mailHistory[0]['mail_body'];
     }
     $this->setTemplate($this->tpl_mainpage);
 }
Example #12
0
 public function doAction($arrParam)
 {
     $arrRequest = $this->doInitParam($arrParam);
     if (!$this->isParamError()) {
         $zipcode = $arrRequest['zip1'] . $arrRequest['zip2'];
         $arrAddrList = Utils::sfGetAddress($zipcode);
         if (!Utils::isBlank($arrAddrList)) {
             $this->setResponse('Address', array('State' => $arrAddrList[0]['state'], 'City' => $arrAddrList[0]['city'], 'Town' => $arrAddrList[0]['town']));
             return true;
         }
     }
     return false;
 }
Example #13
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     //決済処理中ステータスのロールバック
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG);
     //受注詳細データの取得
     $arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
     //ログインしていない、またはDBに情報が無い場合
     if (empty($arrOrderDetail)) {
         Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     $this->lfAddCartProducts($arrOrderDetail);
     Application::alias('eccube.response')->sendRedirect(CART_URL);
 }
Example #14
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objMailHelper MailHelper */
     $objMailHelper = Application::alias('eccube.helper.mail');
     switch ($this->getMode()) {
         case 'delete':
             if (Utils::sfIsInt($_GET['id']) === true) {
                 $this->lfDeleteMailTemplate($_GET['id']);
                 $this->objDisplay->reload(null, true);
             }
             break;
         default:
             break;
     }
     $this->arrTemplates = $objMailHelper->sfGetMailmagaTemplate();
 }
Example #15
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objFormParam = Application::alias('eccube.form_param');
     // パラメーターの初期化
     $this->initParam($objFormParam, $_GET);
     // パラメーターの検証
     if ($objFormParam->checkError() || !Utils::sfIsInt($id = $objFormParam->getValue('id'))) {
         GcUtils::gfPrintLog("error id={$id}");
         Utils::sfDispError(INVALID_MOVE_ERRORR);
     }
     $id = $objFormParam->getValue('id');
     // レコードの削除
     $this->deleteMember($id);
     // リダイレクト
     $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno');
     Application::alias('eccube.response')->sendRedirect($url);
 }
 public function doAction($arrParam)
 {
     $arrRequest = $this->doInitParam($arrParam);
     if (!$this->isParamError()) {
         $category_id = $arrRequest['BrowseNodeId'];
         if ($category_id && !Application::alias('eccube.helper.db')->isRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0')) {
             $category_id = '0';
         } elseif (Utils::isBlank($category_id)) {
             $category_id = '0';
         }
         // LC_Page_Products_CategoryList::lfGetCategories() と相当類似しているので共通化したい
         $arrCategory = null;
         // 選択されたカテゴリ
         $arrChildren = array();
         // 子カテゴリ
         $arrAll = Application::alias('eccube.helper.db')->getCatTree($category_id, true);
         foreach ($arrAll as $category) {
             if ($category_id != 0 && $category['category_id'] == $category_id) {
                 $arrCategory = $category;
                 continue;
             }
             if ($category['parent_category_id'] != $category_id) {
                 continue;
             }
             $arrGrandchildrenID = Utils::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']);
             $category['has_children'] = count($arrGrandchildrenID) > 0;
             $arrChildren[] = $category;
         }
         if (!Utils::isBlank($arrCategory)) {
             $arrData = array('BrowseNodeId' => $category_id, 'Name' => $arrCategory['category_name'], 'PageURL' => HTTP_URL . 'products/list.php?category_id=' . $arr['category_id'], 'has_children' => count($arrChildren) > 0);
         } else {
             $arrData = array('BrowseNodeId' => $category_id, 'Name' => 'ホーム', 'PageURL' => HTTP_URL, 'has_children' => count($arrChildren) > 0);
         }
         if (!Utils::isBlank($arrChildren)) {
             $arrData['Children'] = array();
             foreach ($arrChildren as $category) {
                 $arrData['Children']['BrowseNode'][] = array('BrowseNodeId' => $category['category_id'], 'Name' => $category['category_name'], 'PageURL' => HTTP_URL . 'products/list.php?category_id=' . $category['category_id'], 'has_children' => $category['has_children']);
             }
         }
         $this->setResponse('BrowseNode', $arrData);
         // TODO: Ancestors 親ノード
         return true;
     }
     return false;
 }
Example #17
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 public function process()
 {
     parent::process();
     $objView = new SiteView();
     $objSess = new Session();
     Utils::sfIsSuccess($objSess);
     if (isset($_SESSION['preview']) && $_SESSION['preview'] === 'ON') {
         // プレビュー用のレイアウトデザインを取得
         /* @var $objLayout PageLayoutHelper */
         $objLayout = Application::alias('eccube.helper.page_layout');
         $objLayout->sfGetPageLayout($this, true);
         // 画面の表示
         $objView->assignobj($this);
         $objView->display(SITE_FRAME);
         return;
     }
     Utils::sfDispSiteError(PAGE_ERROR);
 }
Example #18
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'detail':
             $objForm = $this->initParam();
             if ($objForm->checkError()) {
                 Utils::sfDispError('');
             }
             $this->arrLogDetail = $this->getLogDetail($objForm->getValue('log_id'));
             if (count($this->arrLogDetail) == 0) {
                 Utils::sfDispError('');
             }
             $this->tpl_mainpage = 'ownersstore/log_detail.tpl';
             break;
         default:
             break;
     }
     $this->arrInstallLogs = $this->getLogs();
 }
Example #19
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objDb DbHelper */
     $objDb = Application::alias('eccube.helper.db');
     $objFormParam = Application::alias('eccube.form_param');
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $rank = intval($_GET['rank']);
     switch ($this->getMode()) {
         case 'search':
             // POST値の引き継ぎ
             $this->arrErr = $this->lfCheckError($objFormParam);
             $arrPost = $objFormParam->getHashArray();
             // 入力された値にエラーがない場合、検索処理を行う。
             // 検索結果の数に応じてページャの処理も入れる。
             if (Utils::isBlank($this->arrErr)) {
                 /* @var $objProduct Product */
                 $objProduct = Application::alias('eccube.product');
                 $wheres = $this->createWhere($objFormParam, $objDb);
                 $this->tpl_linemax = $this->getLineCount($wheres, $objProduct);
                 $page_max = Utils::sfGetSearchPageMax($arrPost['search_page_max']);
                 // ページ送りの取得
                 /* @var $objNavi PageNavi */
                 $objNavi = Application::alias('eccube.page_navi', $arrPost['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX);
                 $this->tpl_strnavi = $objNavi->strnavi;
                 // 表示文字列
                 $startno = $objNavi->start_row;
                 $arrProduct_id = $this->getProducts($wheres, $objProduct, $page_max, $startno);
                 $this->arrProducts = $this->getProductList($arrProduct_id, $objProduct);
                 $this->arrForm = $arrPost;
             }
             break;
         default:
             break;
     }
     // カテゴリ取得
     $this->arrCatList = $objDb->getCategoryList();
     $this->rank = $rank;
     $this->setTemplate('contents/recommend_search.tpl');
 }
Example #20
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objFormParam = Application::alias('eccube.form_param');
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_REQUEST);
     $objFormParam->convParam();
     $this->arrErr = $objFormParam->checkError();
     $is_error = !Utils::isBlank($this->arrErr);
     $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC);
     switch ($this->getMode()) {
         // 登録
         case 'regist':
             $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr);
             if (Utils::isBlank($this->arrErr)) {
                 if ($this->doRegister($objFormParam)) {
                     $this->tpl_onload = "alert('登録が完了しました。');";
                 }
             }
             break;
         default:
             break;
     }
     if (!$is_error) {
         // テキストエリアに表示
         $header_path = $this->getTemplatePath($this->device_type_id, 'header');
         $footer_path = $this->getTemplatePath($this->device_type_id, 'footer');
         if ($header_path === false || $footer_path === false) {
             $this->arrErr['err'] = '※ ファイルの取得に失敗しました<br />';
         } else {
             $this->header_data = file_get_contents($header_path);
             $this->footer_data = file_get_contents($footer_path);
         }
     } else {
         // 画面にエラー表示しないため, ログ出力
         GcUtils::gfPrintLog('Error: ' . print_r($this->arrErr, true));
     }
     //サブタイトルの追加
     $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle;
 }
Example #21
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     switch ($this->getMode()) {
         case 'regist':
             //-- 本登録完了のためにメールから接続した場合
             //-- 入力チェック
             $this->arrErr = $this->lfCheckError($_GET);
             if ($this->arrErr) {
                 Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, $this->arrErr['id']);
             }
             $registSecretKey = $this->lfRegistData($_GET);
             //本会員登録(フラグ変更)
             $this->lfSendRegistMail($registSecretKey);
             //本会員登録完了メール送信
             Application::alias('eccube.response')->sendRedirect('complete.php', array('ci' => Application::alias('eccube.helper.customer')->sfGetCustomerId($registSecretKey)));
             break;
             //-- それ以外のアクセスは無効とする
         //-- それ以外のアクセスは無効とする
         default:
             Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, '無効なアクセスです。');
             break;
     }
 }
Example #22
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objMailHelper MailHelper */
     $objMailHelper = Application::alias('eccube.helper.mail');
     switch ($this->getMode()) {
         case 'template':
             if (Utils::sfIsInt($_GET['template_id'])) {
                 $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'history':
             if (Utils::sfIsInt($_GET['send_id'])) {
                 $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']);
                 $this->mail = $arrMail[0];
             }
             break;
         case 'presend':
             $this->mail['body'] = $_POST['body'];
         default:
             break;
     }
     $this->setTemplate($this->tpl_mainpage);
 }
Example #23
0
 /**
  * Page のAction.
  *
  * @return void
  */
 public function action()
 {
     /* @var $objCustomer Customer */
     $objCustomer = Application::alias('eccube.customer');
     $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);
             Application::alias('eccube.product')->setPriceTaxTo($this->arrFavorite);
             // 一覧メイン画像の指定が無い商品のための処理
             foreach ($this->arrFavorite as $key => $val) {
                 $this->arrFavorite[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']);
             }
             echo Utils::jsonEncode($this->arrFavorite);
             Application::alias('eccube.response')->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;
 }
Example #24
0
 /**
  * 受注データを取得して, FormParam へ設定する.
  *
  * @param  FormParam $objFormParam FormParam インスタンス
  * @param  integer      $order_id     取得元の受注ID
  * @return void
  */
 public function setOrderToFormParam(&$objFormParam, $order_id)
 {
     /* @var $objPurchase PurchaseHelper */
     $objPurchase = Application::alias('eccube.helper.purchase');
     // 受注詳細を設定
     $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false);
     $objFormParam->setParam(Utils::sfSwapArray($arrOrderDetail));
     $arrShippingsTmp = $objPurchase->getShippings($order_id);
     $arrShippings = array();
     foreach ($arrShippingsTmp as $row) {
         // お届け日の処理
         if (!Utils::isBlank($row['shipping_date'])) {
             $ts = strtotime($row['shipping_date']);
             $row['shipping_date_year'] = date('Y', $ts);
             $row['shipping_date_month'] = date('n', $ts);
             $row['shipping_date_day'] = date('j', $ts);
         }
         $arrShippings[$row['shipping_id']] = $row;
     }
     $objFormParam->setParam(Utils::sfSwapArray($arrShippings));
     /*
      * 配送商品を設定
      *
      * $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値
      * $arrProductQuantity[$shipping_id] = 配送先ごとの配送商品数量
      */
     $arrProductQuantity = array();
     $arrShipmentItem = array();
     foreach ($arrShippings as $shipping_id => $arrShipping) {
         $arrProductQuantity[$shipping_id] = count($arrShipping['shipment_item']);
         foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) {
             foreach ($arrItem as $item_key => $item_val) {
                 $arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val;
             }
         }
     }
     $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
     $objFormParam->setParam($arrShipmentItem);
     /*
      * 受注情報を設定
      * $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値
      * が渡ってくるため, $arrOrder で上書きする.
      */
     $arrOrder = $objPurchase->getOrder($order_id);
     // 生年月日の処理
     if (!Utils::isBlank($arrOrder['order_birth'])) {
         $order_birth = substr($arrOrder['order_birth'], 0, 10);
         $arrOrderBirth = explode("-", $order_birth);
         $arrOrder['order_birth_year'] = intval($arrOrderBirth[0]);
         $arrOrder['order_birth_month'] = intval($arrOrderBirth[1]);
         $arrOrder['order_birth_day'] = intval($arrOrderBirth[2]);
     }
     $objFormParam->setParam($arrOrder);
     // ポイントを設定
     list($db_point, $rollback_point) = Application::alias('eccube.helper.db')->getRollbackPoint($order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status']);
     $objFormParam->setValue('total_point', $db_point);
     $objFormParam->setValue('point', $rollback_point);
     if (!Utils::isBlank($objFormParam->getValue('customer_id'))) {
         $arrCustomer = Application::alias('eccube.helper.customer')->sfGetCustomerDataFromId($objFormParam->getValue('customer_id'));
         $objFormParam->setValue('customer_point', $arrCustomer['point']);
     }
 }
Example #25
0
 /**
  * 表示するファイルにエラーチェックを行う
  *
  * @param  FormParam $objFormParam FormParam インスタンス
  * @return boolean       $file_check_flg エラーチェックの結果
  */
 public function checkErrorDispFile($objFormParam)
 {
     $file_check_flg = false;
     // FIXME パスのチェック関数が必要
     $file = $objFormParam->getValue('file');
     $path_exists = Utils::checkFileExistsWithInBasePath($file, USER_REALDIR);
     if ($path_exists) {
         $file_check_flg = true;
     }
     return $file_check_flg;
 }
Example #26
0
 /**
  * エラーメッセージを JSON 形式で返す.
  *
  * TODO リファクタリング
  * この関数は主にスマートフォンで使用します.
  *
  * @param integer エラーコード
  * @return string JSON 形式のエラーメッセージ
  * @see LC_PageError
  */
 public function lfGetErrorMessage($error)
 {
     switch ($error) {
         case TEMP_LOGIN_ERROR:
             $msg = "メールアドレスもしくはパスワードが正しくありません。\n本登録がお済みでない場合は、仮登録メールに記載されているURLより本登録を行ってください。";
             break;
         case SITE_LOGIN_ERROR:
         default:
             $msg = 'メールアドレスもしくはパスワードが正しくありません。';
     }
     return Utils::jsonEncode(array('login_error' => $msg));
 }
Example #27
0
 /**
  * エラーチェックを行う.
  *
  * @param  FormParam $objFormParam FormParam インスタンス
  * @return array        エラーメッセージの配列
  */
 public function lfCheckError(&$objFormParam, &$arrErr)
 {
     $arrParams = $objFormParam->getHashArray();
     /* @var $objErr CheckError */
     $objErr = Application::alias('eccube.check_error', $arrParams);
     $objErr->arrErr =& $arrErr;
     $objErr->doFunc(array('CSSファイル名', 'css_name', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK', 'FILE_NAME_CHECK_BY_NOUPLOAD'));
     $css_name = $objFormParam->getValue('css_name');
     $old_css_name = $objFormParam->getValue('old_css_name');
     $device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC);
     $is_error = false;
     // 重複チェック
     if (Utils::isBlank($objErr->arrErr['css_name'])) {
         $arrCSSList = $this->getCSSList($this->getCSSDir($device_type_id));
         foreach ($arrCSSList as $val) {
             if ($val['css_name'] == $css_name) {
                 if (Utils::isBlank($old_css_name) || $old_css_name != $css_name) {
                     $is_error = true;
                 }
             }
         }
         if ($is_error) {
             $objErr->arrErr['css_name'] = '※ 同じファイル名のデータが存在しています。別の名称を付けてください。<br />';
         }
     }
     return $objErr->arrErr;
 }
Example #28
0
 /**
  * ダウンロードを実行する.
  *
  * 指定のテンプレートをアーカイブし, ブラウザに出力する.
  * 失敗した場合は, エラーメッセージを出力し, false を返す.
  *
  * @param  string  $template_code テンプレートコード
  * @return boolean 成功した場合 true; 失敗した場合 false
  */
 public function doDownload($template_code)
 {
     $from_dir = USER_TEMPLATE_REALDIR . $template_code . '/';
     $to_dir = SMARTY_TEMPLATES_REALDIR . $template_code . '/_packages/';
     if (Utils::recursiveMkdir($to_dir) === false) {
         $this->arrErr['err'] = '※ ディレクトリの作成に失敗しました<br />';
         return false;
     }
     Utils::sfCopyDir($from_dir, $to_dir);
     if (Application::alias('eccube.helper.file_manager')->downloadArchiveFiles(SMARTY_TEMPLATES_REALDIR . $template_code, $template_code) === false) {
         $this->arrErr['err'] = '※ アーカイブファイルの作成に失敗しました<br />';
         return false;
     }
     return true;
 }
Example #29
0
 /**
  * マスターデータ名チェックを行う
  *
  * @access private
  * @param  array  $arrMasterDataName マスターデータテーブル名のリスト
  * @return string $master_data_name 選択しているマスターデータのテーブル名
  */
 public function checkMasterDataName(&$arrParams, &$arrMasterDataName)
 {
     if (in_array($arrParams['master_data_name'], $arrMasterDataName)) {
         $master_data_name = $arrParams['master_data_name'];
         return $master_data_name;
     } else {
         Utils::sfDispError('');
     }
 }
Example #30
0
 /**
  * 指定されたキーと複数値の有効性のDB確認
  *
  * @param  string  $table     テーブル名
  * @param  string  $tblkey    テーブルキー名
  * @param  string  $keyname   フォームキー名
  * @param  array   $item      入力データ配列
  * @param  string  $delimiter 分割文字
  * @return boolean true:有効なデータがある false:有効ではない
  */
 public function lfIsDbRecordMulti($table, $tblkey, $keyname, $item, $delimiter = ',')
 {
     if (array_search($keyname, $this->arrFormKeyList) === FALSE) {
         return true;
     }
     if ($item[$keyname] == '') {
         return true;
     }
     $arrItems = explode($delimiter, $item[$keyname]);
     //空項目のチェック 1つでも空指定があったら不正とする。
     if (array_search('', $arrItems) !== FALSE) {
         return false;
     }
     $count = count($arrItems);
     $where = $tblkey . ' IN (' . Utils::repeatStrWithSeparator('?', $count) . ')';
     $objQuery = Application::alias('eccube.query');
     $db_count = $objQuery->count($table, $where, $arrItems);
     if ($count != $db_count) {
         return false;
     }
     return true;
 }