/**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     global $objCampaignSess;
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $objCampaignSess = new SC_CampaignSession();
     // キャンペーンからの登録の場合の処理
     if ($_GET["cp"] != "") {
         $arrCampaign = $objQuery->select("directory_name", "dtb_campaign", "campaign_id = ?", array($_GET["cp"]));
         // キャンペーンディレクトリ名を保持
         $dir_name = $arrCampaign[0]['directory_name'];
     } else {
         $dir_name = "";
     }
     // レイアウトデザインを取得
     $helper = new SC_Helper_PageLayout_Ex();
     $helper->sfGetPageLayout($this, false, DEF_LAYOUT);
     $objView->assignobj($this);
     // フレームを選択(キャンペーンページから遷移なら変更)
     if ($this->dir_name != "") {
         $objView->display(CAMPAIGN_TEMPLATE_PATH . $dir_name . "/active/site_frame.tpl");
         $objCampaignSess->delCampaign();
     } else {
         $objView->display(SITE_FRAME);
     }
 }
Esempio n. 2
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     // ログイン判定
     if ($objCustomer->isLoginSuccess()) {
         $this->sendRedirect($this->getLocation("./index.php"));
         exit;
     } else {
         // クッキー判定
         $this->tpl_login_email = $objCookie->getCookie('login_email');
         if ($this->tpl_login_email != "") {
             $this->tpl_login_memory = "1";
         }
         // POSTされてきたIDがある場合は優先する。
         if (isset($_POST['mypage_login_email']) && $_POST['mypage_login_email'] != "") {
             $this->tpl_login_email = $_POST['mypage_login_email'];
         }
     }
     //$objpage内の全てのテンプレート変数をsmartyに格納
     $objView->assignobj($this);
     //パスとテンプレート変数の呼び出し、実行
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView(false);
     $objQuery = new SC_Query();
     // 正しく値が取得できない場合はキャンペーンTOPへ
     if ($_GET['campaign_id'] == "" || $_GET['status'] == "") {
         $this->sendRedirect($this->getLocation(URL_CAMPAIGN_TOP));
         exit;
     }
     // statusの判別
     switch ($_GET['status']) {
         case 'active':
             $status = CAMPAIGN_TEMPLATE_ACTIVE;
             break;
         case 'end':
             $status = CAMPAIGN_TEMPLATE_END;
             break;
         default:
             $status = CAMPAIGN_TEMPLATE_ACTIVE;
             break;
     }
     // ディレクトリ名を取得名
     $directory_name = $objQuery->get("dtb_campaign", "directory_name", "campaign_id = ?", array($_GET['campaign_id']));
     $template_dir = CAMPAIGN_TEMPLATE_PATH . $directory_name . "/" . $status . "preview.tpl";
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display($template_dir);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objCustomer = new SC_Customer();
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     // ログイン判定
     if ($objCustomer->isLoginSuccess()) {
         $this->tpl_login = true;
         $this->tpl_user_point = $objCustomer->getValue('point');
         $this->tpl_name1 = $objCustomer->getValue('name01');
         $this->tpl_name2 = $objCustomer->getValue('name02');
     } else {
         // クッキー判定
         $this->tpl_login_email = $objCookie->getCookie('login_email');
         if ($this->tpl_login_email != "") {
             $this->tpl_login_memory = "1";
         }
         // POSTされてきたIDがある場合は優先する。
         if ($_POST['login_email'] != "") {
             $this->tpl_login_email = $_POST['login_email'];
         }
     }
     $this->tpl_disable_logout = $this->lfCheckDisableLogout();
     $objSubView = new SC_SiteView();
     $this->transactionid = $this->getToken();
     $objSubView->assignobj($this);
     $objSubView->display($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     // ランキングの取得
     $this->arrRanking = $this->getRanking();
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
     //var_dump(getRanking());
 }
Esempio n. 6
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     // レイアウトデザインを取得
     $layout = new SC_Helper_PageLayout_Ex();
     $layout->sfGetPageLayout($this, false, "index.php");
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
Esempio n. 7
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objLayout = new SC_Helper_PageLayout_Ex();
     // レイアウトデザインを取得
     $objLayout->sfGetPageLayout($this);
     // 画面の表示
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objSubView = new SC_SiteView();
     $objDb = new SC_Helper_DB_Ex();
     // 選択中のカテゴリIDを判定する
     $arrCategory_id = $objDb->sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
     // 選択中のカテゴリID
     $this->tpl_category_id = empty($arrCategory_id) ? array(0) : $arrCategory_id;
     $this->lfGetCatTree($this->tpl_category_id, true, $this);
     $objSubView->assignobj($this);
     $objSubView->display($this->tpl_mainpage);
 }
Esempio n. 9
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $layout = new SC_Helper_PageLayout_Ex();
     $objDb = new SC_Helper_DB_Ex();
     // レイアウトデザインを取得
     $layout->sfGetPageLayout($this, false, DEF_LAYOUT);
     $this->arrRet = $objDb->sf_getBasisData();
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     //マイページトップ顧客情報表示用
     $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");
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
Esempio n. 11
0
 /**
  * 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 のプロセス.
  *
  * @return void
  */
 function process()
 {
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $objView = new SC_MobileView();
     } else {
         $objView = new SC_SiteView();
     }
     // 休日取得取得
     $this->arrHoliday = $this->lfGetHoliday();
     // 定休日取得取得
     $this->arrRegularHoliday = $this->lfGetRegularHoliday();
     // カレンダーデータ取得
     $this->arrCalendar = $this->lfGetCalendar(2);
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $objView = new SC_MobileView();
     } else {
         $objView = new SC_SiteView();
     }
     $objSiteInfo = $objView->objSiteInfo;
     // 基本情報を渡す
     $objSiteInfo = new SC_SiteInfo();
     $this->arrInfo = $objSiteInfo->data;
     //おすすめ商品表示
     $this->arrBestProducts = $this->lfGetRanking();
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     // レイアウトデザインを取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objLayout->sfGetPageLayout($this, false, "mypage/index.php");
     //ログイン判定
     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');
     }
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $arrSearch = array();
     // 検索項目表示用
     $objDb = new SC_Helper_DB_Ex();
     // 選択中のカテゴリIDを判定する
     $this->category_id = $objDb->sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
     // カテゴリ検索用選択リスト
     $arrRet = $objDb->sfGetCategoryList('', true, ' ');
     if (is_array($arrRet)) {
         // 文字サイズを制限する
         foreach ($arrRet as $key => $val) {
             $arrRet[$key] = SC_Utils_Ex::sfCutString($val, SEARCH_CATEGORY_LEN, false);
         }
     }
     $this->arrCatList = $arrRet;
     $objSubView = new SC_SiteView();
     $objSubView->assignobj($this);
     $objSubView->display($this->tpl_mainpage);
 }
Esempio n. 16
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objQuery = new SC_Query();
     $objView = new SC_SiteView(false);
     //新着情報を取得
     $arrNews = $this->lfGetNews($objQuery);
     //キャッシュしない(念のため)
     header("pragma: no-cache");
     //XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため)
     header("Content-type: application/xml");
     //新着情報をセット
     $this->arrNews = $arrNews;
     $this->timestamp = SC_Utils_Ex::sf_mktime("r", $arrNews[0]['hour'], $arrNews[0]['minute'], $arrNews[0]['second'], $arrNews[0]['month'], $arrNews[0]['day'], $arrNews[0]['year']);
     //店名をセット
     $this->site_title = $arrNews[0]['shop_name'];
     //代表Emailアドレスをセット
     $this->email = $arrNews[0]['email'];
     //セットしたデータをテンプレートファイルに出力
     $objView->assignobj($this);
     //画面表示
     $objView->display($this->tpl_mainpage, true);
 }
Esempio n. 17
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objQuery = new SC_Query();
     $objView = new SC_SiteView();
     $objSiteInfo = new SC_SiteInfo();
     //店舗情報をセット
     $arrSiteInfo = $objSiteInfo->data;
     //商品IDを取得
     $product_id = $_GET['product_id'];
     $mode = $_GET['mode'];
     if ($product_id != "" and is_numeric($product_id) or $mode == "all") {
         //商品詳細を取得
         $mode == "all" ? $arrProduct = $this->lfGetProductsDetail($objQuery, $mode) : ($arrProduct = $this->lfGetProductsDetail($objQuery, $product_id));
         // 値のセットし直し
         foreach ($arrProduct as $key => $val) {
             //商品価格を税込みに編集
             $arrProduct[$key]["price02"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
             // 画像ファイルのURLセット
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"];
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_image"] = $dir . $arrProduct[$key]["main_image"];
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_large_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"];
             // ポイント計算
             $arrProduct[$key]["point"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
             // 在庫無制限
             $arrProduct[$key]["stock_unlimited"] = $arrProduct[$key]["stock_unlimited"] == 1 ? "在庫無制限" : NULL;
         }
     } elseif ($mode == "list") {
         //商品一覧を取得
         $arrProduct = $objQuery->getall("SELECT product_id, name AS product_name FROM dtb_products");
     } else {
         $arrProduct = $this->lfGetProductsAllclass($objQuery);
         // 値のセットし直し
         foreach ($arrProduct as $key => $val) {
             //商品価格を税込みに編集
             $arrProduct[$key]["price01_max"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price01_max"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
             $arrProduct[$key]["price01_min"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price01_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
             $arrProduct[$key]["price02_max"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02_max"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
             $arrProduct[$key]["price02_min"] = SC_Utils_Ex::sfPreTax($arrProduct[$key]["price02_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]);
             // 画像ファイルのURLセット
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"];
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_image"] = $dir . $arrProduct[$key]["main_image"];
             file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_large_image"]) ? $dir = IMAGE_SAVE_URL_RSS : ($dir = IMAGE_TEMP_URL_RSS);
             $arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"];
             // ポイント計算
             $arrProduct[$key]["point_max"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02_max"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
             $arrProduct[$key]["point_min"] = SC_Utils_Ex::sfPrePoint($arrProduct[$key]["price02_min"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
         }
     }
     //商品情報をセット
     $this->arrProduct = $arrProduct;
     if (is_array(SC_Utils_Ex::sfswaparray($arrProduct))) {
         $this->arrProductKeys = array_keys(SC_Utils_Ex::sfswaparray($arrProduct));
     }
     //店舗情報をセット
     $this->arrSiteInfo = $arrSiteInfo;
     //セットしたデータをテンプレートファイルに出力
     $objView->assignobj($this);
     //キャッシュしない(念のため)
     header("Pragma: no-cache");
     //XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため)
     header("Content-type: application/xml");
     DETAIL_P_HTML;
     //画面表示
     $objView->display($this->tpl_mainpage, true);
 }
Esempio n. 18
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = null;
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $objView = new SC_MobileView();
     } else {
         $objView = new SC_SiteView();
     }
     $objSess = new SC_Session();
     // 店舗基本情報を取得
     $objDb = new SC_Helper_DB_Ex();
     $CONF = $objDb->sf_getBasisData();
     $masterData = new SC_DB_MasterData_Ex();
     $arrReminder = $masterData->getMasterData("mtb_reminder");
     // クッキー管理クラス
     $objCookie = new SC_Cookie(COOKIE_EXPIRE);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (!isset($_POST['email'])) {
         $_POST['email'] = "";
     }
     if ($_POST['mode'] == 'mail_check') {
         //メアド入力時
         $_POST['email'] = strtolower($_POST['email']);
         // FIXME DBチェックの前に妥当性チェックするべき
         $sql = "SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0";
         $result = $conn->getAll($sql, array($_POST['email'], $_POST['email']));
         // 本会員登録済みの場合
         if (isset($result[0]['reminder']) && $result[0]['reminder']) {
             // 入力emailが存在する
             $_SESSION['forgot']['email'] = $_POST['email'];
             $_SESSION['forgot']['reminder'] = $result[0]['reminder'];
             // ヒミツの答え入力画面
             $this->Reminder = $arrReminder[$_SESSION['forgot']['reminder']];
             $this->tpl_mainpage = 'forgot/secret.tpl';
         } else {
             $sql = "SELECT customer_id FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0";
             //仮登録中の確認
             $result = $conn->getAll($sql, array($_POST['email'], $_POST['email']));
             if ($result) {
                 $this->errmsg = "ご入力のemailアドレスは現在仮登録中です。<br>登録の際にお送りしたメールのURLにアクセスし、<br>本会員登録をお願いします。";
             } else {
                 // 登録していない場合
                 $this->errmsg = "ご入力のemailアドレスは登録されていません";
             }
         }
     } elseif ($_POST['mode'] == 'secret_check') {
         //ヒミツの答え入力時
         if ($_SESSION['forgot']['email']) {
             // ヒミツの答えの回答が正しいかチェック
             $sql = "SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND del_flg = 0";
             $result = $conn->getAll($sql, array($_SESSION['forgot']['email'], $_SESSION['forgot']['email']));
             $data = $result[0];
             if ($data['reminder_answer'] === $_POST['input_reminder']) {
                 // ヒミツの答えが正しい
                 // 新しいパスワードを設定する
                 $this->temp_password = GC_Utils_Ex::gfMakePassword(8);
                 if (FORGOT_MAIL == 1) {
                     // メールで変更通知をする
                     $this->lfSendMail($CONF, $_SESSION['forgot']['email'], $data['name01'], $this->temp_password);
                 }
                 // DBを書き換える
                 $sql = "UPDATE dtb_customer SET password = ?, update_date = now() WHERE customer_id = ?";
                 $conn->query($sql, array(sha1($this->temp_password . ":" . AUTH_MAGIC), $data['customer_id']));
                 // 完了画面の表示
                 $this->tpl_mainpage = 'forgot/complete.tpl';
                 // セッション変数の解放
                 $_SESSION['forgot'] = array();
                 unset($_SESSION['forgot']);
             } else {
                 // ヒミツの答えが正しくない
                 $this->Reminder = $arrReminder[$_SESSION['forgot']['reminder']];
                 $this->errmsg = "パスワードを忘れたときの質問に対する回答が正しくありません";
                 $this->tpl_mainpage = 'forgot/secret.tpl';
             }
         } else {
             // アクセス元が不正または、セッション保持期間が切れている
             $this->errmsg = "emailアドレスを再度登録してください。<br />前回の入力から時間が経っていますと、本メッセージが表示される可能性があります。";
         }
     }
     // デフォルト入力
     if ($_POST['email'] != "") {
         // POST値を入力
         $this->tpl_login_email = $_POST['email'];
     } else {
         // クッキー値を入力
         $this->tpl_login_email = $objCookie->getCookie('login_email');
     }
     // モバイルサイトの場合はトークン生成
     if (defined("MOBILE_SITE") && MOBILE_SITE) {
         $this->createMobileToken();
     }
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Esempio n. 19
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $this->objQuery = new SC_Query();
     $this->objCustomer = new SC_Customer();
     $this->objFormParam = new SC_FormParam();
     // レイアウトデザインを取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objLayout->sfGetPageLayout($this, false, "mypage/index.php");
     //日付プルダウン設定
     $objDate = new SC_Date(1901);
     $this->arrYear = $objDate->getYear();
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     // ログインチェック
     if (!$this->objCustomer->isLoginSuccess()) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     } else {
         //マイページトップ顧客情報表示用
         $this->CustomerName1 = $this->objCustomer->getvalue('name01');
         $this->CustomerName2 = $this->objCustomer->getvalue('name02');
         $this->CustomerPoint = $this->objCustomer->getvalue('point');
     }
     //---- 登録用カラム配列
     $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" => "password", "convert" => "an"), array("column" => "reminder", "convert" => "n"), array("column" => "reminder_answer", "convert" => "aKV"), array("column" => "mailmaga_flg", "convert" => "n"));
     //メールアドレス種別
     $arrMailType = array("email" => true, "email_mobile" => true);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'confirm':
             //エラーなしでかつメールアドレスが重複していない場合
             if ($this->checkErrorTotal($arrRegistColumn, $arrMailType)) {
                 //確認ページへ
                 $this->tpl_mainpage = TEMPLATE_DIR . 'mypage/change_confirm.tpl';
                 $this->tpl_title = 'MYページ/会員登録内容変更(確認ページ)';
                 $passlen = strlen($this->arrForm['password']);
                 $this->passlen = $this->lfPassLen($passlen);
             } else {
                 $this->lfFormReturn($this->arrForm, $this);
             }
             break;
         case 'return':
             $this->arrForm = $_POST;
             $this->lfFormReturn($this->arrForm, $this);
             break;
         case 'gmo_oneclick':
             sfGMOMypageEdit();
             $this->arrForm = $this->lfGetCustomerData();
             $this->arrForm['password'] = DEFAULT_PASSWORD;
             $this->arrForm['password02'] = DEFAULT_PASSWORD;
             break;
         case 'complete':
             //エラーなしでかつメールアドレスが重複していない場合
             if ($this->checkErrorTotal($arrRegistColumn, $arrMailType)) {
                 $this->arrForm['customer_id'] = $this->objCustomer->getValue('customer_id');
                 //-- 編集登録
                 $objDb = new SC_Helper_DB_Ex();
                 $objDb->sfEditCustomerData($this->arrForm, $arrRegistColumn);
                 //セッション情報を最新の状態に更新する
                 $this->objCustomer->updateSession();
                 // Do楽SNS連携モジュールユーザ情報更新処理
                 if (function_exists('sfUpdateSourakuSNSUserInfo')) {
                     sfUpdateSourakuSNSUserInfo();
                 }
                 //完了ページへ
                 $this->sendRedirect($this->getLocation("./change_complete.php"));
                 exit;
             } else {
                 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
             }
             break;
         default:
             //顧客情報取得
             $this->arrForm = $this->lfGetCustomerData();
             $this->arrForm['password'] = DEFAULT_PASSWORD;
             $this->arrForm['password02'] = DEFAULT_PASSWORD;
             break;
     }
     //誕生日データ登録の有無
     $arrCustomer = $this->lfGetCustomerData();
     if ($arrCustomer['birth'] != "") {
         $this->birth_check = true;
     }
     $objView->assignobj($this);
     //$objpage内の全てのテンプレート変数をsmartyに格納
     $objView->display(SITE_FRAME);
     //パスとテンプレート変数の呼び出し、実行
 }
Esempio n. 20
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objSiteInfo = $objView->objSiteInfo;
     $objCustomer = new SC_Customer();
     $objDb = new SC_Helper_DB_Ex();
     $this->CONF = $objDb->sf_getBasisData();
     $this->arrInfo = $objSiteInfo->data;
     // キャンペーンからの登録の場合の処理
     if (!empty($_GET["cp"])) {
         $etc_val['cp'] = $_GET['cp'];
     }
     //-- 本登録完了のためにメールから接続した場合
     if ($_GET["mode"] == "regist") {
         //-- 入力チェック
         $this->arrErr = $this->lfErrorCheck($_GET);
         if ($this->arrErr) {
             SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $this->arrErr["id"]);
         } else {
             $registSecretKey = $this->lfRegistData($_GET);
             //本会員登録(フラグ変更)
             $this->lfSendRegistMail($registSecretKey);
             //本会員登録完了メール送信
             // ログイン済みの状態にする。
             $objQuery = new SC_Query();
             $arrRet = $objQuery->select("customer_id, email", "dtb_customer", "secret_key = ?", array($registSecretKey));
             $objCustomer->setLogin($arrRet[0]['email']);
             $etc_val['ci'] = $arrRet[0]['customer_id'];
             $_SERVER['QUERY_STRING'] = NULL;
             $this->sendRedirect($this->getLocation("./complete.php", $etc_val));
             exit;
         }
         //-- それ以外のアクセスは無効とする
     } else {
         SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "無効なアクセスです。");
     }
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // レイアウトデザインを取得
     $helper = new SC_Helper_PageLayout_Ex();
     $helper->sfGetPageLayout($this, false, "products/detail.php");
     // ログイン中のユーザが商品をお気に入りにいれる処理
     if ($objCustomer->isLoginSuccess() === true && strlen($_POST['mode']) > 0 && $_POST['mode'] == "add_favorite" && strlen($_POST['favorite_product_id']) > 0) {
         // 値の正当性チェック
         if (!SC_Utils_Ex::sfIsInt($_POST['favorite_product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_POST['favorite_product_id'], "del_flg = 0 AND status = 1")) {
             SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
             exit;
         } else {
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $customer_id = $objCustomer->getValue('customer_id');
                 $this->lfRegistFavoriteProduct($customer_id, $_POST['favorite_product_id']);
             }
         }
     }
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     // ファイル管理クラス
     $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
     // ファイル情報の初期化
     $this->lfInitFile();
     // 管理ページからの確認の場合は、非公開の商品も表示する。
     if (isset($_GET['admin']) && $_GET['admin'] == 'on') {
         SC_Utils_Ex::sfIsSuccess(new SC_Session());
         $status = true;
         $where = "del_flg = 0";
     } else {
         $status = false;
         $where = "del_flg = 0 AND status = 1";
     }
     if (isset($_POST['mode']) && $_POST['mode'] != "") {
         $tmp_id = $_POST['product_id'];
     } else {
         $tmp_id = $_GET['product_id'];
     }
     // 値の正当性チェック
     if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) {
         SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
     }
     // ログイン判定
     if ($objCustomer->isLoginSuccess() === true) {
         //お気に入りボタン表示
         $this->tpl_login = true;
         /* 閲覧ログ機能は現在未使用
         
                     $table = "dtb_customer_reading";
                     $where = "customer_id = ? ";
                     $arrval[] = $objCustomer->getValue('customer_id');
                     //顧客の閲覧商品数
                     $rpcnt = $objQuery->count($table, $where, $arrval);
         
                     //閲覧数が設定数以下
                     if ($rpcnt < CUSTOMER_READING_MAX){
                         //閲覧履歴に新規追加
                         lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
                     } else {
                         //閲覧履歴の中で一番古いものを削除して新規追加
                         $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?";
                         $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id")));
                         $where = "customer_id = ? AND update_date = ? ";
                         $arrval = array($objCustomer->getValue("customer_id"), $old);
                         //削除
                         $objQuery->delete($table, $where, $arrval);
                         //追加
                         lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
                     }
                 */
     }
     // 規格選択セレクトボックスの作成
     $this->lfMakeSelect($tmp_id);
     // 商品IDをFORM内に保持する。
     $this->tpl_product_id = $tmp_id;
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'cart':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             if (count($this->arrErr) == 0) {
                 $objCartSess = new SC_CartSession();
                 $classcategory_id1 = $_POST['classcategory_id1'];
                 $classcategory_id2 = $_POST['classcategory_id2'];
                 if (!empty($_POST['gmo_oneclick'])) {
                     $objCartSess->delAllProducts();
                 }
                 // 規格1が設定されていない場合
                 if (!$this->tpl_classcat_find1) {
                     $classcategory_id1 = '0';
                 }
                 // 規格2が設定されていない場合
                 if (!$this->tpl_classcat_find2) {
                     $classcategory_id2 = '0';
                 }
                 $objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
                 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));
                 if (!empty($_POST['gmo_oneclick'])) {
                     $objSiteSess = new SC_SiteSession();
                     $objSiteSess->setRegistFlag();
                     $objCartSess->saveCurrentCart($objSiteSess->getUniqId());
                     $this->sendRedirect($this->getLocation(URL_DIR . 'user_data/gmopg_oneclick_confirm.php', array(), true));
                     exit;
                 }
                 $this->sendRedirect($this->getLocation(URL_CART_TOP));
                 exit;
             }
             break;
         default:
             break;
     }
     $objQuery = new SC_Query();
     // DBから商品情報を取得する。
     $arrRet = $objQuery->select("*, (SELECT count(*) FROM dtb_customer_favorite_products WHERE product_id = alldtl.product_id AND customer_id = ?) AS favorite_count", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($objCustomer->getValue('customer_id'), $tmp_id));
     $this->arrProduct = $arrRet[0];
     // 商品コードの取得
     $code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code";
     $arrProductCode = $objQuery->getall($code_sql, array($tmp_id));
     $arrProductCode = SC_Utils_Ex::sfswaparray($arrProductCode);
     $this->arrProductCode = $arrProductCode["product_code"];
     // 購入制限数を取得
     if ($this->arrProduct['sale_unlimited'] == 1 || $this->arrProduct['sale_limit'] > SALE_LIMIT_MAX) {
         $this->tpl_sale_limit = SALE_LIMIT_MAX;
     } else {
         $this->tpl_sale_limit = $this->arrProduct['sale_limit'];
     }
     // サブタイトルを取得
     $arrCategory_id = $objDb->sfGetCategoryId($arrRet[0]['product_id'], '', $status);
     $arrFirstCat = $objDb->sfGetFirstCat($arrCategory_id[0]);
     $this->tpl_subtitle = $arrFirstCat['name'];
     // 関連カテゴリを取得
     $this->arrRelativeCat = $objDb->sfGetMultiCatTree($tmp_id);
     // DBからのデータを引き継ぐ
     $this->objUpFile->setDBFileList($this->arrProduct);
     // ファイル表示用配列を渡す
     $this->arrFile = $this->objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true);
     // 支払方法の取得
     $this->arrPayment = $this->lfGetPayment();
     // 入力情報を渡す
     $this->arrForm = $this->objFormParam->getFormParamList();
     //レビュー情報の取得
     $this->arrReview = $this->lfGetReviewData($tmp_id);
     // トラックバック情報の取得
     // トラックバック機能の稼働状況チェック
     if (SC_Utils_Ex::sfGetSiteControlFlg(SITE_CONTROL_TRACKBACK) != 1) {
         $this->arrTrackbackView = "OFF";
     } else {
         $this->arrTrackbackView = "ON";
         $this->arrTrackback = $this->lfGetTrackbackData($tmp_id);
     }
     $this->trackback_url = TRACKBACK_TO_URL . $tmp_id;
     // タイトルに商品名を入れる
     $this->tpl_title = "商品詳細 " . $this->arrProduct["name"];
     //オススメ商品情報表示
     $this->arrRecommend = $this->lfPreGetRecommendProducts($tmp_id);
     //この商品を買った人はこんな商品も買っています
     $this->arrRelateProducts = $this->lfGetRelateProducts($tmp_id);
     $this->lfConvertParam();
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView(false);
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     $ParentPage = MYPAGE_DELIVADDR_URL;
     // GETでページを指定されている場合には指定ページに戻す
     if (isset($_GET['page'])) {
         $ParentPage = htmlspecialchars($_GET['page'], ENT_QUOTES);
     } else {
         if (isset($_POST['ParentPage'])) {
             $ParentPage = htmlspecialchars($_POST['ParentPage'], ENT_QUOTES);
         }
     }
     $this->ParentPage = $ParentPage;
     //ログイン判定
     if (!$objCustomer->isLoginSuccess()) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (!isset($_GET['other_deliv_id'])) {
         $_GET['other_deliv_id'] = "";
     }
     if ($_POST['mode'] == "") {
         $_SESSION['other_deliv_id'] = $_GET['other_deliv_id'];
     }
     if ($_GET['other_deliv_id'] != "") {
         //不正アクセス判定
         $flag = $objQuery->count("dtb_other_deliv", "customer_id=? AND other_deliv_id=?", array($objCustomer->getValue("customer_id"), $_SESSION['other_deliv_id']));
         if (!$objCustomer->isLoginSuccess() || $flag == 0) {
             SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
         }
     }
     //別のお届け先DB登録用カラム配列
     $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" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"));
     if ($_GET['other_deliv_id'] != "") {
         //別のお届け先情報取得
         $arrOtherDeliv = $objQuery->select("*", "dtb_other_deliv", "other_deliv_id=? ", array($_SESSION['other_deliv_id']));
         $this->arrForm = $arrOtherDeliv[0];
     }
     switch ($_POST['mode']) {
         case 'edit':
             $_POST = $this->lfConvertParam($_POST, $arrRegistColumn);
             $this->arrErr = $this->lfErrorCheck($_POST);
             if ($this->arrErr) {
                 foreach ($_POST as $key => $val) {
                     if ($val != "") {
                         $this->arrForm[$key] = $val;
                     }
                 }
             } else {
                 //別のお届け先登録数の取得
                 $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id')));
                 if ($deliv_count < DELIV_ADDR_MAX or isset($_POST['other_deliv_id'])) {
                     if (strlen($_POST['other_deliv_id'] != 0)) {
                         $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=? and other_deliv_id = ?", array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id']));
                         if ($deliv_count == 0) {
                             SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                         } else {
                             $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer);
                         }
                     } else {
                         $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer);
                     }
                 }
                 if ($_POST['ParentPage'] == MYPAGE_DELIVADDR_URL || $_POST['ParentPage'] == URL_DELIV_TOP) {
                     $this->tpl_onload = "fnUpdateParent('" . $this->getLocation($_POST['ParentPage']) . "'); window.close();";
                 } else {
                     SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                 }
             }
             break;
     }
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Esempio n. 23
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     global $objCampaignSess;
     $objView = new SC_SiteView(false);
     $objQuery = new SC_Query();
     $objCampaignSess = new SC_CampaignSession();
     // ディレクトリ名を取得
     $dir_name = dirname($_SERVER['PHP_SELF']);
     $arrDir = split('/', $dir_name);
     $dir_name = $arrDir[count($arrDir) - 1];
     /* セッションにキャンペーンデータを書き込む */
     // キャンペーンからの遷移という情報を保持
     $objCampaignSess->setIsCampaign();
     // キャンペーンIDを保持
     $campaign_id = $objQuery->get("dtb_campaign", "campaign_id", "directory_name = ? AND del_flg = 0", array($dir_name));
     $objCampaignSess->setCampaignId($campaign_id);
     // キャンペーンディレクトリ名を保持
     $objCampaignSess->setCampaignDir($dir_name);
     // カートに入れないページの場合のページ(申込のみページ)へリダイレクト
     $cart_flg = $objQuery->get("dtb_campaign", "cart_flg", "campaign_id = ?", array($campaign_id));
     if (!$cart_flg) {
         $this->sendRedirect($this->getLocation(CAMPAIGN_URL . "{$dir_name}/application.php"));
         exit;
     }
     // キャンペーンが開催中かをチェック
     if ($this->lfCheckActive($dir_name, $objQuery)) {
         $status = CAMPAIGN_TEMPLATE_ACTIVE;
     } else {
         $status = CAMPAIGN_TEMPLATE_END;
     }
     if ($_GET['init'] != "") {
         $this->tpl_init = 'false';
         $this->lfDispProductsList($_GET['ids'], $objQuery);
     } else {
         $this->tpl_init = 'true';
     }
     switch ($_POST['mode']) {
         case 'cart':
             $this->arrErr = $this->lfCheckError($_POST['product_id']);
             if (count($this->arrErr) == 0) {
                 $objCartSess = new SC_CartSession();
                 $classcategory_id = "classcategory_id" . $_POST['product_id'];
                 $classcategory_id1 = $_POST[$classcategory_id . '_1'];
                 $classcategory_id2 = $_POST[$classcategory_id . '_2'];
                 $quantity = "quantity" . $_POST['product_id'];
                 // 規格1が設定されていない場合
                 if (!$this->tpl_classcat_find1[$_POST['product_id']]) {
                     $classcategory_id1 = '0';
                 }
                 // 規格2が設定されていない場合
                 if (!$this->tpl_classcat_find2[$_POST['product_id']]) {
                     $classcategory_id2 = '0';
                 }
                 $objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
                 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $_POST[$quantity], $campaign_id);
                 $this->sendRedirect($this->getLocation(URL_CART_TOP));
                 exit;
             }
             break;
         default:
             break;
     }
     // 入力情報を渡す
     $this->arrForm = $_POST;
     $this->tpl_dir_name = CAMPAIGN_TEMPLATE_PATH . $dir_name . "/" . $status;
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * 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 のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         if (!$this->isValidToken()) {
             SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true);
         }
     }
     //---- 登録用カラム配列
     $arrRegistColumn = array(array("column" => "review_id", "convert" => "aKV"), array("column" => "product_id", "convert" => "aKV"), array("column" => "reviewer_name", "convert" => "aKV"), array("column" => "reviewer_url", "convert" => "a"), array("column" => "sex", "convert" => "n"), array("column" => "email", "convert" => "a"), array("column" => "recommend_level", "convert" => "n"), array("column" => "title", "convert" => "aKV"), array("column" => "comment", "convert" => "aKV"));
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'confirm':
             $arrForm = $this->lfConvertParam($_POST, $arrRegistColumn);
             $this->arrErr = $this->lfErrorCheck($arrForm);
             //重複メッセージの判定
             $flag = $objQuery->count("dtb_review", "product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
             if ($flag > 0) {
                 $this->arrErr['title'] .= "重複したタイトルは登録できません。";
             }
             //エラーチェック
             if ($this->arrErr == "") {
                 //重複タイトルでない
                 if ($flag == 0) {
                     //商品名の取得
                     $arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
                     $this->arrForm = $arrForm;
                     $this->tpl_mainpage = 'products/review_confirm.tpl';
                 }
             } else {
                 //商品名の取得
                 $arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
                 $this->arrForm = $arrForm;
             }
             break;
         case 'return':
             foreach ($_POST as $key => $val) {
                 $this->arrForm[$key] = $val;
             }
             //商品名の取得
             $this->arrForm['name'] = $objQuery->get("dtb_products", "name", "product_id = ? ", array($this->arrForm['product_id']));
             if (empty($this->arrForm['name'])) {
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
             }
             break;
         case 'complete':
             $arrForm = $this->lfConvertParam($_POST, $arrRegistColumn);
             $arrErr = $this->lfErrorCheck($arrForm);
             //重複メッセージの判定
             $flag = $objQuery->count("dtb_review", "product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
             //エラーチェック
             if ($arrErr == "") {
                 //重複タイトルでない
                 if ($flag == 0) {
                     //登録実行
                     $this->lfRegistRecommendData($arrForm, $arrRegistColumn);
                     //レビュー書き込み完了ページへ
                     $this->sendRedirect($this->getLocation("./review_complete.php", array(), true));
                     exit;
                 }
             } else {
                 if ($flag > 0) {
                     SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
                 }
             }
             break;
         default:
             if (SC_Utils_Ex::sfIsInt($_GET['product_id'])) {
                 //商品情報の取得
                 $arrForm = $objQuery->select("product_id, name", "dtb_products", "del_flg = 0 AND status = 1 AND product_id=?", array($_GET['product_id']));
                 if (empty($arrForm)) {
                     SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
                 }
                 $this->arrForm = $arrForm[0];
             }
             break;
     }
     $this->transactionid = $this->getToken();
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Esempio n. 26
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objPage = new LC_Page();
     $objView = new SC_SiteView();
     $objSess = new SC_Session();
     // 都道府県プルダウン用配列
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
     // CSV保存項目
     //---- 登録用カラム配列 オプション以外
     $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" => "email02", "convert" => "a"), array("column" => "tel01", "convert" => "n"), array("column" => "tel02", "convert" => "n"), array("column" => "tel03", "convert" => "n"));
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (!$_POST['mode'] == 'confirm' && !is_numeric($_REQUEST['question_id'])) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
     }
     // テンプレート登録項目取得
     $sql = "SELECT question_id, question FROM dtb_question WHERE question_id = ?";
     $result = $conn->getAll($sql, array($_REQUEST['question_id']));
     if (count($result) <= 0) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
     }
     $this->QUESTION = $this->lfGetArrInput(unserialize($result[0]['question']));
     $this->question_id = $_REQUEST['question_id'];
     $this->arrHidden = SC_Utils_Ex::sfMakeHiddenArray($_POST);
     unset($this->arrHidden['mode']);
     if (isset($this->QUESTION["delete"]) && (int) $this->QUESTION["delete"] !== 0) {
         $objPage->tpl_mainpage = "inquiry/closed.tpl";
     } elseif ($_POST['mode'] == "confirm") {
         //-- 入力エラーチェック
         $this->arrForm = $_POST;
         $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn);
         $this->arrErr = $this->lfErrorCheck($this->arrForm);
         $this->arrErr = $this->lfGetArrInput($this->arrErr);
         if (!$this->arrErr) {
             $this->tpl_mainpage = "inquiry/confirm.tpl";
         }
     } elseif ($_POST['mode'] == "return") {
         $this->arrForm = $_POST;
     } elseif ($_POST['mode'] == "regist") {
         //-- 入力文字・変換&エラーチェック
         $this->arrForm = $_POST;
         $this->arrForm = $this->lfConvertParam($this->arrForm, $arrRegistColumn);
         $this->arrErr = $this->lfErrorCheck($this->arrForm);
         $this->arrErr = $this->lfGetArrInput($this->arrErr);
         if (!$this->arrErr) {
             //完了画面
             $this->tpl_mainpage = "inquiry/complete.tpl";
             //--------- ▼ SQL ---------//
             // テーブルに入れるように整形する
             $arrOption = $this->arrForm['option'];
             unset($this->arrForm['email02']);
             $this->arrForm['mail01'] = $this->arrForm['email'];
             unset($this->arrForm['email']);
             unset($this->arrForm['option']);
             $this->arrForm['question_id'] = $this->question_id;
             $this->arrForm['question_name'] = $this->QUESTION['title'];
             for ($i = 0; $i < count($arrOption); $i++) {
                 $tmp = "";
                 if (is_array($arrOption[$i])) {
                     for ($j = 0; $j < count($arrOption[$i]); $j++) {
                         if ($j > 0) {
                             $tmp .= ",";
                         }
                         $tmp .= $arrOption[$i][$j];
                     }
                     $this->arrForm['question0' . ($i + 1)] = $tmp;
                 } else {
                     $this->arrForm['question0' . ($i + 1)] = $arrOption[$i];
                 }
             }
             $this->arrForm['create_date'] = "now()";
             // DB登録
             $objQuery = new SC_Query();
             $objQuery->insert("dtb_question_result", $this->arrForm);
             //--------- ▲ SQL ---------//
         }
     }
     $this->cnt_question = 6;
     $this->arrActive = isset($arrActive) ? $arrActive : "";
     $this->arrQuestion = isset($arrQuestion) ? $arrQuestion : "";
     //---- ページ表示
     $objView->_smarty->register_function("lfArray_Search_key_Smarty", array("LC_Page_Inquiry", "lfArray_Search_key_Smarty"));
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Esempio n. 27
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objCustomer = new SC_Customer();
     $objQuery = new SC_Query();
     $objSiteSess = new SC_SiteSession();
     //ログイン判定
     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");
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'confirm':
             $this->tpl_mainpage = TEMPLATE_DIR . 'mypage/refusal_confirm.tpl';
             $this->tpl_title = "MYページ/退会手続き(確認ページ)";
             // 確認ページを経由したことを登録
             $objSiteSess->setRegistFlag();
             // hiddenにuniqidを埋め込む
             $this->tpl_uniqid = $objSiteSess->getUniqId();
             break;
         case 'complete':
             // 正しい遷移かどうかをチェック
             $this->lfIsValidMovement($objSiteSess);
             //会員削除
             $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id')));
             $objCustomer->EndSession();
             //完了ページへ
             $this->sendRedirect($this->getLocation("./refusal_complete.php"));
             exit;
     }
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
Esempio n. 28
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     // レイアウトデザインを取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objLayout->sfGetPageLayout($this, false, "mypage/index.php");
     // ログインチェック
     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');
     }
     //ページ送り用
     if (isset($_POST['pageno'])) {
         $this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
     }
     $col = "order_id, create_date, payment_id, payment_total";
     $from = "dtb_order";
     $where = "del_flg = 0 AND customer_id=?";
     $arrval = array($objCustomer->getvalue('customer_id'));
     $order = "order_id DESC";
     $linemax = $objQuery->count($from, $where, $arrval);
     $this->tpl_linemax = $linemax;
     // ページ送りの取得
     $objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
     $this->tpl_strnavi = $objNavi->strnavi;
     // 表示文字列
     $startno = $objNavi->start_row;
     // 取得範囲の指定(開始行番号、行数のセット)
     $objQuery->setlimitoffset(SEARCH_PMAX, $startno);
     // 表示順序
     $objQuery->setorder($order);
     //購入履歴の取得
     $this->arrOrder = $objQuery->select($col, $from, $where, $arrval);
     // 支払い方法の取得
     $objDb = new SC_Helper_DB_Ex();
     $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
     $objView->assignobj($this);
     //$objpage内の全てのテンプレート変数をsmartyに格納
     $objView->display(SITE_FRAME);
     //パスとテンプレート変数の呼び出し、実行
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_SiteView();
     $objQuery = new SC_Query();
     $objCustomer = new SC_Customer();
     $objDb = new SC_Helper_DB_Ex();
     // レイアウトデザインを取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $objLayout->sfGetPageLayout($this, false, "mypage/index.php");
     //不正アクセス判定
     $from = "dtb_order";
     $where = "del_flg = 0 AND customer_id = ? AND order_id = ? ";
     $arrval = array($objCustomer->getValue('customer_id'), $_POST['order_id']);
     //DBに情報があるか判定
     $cnt = $objQuery->count($from, $where, $arrval);
     //ログインしていない、またはDBに情報が無い場合
     if (!$objCustomer->isLoginSuccess() || $cnt == 0) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     } else {
         //受注詳細データの取得
         $this->arrDisp = $this->lfGetOrderData($_POST['order_id']);
         // 支払い方法の取得
         $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
         // 配送時間の取得
         $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']);
         $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
         //マイページトップ顧客情報表示用
         $this->CustomerName1 = $objCustomer->getvalue('name01');
         $this->CustomerName2 = $objCustomer->getvalue('name02');
         $this->CustomerPoint = $objCustomer->getvalue('point');
     }
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
     $objView->assignobj($this);
     $objView->display(SITE_FRAME);
 }
Esempio n. 30
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBconn(ZIP_DSN);
     $objView = new SC_SiteView(false);
     // 入力エラーチェック
     $arrErr = $this->fnErrorCheck($_GET);
     // 入力エラーの場合は終了
     if (count($arrErr) > 0) {
         $this->tpl_start = "window.close();";
         SC_Utils::sfDispSiteError(CUSTOMER_ERROR);
     }
     // 郵便番号検索文作成
     $zipcode = $_GET['zip1'] . $_GET['zip2'];
     $zipcode = mb_convert_kana($zipcode, "n");
     $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
     $data_list = $conn->getAll($sqlse, array($zipcode));
     if (empty($data_list)) {
         $data_list = array();
     }
     $masterData = new SC_DB_MasterData_Ex();
     $arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank"));
     // インデックスと値を反転させる。
     $arrREV_PREF = array_flip($arrPref);
     if (!empty($data_list)) {
         $this->tpl_state = isset($arrREV_PREF[$data_list[0]['state']]) ? $arrREV_PREF[$data_list[0]['state']] : "";
         $this->tpl_city = isset($data_list[0]['city']) ? $data_list[0]['city'] : "";
         $town = isset($data_list[0]['town']) ? $data_list[0]['town'] : "";
     } else {
         $town = "";
     }
     /*
      総務省からダウンロードしたデータをそのままインポートすると
      以下のような文字列が入っているので  対策する。
      ・(1~19丁目)
      ・以下に掲載がない場合
     */
     $town = ereg_replace("(.*)\$", "", $town);
     $town = ereg_replace("以下に掲載がない場合", "", $town);
     $this->tpl_town = $town;
     // 郵便番号が発見された場合
     if (!empty($data_list)) {
         $func = "fnPutAddress('" . $_GET['input1'] . "','" . $_GET['input2'] . "');";
         $this->tpl_onload = "{$func}";
         $this->tpl_start = "window.close();";
     } else {
         $this->tpl_message = "該当する住所が見つかりませんでした。";
     }
     /* ページの表示 */
     $objView->assignobj($this);
     $objView->display("input_zip.tpl");
 }