コード例 #1
0
 /**
  * 新着情報を取得する
  *
  * @return array $arrNews 取得結果を配列で返す
  */
 public function lfGetNews()
 {
     $objNews = new SC_Helper_News_Ex();
     $arrNews = $objNews->getList();
     $objDb = new SC_Helper_DB_Ex();
     $arrInfo = $objDb->sfGetBasisData();
     // RSS用に変換
     foreach (array_keys($arrNews) as $key) {
         $netUrlHttpUrl = new Net_URL(HTTP_URL);
         $row =& $arrNews[$key];
         $row['shop_name'] = $arrInfo['shop_name'];
         $row['email'] = $arrInfo['email04'];
         // 日付
         $row['news_date'] = date('r', strtotime($row['news_date']));
         // 新着情報URL
         if (SC_Utils_Ex::isBlank($row['news_url'])) {
             $row['news_url'] = HTTP_URL;
         } elseif ($row['news_url'][0] == '/') {
             // 変換(絶対パス→URL)
             $netUrl = new Net_URL($row['news_url']);
             $netUrl->protocol = $netUrlHttpUrl->protocol;
             $netUrl->user = $netUrlHttpUrl->user;
             $netUrl->pass = $netUrlHttpUrl->pass;
             $netUrl->host = $netUrlHttpUrl->host;
             $netUrl->port = $netUrlHttpUrl->port;
             $row['news_url'] = $netUrl->getUrl();
         }
     }
     return $arrNews;
 }
コード例 #2
0
 private function setShopData()
 {
     // ショップ情報
     $objDb = new SC_Helper_DB_Ex();
     $arrInfo = $objDb->sfGetBasisData();
     // ショップ名
     $this->lfText(125, 60, $arrInfo['shop_name'], 8, 'B');
     // URL
     $this->lfText(125, 63, $arrInfo['law_url'], 8);
     // 会社名
     $this->lfText(125, 68, $arrInfo['law_company'], 8);
     // 郵便番号
     $text = '〒 ' . $arrInfo['law_zip01'] . ' - ' . $arrInfo['law_zip02'];
     $this->lfText(125, 71, $text, 8);
     // 都道府県+所在地
     $text = $this->arrPref[$arrInfo['law_pref']] . $arrInfo['law_addr01'];
     $this->lfText(125, 74, $text, 8);
     $this->lfText(125, 77, $arrInfo['law_addr02'], 8);
     $text = 'TEL: ' . $arrInfo['law_tel01'] . '-' . $arrInfo['law_tel02'] . '-' . $arrInfo['law_tel03'];
     //FAX番号が存在する場合、表示する
     if (strlen($arrInfo['law_fax01']) > 0) {
         $text .= ' FAX: ' . $arrInfo['law_fax01'] . '-' . $arrInfo['law_fax02'] . '-' . $arrInfo['law_fax03'];
     }
     $this->lfText(125, 80, $text, 8);
     //TEL・FAX
     if (strlen($arrInfo['law_email']) > 0) {
         $text = 'Email: ' . $arrInfo['law_email'];
         $this->lfText(125, 83, $text, 8);
         //Email
     }
     //ロゴ画像
     $logo_file = PDF_TEMPLATE_REALDIR . 'logo.png';
     $this->Image($logo_file, 124, 46, 40);
 }
コード例 #3
0
ファイル: LC_Page_Order.php プロジェクト: nanasess/ec-azure
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $layout = new SC_Helper_PageLayout_Ex();
     $objDb = new SC_Helper_DB_Ex();
     $this->arrOrder = $objDb->sfGetBasisData();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     // 基本情報を渡す
     $objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $this->arrInfo = $objSiteInfo->data;
     //おすすめ商品表示
     $this->arrBestProducts = $this->lfGetRanking();
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     parent::action();
     //ヘッダーナビのカート情報を取得
     $objCart = new SC_CartSession_Ex();
     $cartKeys = $objCart->getKeys();
     $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $this->freeRule = $arrInfo['free_rule'];
     $this->arrCartList = $this->lfGetCartData($objCart, $arrInfo, $cartKeys);
 }
コード例 #6
0
 /**
  * ページのレイアウト情報を取得し, 設定する.
  *
  * 現在の URL に応じたページのレイアウト情報を取得し, LC_Page インスタンスに
  * 設定する.
  *
  * @access public
  * @param  LC_Page $objPage        LC_Page インスタンス
  * @param  boolean $preview        プレビュー表示の場合 true
  * @param  string  $url            ページのURL($_SERVER['SCRIPT_NAME'] の情報)
  * @param  integer $device_type_id 端末種別ID
  * @return void
  */
 public function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_type_id = DEVICE_TYPE_PC)
 {
     // URLを元にページ情報を取得
     if ($preview === false) {
         $url = preg_replace('|^' . preg_quote(ROOT_URLPATH) . '|', '', $url);
         $arrPageData = $this->getPageProperties($device_type_id, null, 'url = ?', array($url));
         // プレビューの場合は, プレビュー用のデータを取得
     } else {
         $arrPageData = $this->getPageProperties($device_type_id, 0);
     }
     if (empty($arrPageData)) {
         trigger_error('ページ情報を取得できませんでした。', E_USER_WARNING);
     }
     $objPage->tpl_mainpage = $this->getTemplatePath($device_type_id) . $arrPageData[0]['filename'] . '.tpl';
     if (!file_exists($objPage->tpl_mainpage)) {
         $msg = 'メイン部のテンプレートが存在しません。[' . $objPage->tpl_mainpage . ']';
         trigger_error($msg, E_USER_WARNING);
     }
     $objPage->arrPageLayout =& $arrPageData[0];
     if (strlen($objPage->arrPageLayout['author']) === 0) {
         $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
         $objPage->arrPageLayout['author'] = $arrInfo['company_name'];
     }
     // ページタイトルを設定
     if (SC_Utils_Ex::isBlank($objPage->tpl_title)) {
         $objPage->tpl_title = $objPage->arrPageLayout['page_name'];
     }
     // 該当ページのブロックを取得し, 配置する
     $masterData = new SC_DB_MasterData_Ex();
     $arrTarget = $masterData->getMasterData('mtb_target');
     $arrBlocs = $this->getBlocPositions($device_type_id, $objPage->arrPageLayout['page_id']);
     // 無効なプラグインのブロックを取り除く.
     $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance();
     $arrBlocs = $objPlugin->getEnableBlocs($arrBlocs);
     // php_path, tpl_path が存在するものを, 各ターゲットに配置
     foreach ($arrTarget as $target_id => $value) {
         foreach ($arrBlocs as $arrBloc) {
             if ($arrBloc['target_id'] != $target_id) {
                 continue;
             }
             if (is_file($arrBloc['php_path']) || is_file($arrBloc['tpl_path'])) {
                 $objPage->arrPageLayout[$arrTarget[$target_id]][] = $arrBloc;
             } else {
                 $error = "ブロックが見つかりません\n" . 'tpl_path: ' . $arrBloc['tpl_path'] . "\n" . 'php_path: ' . $arrBloc['php_path'];
                 trigger_error($error, E_USER_WARNING);
             }
         }
     }
     // カラム数を取得する
     $objPage->tpl_column_num = $this->getColumnNum($objPage->arrPageLayout);
 }
コード例 #7
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $objCustomer = new SC_Customer_Ex();
     // 画面更新毎に情報を更新する
     if ($objCustomer->isLoginSuccess()) {
         // 初回アクセス時に更新
         $objCustomer->updateSession();
         $this->tpl_login = true;
         $this->tpl_point = $objCustomer->getValue("point");
         $this->tpl_customer_id = $objCustomer->getValue("customer_id");
         $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date");
         $this->tpl_carrier = $objCustomer->getValue("carrier");
     }
     $objDB = new SC_Helper_DB_Ex();
     $this->arrSiteInfo = $objDB->sfGetBasisData();
 }
コード例 #8
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objView = new SC_SiteView_Ex();
     //店舗情報をセット
     $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
     //商品IDを取得
     if (isset($_GET['product_id']) && $_GET['product_id'] != '' && is_numeric($_GET['product_id'])) {
         $product_id = $_GET['product_id'];
     } else {
         $product_id = '';
     }
     // モードによって分岐
     $mode = $this->getMode();
     switch ($mode) {
         case 'all':
             $arrProducts = $this->lfGetProductsDetailData($mode, $product_id);
             break;
         case 'list':
             if ($product_id != '' && is_numeric($product_id)) {
                 $arrProducts = $this->lfGetProductsDetailData($mode, $product_id);
             } else {
                 $arrProducts = $this->lfGetProductsListData();
             }
             break;
         default:
             if ($product_id != '' && is_numeric($product_id)) {
                 $arrProducts = $this->lfGetProductsDetailData($mode, $product_id);
             } else {
                 $arrProducts = $this->lfGetProductsAllData();
             }
             break;
     }
     // 商品情報をセット
     $this->arrProducts = $arrProducts;
     // 従来互換 (for 2.11)
     $this->arrProduct =& $this->arrProducts;
     //セットしたデータをテンプレートファイルに出力
     $objView->assignobj($this);
     //キャッシュしない(念のため)
     header('Pragma: no-cache');
     //XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため)
     header('Content-type: application/xml');
     P_DETAIL_URLPATH;
     //画面表示
     $objView->display($this->tpl_mainpage, true);
 }
コード例 #9
0
ファイル: LC_Page.php プロジェクト: nanasess/ec-azure
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     // 開始時刻を設定する。
     $this->timeStart = SC_Utils_Ex::sfMicrotimeFloat();
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     $layout = new SC_Helper_PageLayout_Ex();
     $layout->sfGetPageLayout($this, false, $_SERVER['PHP_SELF'], $this->objDisplay->detectDevice());
     // プラグインクラス生成
     $this->objPlugin = new SC_Helper_Plugin_Ex();
     $this->objPlugin->preProcess($this);
     // 店舗基本情報取得
     $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
     // トランザクショントークンの検証と生成
     $this->doValidToken();
     $this->setTokenTo();
 }
コード例 #10
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->tpl_mainpage = 'products/upload_csv.tpl';
     $this->tpl_mainno = 'products';
     $this->tpl_subno = 'upload_csv';
     $this->tpl_maintitle = t('c_Products_01');
     $this->tpl_subtitle = t('c_Product registration CSV_01');
     $this->csv_id = '1';
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrDISP = $masterData->getMasterData('mtb_disp');
     $this->arrSTATUS = $masterData->getMasterData('mtb_status');
     $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date');
     $this->arrProductType = $masterData->getMasterData('mtb_product_type');
     $this->arrMaker = SC_Helper_DB_Ex::sfGetIDValueList('dtb_maker', 'maker_id', 'name');
     $this->arrPayments = SC_Helper_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method');
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag');
     $this->arrTagCheckItem = array();
 }
コード例 #11
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $masterdata = new SC_DB_MasterData_Ex();
     $this->arrBuyToMaxpoint = $masterdata->getMasterData("mtb_work");
     $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData(false);
     $objDB = new SC_Helper_DB_Ex();
     if ($objDB->sfColumnExists("cp_mtb_docomo_payment_type", "id")) {
         $this->arrPaymentType = $masterdata->getMasterData("cp_mtb_docomo_payment_type");
     }
     if ($objDB->sfColumnExists("cp_mtb_docomo_order_status", "id")) {
         $this->arrCustomerStatus = $masterdata->getMasterData("cp_mtb_docomo_order_status");
     }
     if ($objDB->sfColumnExists("cp_mtb_customer_transaction_paystatus", "id")) {
         $this->arrTransactionPaystatus = $masterdata->getMasterData("cp_mtb_customer_transaction_paystatus");
     }
     if ($objDB->sfColumnExists("cp_mtb_customer_transaction_status", "id")) {
         $this->arrTransactionStatus = $masterdata->getMasterData("cp_mtb_customer_transaction_status");
     }
 }
 /**
  * Page を初期化する.
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->tpl_mainpage = 'products/upload_csv.tpl';
     $this->tpl_mainno = 'products';
     $this->tpl_subno = 'upload_csv';
     $this->tpl_maintitle = '商品管理';
     $this->tpl_subtitle = '商品登録CSV';
     $this->csv_id = '1';
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrDISP = $masterData->getMasterData('mtb_disp');
     $this->arrSTATUS = $masterData->getMasterData('mtb_status');
     $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date');
     $this->arrProductType = $masterData->getMasterData('mtb_product_type');
     $this->arrMaker = SC_Helper_Maker_Ex::getIDValueList();
     $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList();
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag');
     $this->arrTagCheckItem = array();
 }
コード例 #13
0
 /**
  * Page を初期化する.
  *
  * @return void
  */
 function init()
 {
     // 開始時刻を設定する。
     $this->timeStart = microtime(true);
     $this->tpl_authority = $_SESSION['authority'];
     // ディスプレイクラス生成
     $this->objDisplay = new SC_Display_Ex();
     $layout = new SC_Helper_PageLayout_Ex();
     $layout->sfGetPageLayout($this, false, $_SERVER['SCRIPT_NAME'], $this->objDisplay->detectDevice());
     // スーパーフックポイントを実行.
     $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
     $objPlugin->doAction('LC_Page_preProcess', array($this));
     // 店舗基本情報取得
     $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
     // トランザクショントークンの検証と生成
     $this->doValidToken();
     $this->setTokenTo();
     // ローカルフックポイントを実行.
     $this->doLocalHookpointBefore($objPlugin);
 }
コード例 #14
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_REQUEST);
     $objFormParam->convParam();
     $order_id = $objFormParam->getValue('order_id');
     $arrValuesBefore = array();
     // DBから受注情報を読み込む
     if (!SC_Utils_Ex::isBlank($order_id)) {
         $this->setOrderToFormParam($objFormParam, $order_id);
         $this->tpl_subno = 'index';
         $arrValuesBefore['payment_id'] = $objFormParam->getValue('payment_id');
         $arrValuesBefore['payment_method'] = $objFormParam->getValue('payment_method');
     } else {
         $this->tpl_subno = 'add';
         $this->tpl_mode = 'add';
         $arrValuesBefore['payment_id'] = NULL;
         $arrValuesBefore['payment_method'] = NULL;
         // お届け先情報を空情報で表示
         $arrShippingIds[] = null;
         $objFormParam->setValue('shipping_id', $arrShippingIds);
         // 新規受注登録で入力エラーがあった場合の画面表示用に、会員の現在ポイントを取得
         if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) {
             $customer_id = $objFormParam->getValue('customer_id');
             $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id);
             $objFormParam->setValue('customer_point', $arrCustomer['point']);
             // 新規受注登録で、ポイント利用できるように現在ポイントを設定
             $objFormParam->setValue('point', $arrCustomer['point']);
         }
     }
     $this->arrSearchHidden = $objFormParam->getSearchArray();
     switch ($this->getMode()) {
         case 'pre_edit':
         case 'order_id':
             break;
         case 'edit':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (SC_Utils_Ex::isBlank($this->arrErr)) {
                 $message = '受注を編集しました。';
                 $order_id = $this->doRegister($order_id, $objPurchase, $objFormParam, $message, $arrValuesBefore);
                 if ($order_id >= 0) {
                     $this->setOrderToFormParam($objFormParam, $order_id);
                 }
                 $this->tpl_onload = "window.alert('" . $message . "');";
             }
             break;
         case 'add':
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $objFormParam->setParam($_POST);
                 $objFormParam->convParam();
                 $this->arrErr = $this->lfCheckError($objFormParam);
                 if (SC_Utils_Ex::isBlank($this->arrErr)) {
                     $message = '受注を登録しました。';
                     $order_id = $this->doRegister(null, $objPurchase, $objFormParam, $message, $arrValuesBefore);
                     if ($order_id >= 0) {
                         $this->tpl_mode = 'edit';
                         $objFormParam->setValue('order_id', $order_id);
                         $this->setOrderToFormParam($objFormParam, $order_id);
                     }
                     $this->tpl_onload = "window.alert('" . $message . "');";
                 }
             }
             break;
             // 再計算
         // 再計算
         case 'recalculate':
             //支払い方法の選択
         //支払い方法の選択
         case 'payment':
             // 配送業者の選択
         // 配送業者の選択
         case 'deliv':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($objFormParam);
             break;
             // 商品削除
         // 商品削除
         case 'delete_product':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $delete_no = $objFormParam->getValue('delete_no');
             $this->doDeleteProduct($delete_no, $objFormParam);
             $this->arrErr = $this->lfCheckError($objFormParam);
             break;
             // 商品追加ポップアップより商品選択
         // 商品追加ポップアップより商品選択
         case 'select_product_detail':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->doRegisterProduct($objFormParam);
             $this->arrErr = $this->lfCheckError($objFormParam);
             break;
             // 会員検索ポップアップより会員指定
         // 会員検索ポップアップより会員指定
         case 'search_customer':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->setCustomerTo($objFormParam->getValue('edit_customer_id'), $objFormParam);
             $this->arrErr = $this->lfCheckError($objFormParam);
             break;
             // 複数配送設定表示
         // 複数配送設定表示
         case 'multiple':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($objFormParam);
             break;
             // 複数配送設定を反映
         // 複数配送設定を反映
         case 'multiple_set_to':
             $this->lfInitMultipleParam($objFormParam);
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->setMultipleItemTo($objFormParam);
             break;
             // お届け先の追加
         // お届け先の追加
         case 'append_shipping':
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             $this->addShipping($objFormParam);
             break;
         default:
             break;
     }
     $this->arrForm = $objFormParam->getFormParamList();
     $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys));
     $this->arrDelivTime = $objPurchase->getDelivTime($objFormParam->getValue('deliv_id'));
     $this->tpl_onload .= $this->getAnchorKey($objFormParam);
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     if ($arrValuesBefore['payment_id']) {
         $this->arrPayment[$arrValuesBefore['payment_id']] = $arrValuesBefore['payment_method'];
     }
 }
コード例 #15
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objDb = new SC_Helper_DB_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam, $_POST);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $this->arrForm = $objFormParam->getHashArray();
     $this->tpl_onload = "eccube.checkLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "');";
     switch ($this->getMode()) {
         case 'confirm':
             $this->arrErr = $this->lfCheckError($objFormParam);
             if (!empty($this->arrErr)) {
                 return;
             }
             $this->tpl_subtitle = 'SHOPマスター(確認)';
             $this->tpl_mainpage = 'basis/confirm.tpl';
             break;
         case 'return':
             break;
         case 'complete':
             $arrData = $objFormParam->getDbArray();
             SC_Helper_DB_Ex::registerBasisData($arrData);
             // キャッシュファイル更新
             $objDb->sfCreateBasisDataCache();
             $this->tpl_onload .= "window.alert('SHOPマスターの登録が完了しました。');";
             // breakはつけない
         // breakはつけない
         default:
             $arrRet = $objDb->sfGetBasisData(true);
             $objFormParam->setParam($arrRet);
             $this->arrForm = $objFormParam->getHashArray();
             $this->arrForm['regular_holiday_ids'] = explode('|', $this->arrForm['regular_holiday_ids']);
             break;
     }
 }
コード例 #16
0
ファイル: SC_Helper_DB.php プロジェクト: rateon/twhk-ec
 /**
  * 店舗基本情報に基づいて加算ポイントを返す
  *
  * @param  integer $totalpoint
  * @param  integer $use_point
  * @return integer 加算ポイント
  */
 public function sfGetAddPoint($totalpoint, $use_point)
 {
     // 店舗基本情報を取得
     $CONF = SC_Helper_DB_Ex::sfGetBasisData();
     return SC_Utils_Ex::sfGetAddPoint($totalpoint, $use_point, $CONF['point_rate']);
 }
コード例 #17
0
ファイル: LC_Page_Regist.php プロジェクト: nanasess/ec-azure
 /**
  * 正会員登録完了メール送信
  *
  * @param mixed $registSecretKey
  * @access private
  * @return void
  */
 function lfSendRegistMail($registSecretKey)
 {
     $objQuery = SC_Query_Ex::getSingletonInstance();
     $objCustomer = new SC_Customer_Ex();
     $objHelperMail = new SC_Helper_Mail_Ex();
     $CONF = SC_Helper_DB_Ex::sfGetBasisData();
     //-- 会員データを取得
     $arrCustomer = $objQuery->select("*", "dtb_customer", "secret_key = ?", array($registSecretKey));
     $data = $arrCustomer[0];
     $objCustomer->setLogin($data['email']);
     //-- メール送信
     $objMailText = new SC_SiteView_Ex();
     $objMailText->assign('CONF', $CONF);
     $objMailText->assign("name01", $data["name01"]);
     $objMailText->assign("name02", $data["name02"]);
     $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl");
     $subject = $objHelperMail->sfMakesubject('会員登録が完了しました。');
     $objMail = new SC_SendMail();
     $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"]);
     // 宛先の設定
     $name = $data["name01"] . $data["name02"] . " 様";
     $objMail->setTo($data['email'], $name);
     $objMail->sendMail();
 }
コード例 #18
0
ファイル: SC_Helper_Mail.php プロジェクト: nanasess/ec-azure
 /**
  * 指定したIDのメルマガ配送を行う
  *
  * @param integer $send_id dtb_send_history の情報
  * @return void
  */
 function sfSendMailmagazine($send_id)
 {
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $objDb = new SC_Helper_DB_Ex();
     $objSite = $objDb->sfGetBasisData();
     $objMail = new SC_SendMail_Ex();
     $where = 'del_flg = 0 AND send_id = ?';
     $arrMail = $objQuery->getRow('*', 'dtb_send_history', $where, array($send_id));
     // 対象となる$send_idが見つからない
     if (SC_Utils_Ex::isBlank($arrMail)) {
         return;
     }
     // 送信先リストの取得
     $arrDestinationList = $objQuery->select('*', 'dtb_send_customer', 'send_id = ? AND (send_flag = 2 OR send_flag IS NULL)', array($send_id));
     // 現在の配信数
     $complete_count = $arrMail['complete_count'];
     if (SC_Utils_Ex::isBlank($arrMail)) {
         $complete_count = 0;
     }
     foreach ($arrDestinationList as $arrDestination) {
         // お名前の変換
         $customerName = trim($arrDestination['name']);
         $subjectBody = preg_replace("/{name}/", $customerName, $arrMail['subject']);
         $mailBody = preg_replace("/{name}/", $customerName, $arrMail['body']);
         $objMail->setItem($arrDestination['email'], $subjectBody, $mailBody, $objSite["email03"], $objSite["shop_name"], $objSite["email03"], $objSite["email04"], $objSite["email04"]);
         // テキストメール配信の場合
         if ($arrMail["mail_method"] == 2) {
             $sendResut = $objMail->sendMail();
             // HTMLメール配信の場合
         } else {
             $sendResut = $objMail->sendHtmlMail();
         }
         // 送信完了なら1、失敗なら2をメール送信結果フラグとしてDBに挿入
         if (!$sendResut) {
             $sendFlag = '2';
         } else {
             // 完了を 1 増やす
             $sendFlag = '1';
             $complete_count++;
         }
         // 送信結果情報を更新
         $objQuery->update('dtb_send_customer', array('send_flag' => $sendFlag), 'send_id = ? AND customer_id = ?', array($send_id, $arrDestination["customer_id"]));
     }
     // メール全件送信完了後の処理
     $objQuery->update('dtb_send_history', array('end_date' => 'CURRENT_TIMESTAMP', 'complete_count' => $complete_count), 'send_id = ?', array($send_id));
     // 送信完了 報告メール
     $compSubject = date("Y年m月d日H時i分") . "  下記メールの配信が完了しました。";
     // 管理者宛に変更
     $objMail->setTo($objSite["email03"]);
     $objMail->setSubject($compSubject);
     // テキストメール配信の場合
     if ($arrMail["mail_method"] == 2) {
         $sendResut = $objMail->sendMail();
         // HTMLメール配信の場合
     } else {
         $sendResut = $objMail->sendHtmlMail();
     }
     return;
 }
コード例 #19
0
 function lfGetCartData(&$objCart)
 {
     $arrCartKeys = $objCart->getKeys();
     foreach ($arrCartKeys as $cart_key) {
         // 購入金額合計
         $products_total += $objCart->getAllProductsTotal($cart_key);
         // 合計数量
         $total_quantity += $objCart->getTotalQuantity($cart_key);
         // 送料無料チェック
         if (!$this->isMultiple && !$this->hasDownload) {
             $is_deliv_free = $objCart->isDelivFree($cart_key);
         }
     }
     $arrCartList = array();
     $arrCartList['ProductsTotal'] = $products_total;
     $arrCartList['TotalQuantity'] = $total_quantity;
     // 店舗情報の取得
     $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $arrCartList['free_rule'] = $arrInfo['free_rule'];
     // 送料無料までの金額
     if ($is_deliv_free) {
         $arrCartList['deliv_free'] = 0;
     } else {
         $deliv_free = $arrInfo['free_rule'] - $products_total;
         $arrCartList['deliv_free'] = $deliv_free;
     }
     return $arrCartList;
 }
コード例 #20
0
 /**
  * テスト用 会員データ を生成する.
  *
  * @return void
  */
 function createCustomers()
 {
     lfPrintLog("createCustomers START.(" . CUSTOMERS_VOLUME . " data)");
     for ($i = 0; $i < CUSTOMERS_VOLUME; $i++) {
         lfPrintLog("----------");
         lfPrintLog("creating customer data count:[" . ($i + 1) . "] start.");
         $sqlval['name01'] = "検証";
         $sqlval['name02'] = sprintf("太郎%05d", $i + 1);
         $sqlval['kana01'] = "ケンショウ";
         $sqlval['kana02'] = "タロウ";
         $sqlval['zip01'] = '101';
         $sqlval['zip02'] = '0051';
         $sqlval['pref'] = '13';
         // 13:東京都
         $sqlval['addr01'] = "千代田区神田神保町";
         $sqlval['addr02'] = "1-3-5";
         $sqlval['tel01'] = '012';
         $sqlval['tel02'] = '3456';
         $sqlval['tel03'] = '7890';
         $sqlval['email'] = EMAIL_ADDRESS_ACCOUNT . "+" . sprintf("%05d", $i + 1) . EMAIL_ADDRESS_DOMAIN;
         $sqlval['sex'] = '1';
         // 1:男性 2:女性
         $sqlval['password'] = '******';
         $sqlval['reminder'] = '1';
         // 1:「母親の旧姓は?」
         $sqlval['reminder_answer'] = "てすと";
         $sqlval['mailmaga_flg'] = (string) '1';
         // 1:HTMLメール 2:テキストメール 3:希望しない
         // 生年月日の作成
         $sqlval['birth'] = SC_Utils_Ex::sfGetTimestamp(2006, 9, 1);
         // 仮会員 1 本会員 2
         $sqlval['status'] = '2';
         /*
          * secret_keyは、テーブルで重複許可されていない場合があるので、
          * 本会員登録では利用されないがセットしておく。
          */
         $sqlval['secret_key'] = SC_Helper_Customer_Ex::sfGetUniqSecretKey();
         // 入会時ポイント
         $CONF = SC_Helper_DB_Ex::sfGetBasisData();
         $sqlval['point'] = $CONF['welcome_point'];
         // 会員データの生成
         SC_Helper_Customer_Ex::sfEditCustomerData($sqlval);
         print "*";
         lfPrintLog("creating customer data count:[" . ($i + 1) . "] end.");
     }
     print "\n";
     lfPrintLog("createCustomers DONE.(" . CUSTOMERS_VOLUME . " data created)");
 }
コード例 #21
0
 /**
  * 送料無料条件を満たすかどうかチェックする
  *
  * @param  integer $productTypeId 商品種別ID
  * @return boolean 送料無料の場合 true
  */
 public function isDelivFree($productTypeId)
 {
     $objDb = new SC_Helper_DB_Ex();
     $subtotal = $this->getAllProductsTotal($productTypeId);
     // 送料無料の購入数が設定されている場合
     if (DELIV_FREE_AMOUNT > 0) {
         // 商品の合計数量
         $total_quantity = $this->getTotalQuantity($productTypeId);
         if ($total_quantity >= DELIV_FREE_AMOUNT) {
             return true;
         }
     }
     // 送料無料条件が設定されている場合
     $arrInfo = $objDb->sfGetBasisData();
     if ($arrInfo['free_rule'] > 0) {
         // 小計が送料無料条件以上の場合
         if ($subtotal >= $arrInfo['free_rule']) {
             return true;
         }
     }
     return false;
 }
コード例 #22
0
ファイル: LC_Page_Regist.php プロジェクト: casan/eccube-2_13
 /**
  * 正会員登録完了メール送信
  *
  * @param string $registSecretKey
  * @access private
  * @return void
  */
 public function lfSendRegistMail($registSecretKey)
 {
     $objQuery = SC_Query_Ex::getSingletonInstance();
     $objCustomer = new SC_Customer_Ex();
     $objHelperMail = new SC_Helper_Mail_Ex();
     $objHelperMail->setPage($this);
     $CONF = SC_Helper_DB_Ex::sfGetBasisData();
     //-- 会員データを取得
     $arrCustomer = $objQuery->select('*', 'dtb_customer', 'secret_key = ?', array($registSecretKey));
     $data = $arrCustomer[0];
     $objCustomer->setLogin($data['email']);
     //-- メール送信
     $objMailText = new SC_SiteView_Ex();
     $objMailText->setPage($this);
     $objMailText->assign('CONF', $CONF);
     $objMailText->assign('name01', $data['name01']);
     $objMailText->assign('name02', $data['name02']);
     $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl');
     $subject = $objHelperMail->sfMakesubject('会員登録が完了しました。');
     $objMail = new SC_SendMail_Ex();
     $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']);
     // 宛先の設定
     $name = $data['name01'] . $data['name02'] . ' 様';
     $objMail->setTo($data['email'], $name);
     $objMail->sendMail();
 }
コード例 #23
0
 /**
  * メールの送信を行う。
  *
  * @return void
  */
 function lfSendMail(&$objPage)
 {
     $CONF = SC_Helper_DB_Ex::sfGetBasisData();
     $objPage->tpl_shopname = $CONF['shop_name'];
     $objPage->tpl_infoemail = $CONF['email02'];
     $helperMail = new SC_Helper_Mail_Ex();
     $helperMail->setPage($this);
     $helperMail->sfSendTemplateMail($objPage->arrForm['email']['value'], $objPage->arrForm['name01']['value'] . ' 様', 5, $objPage, $CONF['email03'], $CONF['shop_name'], $CONF['email02'], $CONF['email02']);
 }
コード例 #24
0
 /**
  * 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();
 }
コード例 #25
0
 /**
  * 定休日情報をスタティック変数にセット.
  *
  * @return void
  */
 private function setRegularHoliday()
 {
     $arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     SC_Date_Ex::$arrRegularHoliday = explode('|', $arrInfo['regular_holiday_ids']);
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objDb = new SC_Helper_DB_Ex();
     // パラメーター管理クラス
     $objFormParam = new SC_FormParam_Ex();
     // パラメーター情報の初期化
     $this->lfInitParam($objFormParam);
     // POST値の取得
     $objFormParam->setParam($_POST);
     if ($objDb->sfGetBasisExists()) {
         $this->tpl_mode = 'update';
     } else {
         $this->tpl_mode = 'insert';
     }
     if (!empty($_POST)) {
         // 入力値の変換
         $objFormParam->convParam();
         $this->arrErr = $objFormParam->checkError();
         if (count($this->arrErr) == 0) {
             switch ($this->getMode()) {
                 case 'update':
                     $this->lfUpdateData($objFormParam->getHashArray());
                     // 既存編集
                     break;
                 case 'insert':
                     $this->lfInsertData($objFormParam->getHashArray());
                     // 新規作成
                     break;
                 default:
                     break;
             }
             // 再表示
             $this->tpl_onload = "window.alert('ポイント設定が完了しました。');";
         }
     } else {
         $arrRet = $objDb->sfGetBasisData();
         $objFormParam->setParam($arrRet);
     }
     $this->arrForm = $objFormParam->getFormParamList();
 }
コード例 #27
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     unset($_SESSION['order_id']);
 }
コード例 #28
0
 /**
  * ダウンロード販売の検索条件の SQL を返す.
  *
  * @param string $dtb_order_alias
  * @return string 検索条件の SQL
  */
 function getDownloadableDaysWhereSql($dtb_order_alias = 'dtb_order')
 {
     $baseinfo = SC_Helper_DB_Ex::sfGetBasisData();
     //downloadable_daysにNULLが入っている場合(無期限ダウンロード可能時)もあるので、NULLの場合は0日に補正
     $downloadable_days = $baseinfo['downloadable_days'];
     if ($downloadable_days == null || $downloadable_days == "") {
         $downloadable_days = 0;
     }
     return "(SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND " . $dtb_order_alias . ".payment_date IS NOT NULL THEN 1 WHEN DATE(CURRENT_TIMESTAMP) <= DATE(" . $dtb_order_alias . ".payment_date + '" . $downloadable_days . " days') THEN 1 ELSE 0 END)";
 }
コード例 #29
0
 /**
  * Page のアクション.
  *
  * @return void
  */
 function action()
 {
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objFormParam = new SC_FormParam_Ex();
     // パラメータ情報の初期化
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_REQUEST);
     $objFormParam->convParam();
     $order_id = $objFormParam->getValue('order_id');
     // DBから受注情報を読み込む
     $this->setOrderToFormParam($objFormParam, $order_id);
     $this->arrForm = $objFormParam->getFormParamList();
     $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys));
     $this->arrDelivTime = $objPurchase->getDelivTime($objFormParam->getValue('deliv_id'));
     $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
     $this->setTemplate($this->tpl_mainpage);
 }
コード例 #30
0
 /**
  * 秘密の質問確認
  *
  * @param array $arrForm フォーム入力値
  * @param array $arrReminder リマインダー質問リスト
  * @return string エラー文字列 問題が無ければNULL
  */
 function lfCheckForgotSecret(&$arrForm, &$arrReminder)
 {
     $errmsg = '';
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $cols = 'customer_id, reminder, reminder_answer, salt';
     $table = 'dtb_customer';
     $where = '(email Like ? OR email_mobile Like ?)' . ' AND name01 Like ? AND name02 Like ?' . ' AND status = 2 AND del_flg = 0';
     $arrVal = array($arrForm['email'], $arrForm['email'], $arrForm['name01'], $arrForm['name02']);
     $result = $objQuery->select($cols, $table, $where, $arrVal);
     if (isset($result[0]['reminder']) and isset($arrReminder[$result[0]['reminder']]) and $result[0]['reminder'] == $arrForm['reminder']) {
         $is_authorized = false;
         if (empty($result[0]['salt'])) {
             // 旧バージョン(2.11未満)からの移行を考慮
             if ($result[0]['reminder_answer'] == $arrForm['reminder_answer']) {
                 $is_authorized = true;
             }
         } elseif (SC_Utils_Ex::sfIsMatchHashPassword($arrForm['reminder_answer'], $result[0]['reminder_answer'], $result[0]['salt'])) {
             $is_authorized = true;
         }
         if ($is_authorized) {
             // 秘密の答えが一致
             // 新しいパスワードを設定する
             $new_password = GC_Utils_Ex::gfMakePassword(8);
             if (FORGOT_MAIL == 1) {
                 // メールで変更通知をする
                 $objDb = new SC_Helper_DB_Ex();
                 $CONF = $objDb->sfGetBasisData();
                 $this->lfSendMail($CONF, $arrForm['email'], $arrForm['name01'], $new_password);
             }
             $sqlval = array();
             $sqlval['password'] = $new_password;
             SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $result[0]['customer_id']);
             $arrForm['new_password'] = $new_password;
         } else {
             // 秘密の答えが一致しなかった
             $errmsg = '秘密の質問が一致しませんでした。';
         }
     } else {
         //不正なアクセス リマインダー値が前画面と異なる。
         // 新リファクタリング基準ではここで遷移は不許可なのでエラー表示
         //SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
         $errmsg = '秘密の質問が一致しませんでした。';
     }
     return $errmsg;
 }