/** * お届け先を登録 * * @param array $sqlval * @return array() */ function registAddress($sqlval) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $customer_id = $sqlval['customer_id']; $other_deliv_id = $sqlval['other_deliv_id']; // 顧客IDのチェック if (is_null($customer_id) || !is_numeric($customer_id) || !preg_match("/^\\d+\$/", $customer_id)) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '顧客IDを正しく指定して下さい。'); } // 追加 if (strlen($other_deliv_id == 0)) { // 別のお届け先登録数の取得 $deliv_count = $objQuery->count('dtb_other_deliv', 'customer_id = ?', array($customer_id)); // 別のお届け先最大登録数に達している場合、エラー if ($deliv_count >= DELIV_ADDR_MAX) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); } // 実行 $sqlval['other_deliv_id'] = $objQuery->nextVal('dtb_other_deliv_other_deliv_id'); $objQuery->insert('dtb_other_deliv', $sqlval); // 変更 } else { $deliv_count = $objQuery->count('dtb_other_deliv', 'other_deliv_id = ?', array($other_deliv_id)); if ($deliv_count != 1) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '一致する別のお届け先がありません。'); } // 実行 $objQuery->update('dtb_other_deliv', $sqlval, 'other_deliv_id = ?', array($other_deliv_id)); } }
/** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $objDb = new SC_Helper_DB_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; //受注データの取得 $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 $this->arrPayment = $objDb->sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method'); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail); $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail); // モバイルダウンロード対応処理 $this->lfSetAU($this->tpl_arrOrderDetail); // 受注メール送信履歴の取得 $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id); }
/** * 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; } }
/** * 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 mobileProcess() { $objView = new SC_MobileView(); $objQuery = new SC_Query(); $objCustomer = new SC_Customer(); $objDb = new SC_Helper_DB_Ex(); //不正アクセス判定 $from = "dtb_order"; $where = "del_flg = 0 AND customer_id = ? AND order_id = ? "; $arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']); //DBに情報があるか判定 $cnt = $objQuery->count($from, $where, $arrval); //ログインしていない、またはDBに情報が無い場合 if (!$objCustomer->isLoginSuccess(true) or $cnt == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } else { //受注詳細データの取得 $this->arrDisp = $this->lfGetOrderData($_POST['order_id']); // 支払い方法の取得 $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); // 配送時間の取得 $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']); $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time'); //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * * @param Mobile_Detect $detect */ function check_os() { $detect = new Mobile_Detect(); if ($detect->is("iOS")) { // OK } else { SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); } }
/** * 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 */ 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 */ function process() { $order_id = $this->getOrderId(); if ($order_id === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); return; } $module_path = $this->getModulePath($order_id); if ($module_path === false) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "モジュールファイルの取得に失敗しました。<br />この手続きは無効となりました。"); return; } require_once $module_path; }
/** * Page のプロセス. * * @return void */ function process() { $order_id = $this->getOrderId(); if ($order_id === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); return; } $module_path = $this->getModulePath($order_id); if ($module_path === false) { $msg = t('c_Module file retrieval failed. <br /> This procedure has been voided._01'); SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, $msg); return; } require_once $module_path; }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objSess = new SC_Session(); SC_Utils_Ex::sfIsSuccess($objSess); if (isset($_SESSION['preview']) && $_SESSION['preview'] === "ON") { // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, true); // 画面の表示 $objView->assignobj($this); $objView->display(SITE_FRAME); return; } SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", false, "", true); }
/** * Page のAction. * * @return void */ public 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(); } if (!$objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'), $customer_id)) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); SC_Response_Ex::actionExit(); } 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; }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objQuery = new SC_Query(); // secret_keyの取得 $key = $_GET['id']; if (empty($key) or !$this->lfExistKey($key, $objQuery)) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", false, "", true); } else { $this->lfChangeData($key, $objQuery); } // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); $objView = new SC_MobileView(); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス. * * @return void */ public function process() { parent::process(); $objView = new SC_SiteView_Ex(); $objSess = new SC_Session_Ex(); SC_Utils_Ex::sfIsSuccess($objSess); if (isset($_SESSION['preview']) && $_SESSION['preview'] === 'ON') { // プレビュー用のレイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, true); // 画面の表示 $objView->assignobj($this); $objView->display(SITE_FRAME); return; } SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objCustomer = new SC_Customer(); $objCartSess = new SC_CartSession(); //受注詳細データの取得 $arrDisp = $this->lfGetOrderDetail($_POST['order_id']); //ログインしていない、またはDBに情報が無い場合 if (!$objCustomer->isLoginSuccess(true) or count($arrDisp) == 0) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } for ($num = 0; $num < count($arrDisp); $num++) { $product_id = $arrDisp[$num]['product_id']; $cate_id1 = $arrDisp[$num]['classcategory_id1']; $cate_id2 = $arrDisp[$num]['classcategory_id2']; $quantity = $arrDisp[$num]['quantity']; $objCartSess->addProduct(array($product_id, $cate_id1, $cate_id2), $quantity); } $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); }
/** * Page のプロセス. * * @return void */ function process() { global $objCampaignSess; $objView = new SC_SiteView(); $objCampaignSess = new SC_CampaignSession(); // transaction check if (!$this->isValidToken()) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); } // レイアウトデザインを取得 $layout = new SC_Helper_PageLayout_Ex(); $layout->sfGetPageLayout($this, false, DEF_LAYOUT); // キャンペーンからの遷移がチェック $this->is_campaign = $objCampaignSess->getIsCampaign(); $this->campaign_dir = $objCampaignSess->getCampaignDir(); $objView->assignobj($this); // フレームを選択(キャンペーンページから遷移なら変更) $objCampaignSess->pageView($objView); }
/** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); $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); exit; } $this->deleteOtherDeliv($customer_id, $objFormParam->getValue('other_deliv_id')); break; // スマートフォン版のもっと見るボタン用 // スマートフォン版のもっと見るボタン用 case 'getList': $arrData = $objFormParam->getHashArray(); //別のお届け先情報 $arrOtherDeliv = $this->getOtherDeliv($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); exit; break; // お届け先の表示 // お届け先の表示 default: break; } //別のお届け先情報 $this->arrOtherDeliv = $this->getOtherDeliv($customer_id); //お届け先登録数 $this->tpl_linemax = count($this->arrOtherDeliv); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $objProduct = new SC_Product(); if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; $this->is_price_change = false; //受注データの取得 $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); foreach ($this->tpl_arrOrderDetail as $product_index => $arrOrderProductDetail) { //必要なのは商品の販売金額のみなので、遅い場合は、別途SQL作成した方が良い $arrTempProductDetail = $objProduct->getProductsClass($arrOrderProductDetail['product_class_id']); // 税計算 $this->tpl_arrOrderDetail[$product_index]['price_inctax'] = $this->tpl_arrOrderDetail[$product_index]['price'] + SC_Helper_TaxRule_Ex::calcTax($this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule']); $arrTempProductDetail['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrTempProductDetail['price02'], $arrTempProductDetail['product_id'], $arrTempProductDetail['product_class_id']); if ($this->tpl_arrOrderDetail[$product_index]['price_inctax'] != $arrTempProductDetail['price02_inctax']) { $this->is_price_change = true; } $this->tpl_arrOrderDetail[$product_index]['product_price_inctax'] = $arrTempProductDetail['price02_inctax'] ? $arrTempProductDetail['price02_inctax'] : 0; } $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail); $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail); // モバイルダウンロード対応処理 $this->lfSetAU($this->tpl_arrOrderDetail); // 受注メール送信履歴の取得 $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id); }
/** * Page のプロセス. * * @return void */ function process() { $objCustomer = new SC_Customer(); //ログインしていない場合 if (!$objCustomer->isLoginSuccess()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } else { //ログインしている場合 //DBから商品情報の読込 $arrForm = $this->lfGetRealFileName($_GET['product_id']); //ステータスが支払済み以上である事 if ($arrForm["status"] < ORDER_DELIV) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //ファイル情報が無い場合はNG if ($arrForm["realfilename"] == "") { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //ファイルそのものが無い場合もとりあえずNG $realpath = DOWN_SAVE_DIR . $arrForm["realfilename"]; if (!file_exists($realpath)) { SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, "", true); } //タイプ指定 header("Content-Type: Application/octet-stream"); //ファイル名指定 header("Content-Disposition: attachment; filename=" . $arrForm["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); //ファイル読み込み readfile($realpath); } }
/** * 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(); $objAddress = new SC_Helper_Address_Ex(); // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); SC_Response_Ex::actionExit(); } $this->tpl_uniqid = $objSiteSess->getUniqId(); $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $objAddress, $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, $objAddress); $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect('payment.php'); SC_Response_Ex::actionExit(); } break; default: $this->setParamToSplitItems($objFormParam, $objCartSess); } // 前のページから戻ってきた場合 if ($_GET['from'] == 'multiple') { $objFormParam->setParam($_SESSION['multiple_temp']); } $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objCustomer = new SC_Customer(); //ログイン判定 if (!$objCustomer->isLoginSuccess()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } else { //マイページトップ顧客情報表示用 $this->CustomerName1 = $objCustomer->getvalue('name01'); $this->CustomerName2 = $objCustomer->getvalue('name02'); $this->CustomerPoint = $objCustomer->getvalue('point'); } // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, "mypage/index.php"); $mode = isset($_POST['mode']) ? $_POST['mode'] : ''; $customerId = $objCustomer->getValue('customer_id'); switch ($mode) { // お届け先の削除 case 'delete': $objForm = $this->initParam(); if ($objForm->checkError()) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); exit; } $this->deleteOtherDeliv($customerId, $objForm->getValue('other_deliv_id')); break; // お届け先の表示 // お届け先の表示 default: break; } //別のお届け先情報 $this->arrOtherDeliv = $this->getOtherDeliv($customerId); //お届け先登録数 $this->tpl_linemax = count($this->arrOtherDeliv); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス. * * @return void */ function process() { $objView = new SC_SiteView(); $objCartSess = new SC_CartSession("", false); $objDb = new SC_Helper_DB_Ex(); // 管理ページからの確認の場合は、非公開の商品も表示する。 if (isset($_GET['admim']) && $_GET['admin'] == 'on') { $where = "del_flg = 0"; } else { $where = "del_flg = 0 AND status = 1"; } // 値の正当性チェック if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) { SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); } $image_key = $_GET['image']; $objQuery = new SC_Query(); // カラムが存在していなければエラー画面を表示 if (!$objDb->sfColumnExists("dtb_products", $image_key)) { SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); } $col = "name, {$image_key}"; $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id'])); $image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key]; if (file_exists($image_path)) { list($width, $height) = getimagesize($image_path); } else { $width = 0; $height = 0; } $this->tpl_width = $width; $this->tpl_height = $height; $this->tpl_table_width = $this->tpl_width + 20; $this->tpl_table_height = $this->tpl_height + 20; $this->tpl_image = $arrRet[0][$image_key]; $this->tpl_name = $arrRet[0]['name']; $objView->assignobj($this); $objView->display($this->tpl_mainpage); }
/** * 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; } }
/** * モバイル端末以外ダウンロード処理 * * @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(); }
/** * DOMを用いた変形を実行する * * @param string $mode 実行するメソッドの種類 * @param string $target_key 対象のエレメントの完全なセレクタ * @param string $html_snip HTMLコード * @return boolean */ protected function lfSetTransform($mode, $target_key, $html_snip) { $substitute_tag = sprintf('<!--###%08d###-->', $this->smarty_tags_idx); $this->arrSmartyTagsOrg[$this->smarty_tags_idx] = $html_snip; $this->arrSmartyTagsSub[$this->smarty_tags_idx] = $substitute_tag; $this->smarty_tags_idx++; $this->objDOM->createDocumentFragment(); $objSnip = $this->objDOM->createDocumentFragment(); $objSnip->appendXML($substitute_tag); $objElement = false; if (isset($this->arrElementTree[$target_key]) && $this->arrElementTree[$target_key][0]) { $objElement =& $this->arrElementTree[$target_key][1]; } if (!$objElement) { return false; } try { switch ($mode) { case 'appendFirst': if ($objElement->hasChildNodes()) { $objElement->insertBefore($objSnip, $objElement->firstChild); } else { $objElement->appendChild($objSnip); } break; case 'appendChild': $objElement->appendChild($objSnip); break; case 'insertBefore': if (!is_object($objElement->parentNode)) { return false; } $objElement->parentNode->insertBefore($objSnip, $objElement); break; case 'insertAfter': if ($objElement->nextSibling) { $objElement->parentNode->insertBefore($objSnip, $objElement->nextSibling); } else { $objElement->parentNode->appendChild($objSnip); } break; case 'replaceElement': if (!is_object($objElement->parentNode)) { return false; } $objElement->parentNode->replaceChild($objSnip, $objElement); break; default: break; } $this->snip_count++; } catch (Exception $e) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, t("c_Template operation failed._01")); } return true; }
/** * Page のAction. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); switch ($this->getMode()) { case 'confirm': $this->arrErr = $this->lfCheckError($objFormParam); //エラーチェック if (empty($this->arrErr)) { //重複タイトルでない $this->tpl_mainpage = 'products/review_confirm.tpl'; } break; case 'return': break; case 'complete': $this->arrErr = $this->lfCheckError($objFormParam); //エラーチェック if (empty($this->arrErr)) { //登録実行 $this->lfRegistRecommendData($objFormParam); //レビュー書き込み完了ページへ SC_Response_Ex::sendRedirect('review_complete.php'); SC_Response_Ex::actionExit(); } break; default: // 最初のproduct_idは、$_GETで渡ってくる。 $objFormParam->setParam($_GET); break; } $this->arrForm = $objFormParam->getHashArray(); //商品名の取得 $this->arrForm['name'] = $this->lfGetProductName($this->arrForm['product_id']); if (empty($this->arrForm['name'])) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); } $this->setTemplate($this->tpl_mainpage); }
/** * @param SC_FormParam $objFormParam */ public function lfRegistDataNonMember($objFormParam) { $arrRegistColumn = $objFormParam->getDbArray(); foreach ($arrRegistColumn as $key => $val) { $arrRegist['shipping_' . $key] = $val; } if (count($_SESSION['shipping']) >= DELIV_ADDR_MAX) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); } else { $_SESSION['shipping'][] = $arrRegist; } }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objDb = new SC_Helper_DB_Ex(); $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 $objConn = new SC_DbConn(); $objView = new SC_MobileView(); $this->objDate = new SC_Date(START_BIRTH_YEAR, date("Y", strtotime("now"))); $this->arrYear = $this->objDate->getYear(); $this->arrMonth = $this->objDate->getMonth(); $this->arrDay = $this->objDate->getDay(); $this->objQuery = new SC_Query(); $this->objCustomer = new SC_Customer(); //メールアドレス種別 $arrMailType = array("email" => true, "email_mobile" => true); //---- 登録用カラム配列 $arrRegistColumn = array(array("column" => "name01", "convert" => "aKV"), array("column" => "name02", "convert" => "aKV"), array("column" => "kana01", "convert" => "CKV"), array("column" => "kana02", "convert" => "CKV"), array("column" => "zip01", "convert" => "n"), array("column" => "zip02", "convert" => "n"), array("column" => "pref", "convert" => "n"), array("column" => "addr01", "convert" => "aKV"), array("column" => "addr02", "convert" => "aKV"), array("column" => "email", "convert" => "a"), array("column" => "email_mobile", "convert" => "a"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"), array("column" => "fax01", "convert" => "n"), array("column" => "fax02", "convert" => "n"), array("column" => "fax03", "convert" => "n"), array("column" => "sex", "convert" => "n"), array("column" => "job", "convert" => "n"), array("column" => "birth", "convert" => "n"), array("column" => "reminder", "convert" => "n"), array("column" => "reminder_answer", "convert" => "aKV"), array("column" => "password", "convert" => "a"), array("column" => "mailmaga_flg", "convert" => "n")); //---- 登録除外用カラム配列 $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); $this->arrForm = $this->lfGetCustomerData(); $this->arrForm['password'] = DEFAULT_PASSWORD; if ($_SERVER["REQUEST_METHOD"] == "POST") { //-- POSTデータの引き継ぎ $this->arrForm = array_merge($this->arrForm, $_POST); if (!isset($this->arrForm['year'])) { $this->arrForm['year'] = ""; } if ($this->arrForm['year'] == '----') { $this->arrForm['year'] = ''; } //-- 入力データの変換 $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn); // 戻るボタン用処理 if (!empty($_POST["return"])) { switch ($_POST["mode"]) { case "complete": $_POST["mode"] = "set3"; break; case "confirm": $_POST["mode"] = "set2"; break; default: $_POST["mode"] = "set1"; break; } } //-- 入力エラーチェック if ($_POST["mode"] == "set1") { $this->arrErr = $this->lfErrorCheck1($this->arrForm); $this->tpl_mainpage = 'mypage/change.tpl'; $this->tpl_title = '登録変更(1/3)'; } elseif ($_POST["mode"] == "set2") { $this->arrErr = $this->lfErrorCheck2($this->arrForm); $this->tpl_mainpage = 'mypage/set1.tpl'; $this->tpl_title = '登録変更(2/3)'; } else { $this->arrErr = $this->lfErrorCheck3($this->arrForm); $this->tpl_mainpage = 'mypage/set2.tpl'; $this->tpl_title = '登録変更(3/3)'; } if ($this->arrErr || !empty($_POST["return"])) { // 入力エラーのチェック //-- データの設定 if ($_POST["mode"] == "set1") { $checkVal = array("email", "email_mobile", "password", "reminder", "reminder_answer", "name01", "name02", "kana01", "kana02"); } elseif ($_POST["mode"] == "set2") { $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); } else { $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); } foreach ($this->arrForm as $key => $val) { if ($key != "return" && $key != "mode" && $key != "confirm" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } } else { //-- テンプレート設定 if ($_POST["mode"] == "set1") { $this->tpl_mainpage = 'mypage/set1.tpl'; $this->tpl_title = '登録変更(2/3)'; } elseif ($_POST["mode"] == "set2") { $this->tpl_mainpage = 'mypage/set2.tpl'; $this->tpl_title = '登録変更(3/3)'; } elseif ($_POST["mode"] == "confirm") { //パスワード表示 $passlen = strlen($this->arrForm['password']); $this->passlen = $this->lfPassLen($passlen); // メール受け取り if (!isset($_POST['mailmaga_flg'])) { $_POST['mailmaga_flg'] = ""; } if (strtolower($_POST['mailmaga_flg']) == "on") { $this->arrForm['mailmaga_flg'] = "2"; } else { $this->arrForm['mailmaga_flg'] = "3"; } $this->tpl_mainpage = 'mypage/change_confirm.tpl'; $this->tpl_title = '登録変更(確認ページ)'; } //-- データ設定 unset($this->list_data); if ($_POST["mode"] == "set1") { $checkVal = array("sex", "year", "month", "day", "zip01", "zip02"); } elseif ($_POST["mode"] == "set2") { $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mailmaga_flg"); } else { $checkVal = array(); } foreach ($this->arrForm as $key => $val) { if ($key != "return" && $key != "mode" && $key != "confirm" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } //-- 仮登録と完了画面 if ($_POST["mode"] == "complete") { //エラーなしでかつメールアドレスが重複していない場合 if ($this->checkErrorTotal($arrRegistColumn, $arrMailType, true)) { $this->arrForm['customer_id'] = $this->objCustomer->getValue('customer_id'); //-- 編集登録 $objDb->sfEditCustomerData($this->arrForm, $arrRegistColumn); //セッション情報を最新の状態に更新する $this->objCustomer->updateSession(); //完了ページへ $this->sendRedirect($this->getLocation("./change_complete.php"), true); exit; } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } } } } $arrPrivateVariables = array('secret_key', 'first_buy_date', 'last_buy_date', 'buy_times', 'buy_total', 'point', 'note', 'status', 'create_date', 'update_date', 'del_flg', 'cell01', 'cell02', 'cell03', 'mobile_phone_id'); foreach ($arrPrivateVariables as $key) { unset($this->list_data[$key]); } //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のアクション. * * @return void */ function action() { $objDb = new SC_Helper_DB_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : ''; switch ($this->getMode()) { case 'confirm': // エラーチェック $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $objFormParam->toLower('email'); $objFormParam->toLower('email02'); $this->arrErr = $this->lfCheckError($objFormParam); // 入力値の取得 $this->arrForm = $objFormParam->getFormParamList(); if (SC_Utils_Ex::isBlank($this->arrErr)) { // エラー無しで完了画面 $this->tpl_mainpage = 'contact/confirm.tpl'; $this->tpl_title = 'お問い合わせ(確認ページ)'; } break; case 'return': $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrForm = $objFormParam->getFormParamList(); break; case 'complete': $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); $this->arrForm = $objFormParam->getFormParamList(); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->lfSendMail($this); // 完了ページへ移動する SC_Response_Ex::sendRedirect('complete.php'); SC_Response_Ex::actionExit(); } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); SC_Response_Ex::actionExit(); } break; default: break; } }