/** * @deprecated SC_Helper_DB::sf_getBasisData() を使用して下さい. * * FIXME この関数を使用している場合は, * SC_Helper_DB::sf_getBasisData() に置き変えて下さい * */ function SC_SiteInfo($conn = '') { /* $DB_class_name = "SC_DbConn"; if ( is_object($conn)){ if ( is_a($conn, $DB_class_name)){ // $connが$DB_class_nameのインスタンスである $this->conn = $conn; } } else { if (class_exists($DB_class_name)){ //$DB_class_nameのインスタンスを作成する $this->conn = new SC_DbConn(); } } if ( is_object($this->conn)){ $conn = $this->conn; $sql = "SELECT * FROM dtb_baseinfo"; $data = $conn->getAll($sql); $this->data = $data[0]; } */ $objDb = new SC_Helper_DB_Ex(); $this->data = $objDb->sf_getBasisData(); }
/** * 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() { $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); }
/** * 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 mobileProcess() { $objConn = new SC_DbConn(); $this->arrForm = $_POST; // 登録 if (isset($_REQUEST['btnRegist'])) { $this->arrErr = $this->lfMailErrorCheck($this->arrForm, "regist", $objConn); // エラーがなければ if (count($this->arrErr) == 0) { // 確認 $this->arrForm['kind'] = 'メルマガ登録'; $this->arrForm['type'] = 'regist'; $this->arrForm['mail'] = $this->arrForm['regist']; } else { $this->tpl_mainpage = 'magazine/index.tpl'; $this->tpl_title = 'メルマガ登録・解除'; } // 解除 } elseif (isset($_REQUEST['btnCancel'])) { $this->arrErr = $this->lfMailErrorCheck($this->arrForm, "cancel", $objConn); // エラーがなければ if (count($this->arrErr) == 0) { // 確認 $this->arrForm['kind'] = 'メルマガ解除'; $this->arrForm['type'] = 'cancel'; $this->arrForm['mail'] = $this->arrForm['cancel']; } else { $this->tpl_mainpage = 'magazine/index.tpl'; $this->tpl_title = 'メルマガ登録・解除'; } // 完了 } elseif ($_REQUEST['mode'] == 'regist' or $_REQUEST['mode'] == 'cancel') { $objMailText = new SC_MobileView(); $helperMail = new SC_Helper_Mail_Ex(); $objQuery = new SC_Query(); // 登録 if ($_REQUEST['mode'] == 'regist') { $uniqId = $this->lfRegistData($_POST["email"], $objConn); $subject = $helperMail->fMakesubject($objQuery, $objMailText, $this, 'メルマガ登録のご確認'); // 解除 } elseif ($_REQUEST['mode'] == 'cancel') { $uniqId = $this->lfGetSecretKey($_POST["email"], $objConn); $subject = $helperMail->sfMakesubject($objQuery, $objMailText, $this, 'メルマガ解除のご確認'); } $objDb = new SC_Helper_DB_Ex(); $CONF = $objDb->sf_getBasisData(); $this->CONF = $CONF; $this->tpl_url = SC_Utils_Ex::gfAddSessionId(MOBILE_SSL_URL . "magazine/" . $_REQUEST['mode'] . ".php?id=" . $uniqId); $objMailText->assignobj($this); $toCustomerMail = $objMailText->fetch("mail_templates/mailmagazine_" . $_REQUEST['mode'] . ".tpl"); $objMail = new SC_SendMail(); $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"], $CONF["email01"]); // 宛先の設定 $objMail->setTo($_POST["email"], $_POST["email"]); $objMail->sendMail(); // 完了ページに移動させる。 $this->sendRedirect($this->getLocation("./complete.php", array(session_name() => session_id()))); exit; } else { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true); } $objView = new SC_MobileView(); // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス. * * @return void */ function process() { //---- ページ初期設定 $objQuery = new SC_Query(); $objView = new SC_AdminView(); $objDate = new SC_Date(1901); $objDb = new SC_Helper_DB_Ex(); $this->arrYear = $objDate->getYear(); // 日付プルダウン設定 $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); $this->objDate = $objDate; // 認証可否の判定 $objSess = new SC_Session(); SC_Utils_Ex::sfIsSuccess($objSess); // POST値の引き継ぎ $this->arrForm = $_POST; // ページ送り用 $this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : ""; // 検索ワードの引き継ぎ foreach ($_POST as $key => $val) { switch ($key) { case 'sex': case 'status': $this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val); if (!is_array($val)) { $this->arrForm[$key] = split("-", $val); } break; default: $this->arrHidden[$key] = $val; break; } } if (!isset($_POST['mode'])) { $_POST['mode'] = ""; } // 顧客削除 if ($_POST['mode'] == "delete") { $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0"; $result_customer = $objQuery->conn->getAll($sql, array($_POST["edit_customer_id"])); if ($result_customer[0]["status"] == 2) { //本会員削除 $arrDel = array("del_flg" => 1, "update_date" => "NOW()"); $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["edit_customer_id"])); } elseif ($result_customer[0]["status"] == 1) { //仮会員削除 $sql = "DELETE FROM dtb_customer WHERE customer_id = ?"; $objQuery->conn->query($sql, array($_POST["edit_customer_id"])); } } //if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") { // 登録メール再送 if ($_POST['mode'] == "resend_mail") { $arrRet = $objQuery->select("name01, name02, secret_key, email", "dtb_customer", "customer_id = ? AND del_flg <> 1 AND status = 1", array($_POST["edit_customer_id"])); if (is_array($arrRet) === true && count($arrRet) > 0) { $CONF = $objDb->sf_getBasisData(); $this->CONF = $CONF; $objMailText = new SC_SiteView(); $objMailText->assignobj($this); $mailHelper = new SC_Helper_Mail_Ex(); $this->name01 = $arrRet[0]['name01']; $this->name02 = $arrRet[0]['name02']; $this->uniqid = $arrRet[0]['secret_key']; $subject = $mailHelper->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご確認'); $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); $objMail = new SC_SendMail(); $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"]); // 宛先の設定 $name = $this->name01 . $this->name02 . " 様"; $objMail->setTo($arrRet[0]["email"], $name); $objMail->sendMail(); } } if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "resend_mail") { // 入力文字の強制変換 $this->lfConvertParam(); // エラーチェック $this->arrErr = $this->lfCheckError($this->arrForm); $where = "del_flg = 0"; /* 入力エラーなし */ if (count($this->arrErr) == 0) { //-- 検索データ取得 $objSelect = new SC_CustomerList($this->arrForm, "customer"); // 表示件数設定 $page_rows = $this->arrForm['page_rows']; if (is_numeric($page_rows)) { $page_max = $page_rows; } else { $page_max = SEARCH_PMAX; } if (!isset($this->arrForm['search_pageno'])) { $this->arrForm['search_pageno'] = ""; } if ($this->arrForm['search_pageno'] == 0) { $this->arrForm['search_pageno'] = 1; } $offset = $page_max * ($this->arrForm['search_pageno'] - 1); $objSelect->setLimitOffset($page_max, $offset); if ($_POST["mode"] == 'csv') { $searchSql = $objSelect->getListCSV($this->arrColumnCSV); } else { $searchSql = $objSelect->getList(); } $this->search_data = $objQuery->conn->getAll($searchSql, $objSelect->arrVal); switch ($_POST['mode']) { case 'csv': require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php"; $objCSV = new SC_Helper_CSV_Ex(); $i = 0; $header = ""; // CSVカラム取得 $arrCsvOutput = $objCSV->sfgetCsvOutput(2, " WHERE csv_id = 2 AND status = 1"); if (count($arrCsvOutput) <= 0) { break; } foreach ($arrCsvOutput as $data) { $arrColumn[] = $data["col"]; if ($i != 0) { $header .= ", "; } $header .= $data["disp_name"]; $i++; } $header .= "\n"; //- 都道府県/職業の変換 for ($i = 0; $i < count($this->search_data); $i++) { $this->search_data[$i]["pref"] = $this->arrPref[$this->search_data[$i]["pref"]]; $this->search_data[$i]["job"] = $this->arrJob[$this->search_data[$i]["job"]]; } //- CSV出力 $data = SC_Utils_Ex::getCSVData($this->search_data, $arrColumn); SC_Utils_Ex::sfCSVDownload($header . $data); exit; break; case 'delete_all': // 検索結果をすべて削除 $where = "product_id IN (SELECT product_id FROM vw_products_nonclass AS noncls WHERE {$where})"; $sqlval['del_flg'] = 1; $objQuery->update("dtb_products", $sqlval, $where, $arrval); $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0"; $result_customer = $objQuery->conn->getAll($sql, array($_POST["del_customer_id"])); if ($result_customer[0]["status"] == 2) { //本会員削除 $arrDel = array("del_flg" => 1, "update_date" => "NOW()"); $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["del_customer_id"])); } elseif ($result_customer[0]["status"] == 1) { //仮会員削除 $sql = "DELETE FROM dtb_customer WHERE customer_id = ?"; $objQuery->conn->query($sql, array($_POST["del_customer_id"])); } break; default: // 行数の取得 $linemax = $objQuery->conn->getOne($objSelect->getListCount(), $objSelect->arrVal); $this->tpl_linemax = $linemax; // 何件が該当しました。表示用 // ページ送りの取得 $objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnCustomerPage", NAVI_PMAX); $startno = $objNavi->start_row; $this->arrPagenavi = $objNavi->arrPagenavi; } } } $this->arrCatList = $objDb->sfGetCategoryList(); //---- ページ表示 $objView->assignobj($this); $objView->display(MAIN_FRAME); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $conn = new SC_DBConn(); $objView = new SC_MobileView(); $objDb = new SC_Helper_DB_Ex(); $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 //---- ページ表示 $objView->assignobj($this); $objView->assignarray($CONF); $objView->display(SITE_FRAME); }
function lfGetRealFileName($product_id) { $objQuery = new SC_Query(); $col = "*"; $table = "vw_download_class AS T1"; if (DB_TYPE == "mysql") { // CUSTOM FOR MYSQL $where = "T1.customer_id = " . (int) $_SESSION['customer']['customer_id'] . " AND T1.order_id = " . (int) $_GET['order_id'] . " AND T1.product_id = " . (int) $_GET['product_id'] . " AND (SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD(T1.create_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY)))) = 1;"; } else { // CUSTOM FOR POSTGRESQL $baseinfo = SC_Helper_DB_Ex::sf_getBasisData(); $where = "T1.customer_id = " . (int) $_SESSION['customer']['customer_id'] . " AND T1.order_id = " . (int) $_GET['order_id'] . " AND T1.product_id = " . (int) $_GET['product_id'] . " AND (SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 THEN 1 WHEN DATE(NOW()) <= DATE(T1.create_date + '" . $baseinfo['downloadable_days'] . " days') THEN 1 ELSE 0 END) = 1;"; } $arrRet = $objQuery->select($col, $table, $where); return $arrRet[0]; }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { $objView = new SC_MobileView(); $objSiteInfo = $objView->objSiteInfo; $objCustomer = new SC_Customer(); $objDb = new SC_Helper_DB_Ex(); $this->CONF = $objDb->sf_getBasisData(); $arrInfo = $objSiteInfo->data; //-- 本登録完了のためにメールから接続した場合 if ($_GET["mode"] == "regist") { //-- 入力チェック $this->arrErr = $this->lfErrorCheck($_GET); if ($this->arrErr) { $this->tpl_mainpage = 'regist/error.tpl'; $this->tpl_title = 'エラー'; } else { $registSecretKey = $this->lfRegistData($_GET); //本会員登録(フラグ変更) $this->lfSendRegistMail($registSecretKey); //本会員登録完了メール送信 // ログイン済みの状態にする。 $objQuery = new SC_Query(); $email = $objQuery->get("dtb_customer", "email", "secret_key = ?", array($registSecretKey)); $objCustomer->setLogin($email); $this->sendRedirect($this->getLocation("./complete.php"), true); exit; } //-- それ以外のアクセスは無効とする } else { $this->arrErr["id"] = "無効なアクセスです。"; $this->tpl_mainpage = 'regist/error.tpl'; $this->tpl_title = 'エラー'; } //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); }
/** * Page のプロセス(モバイル). * * @return void */ function mobileProcess() { //---- ページ初期設定 $objDb = new SC_Helper_DB_Ex(); $objMobile = new SC_Helper_Mobile_Ex(); $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 $objConn = new SC_DbConn(); $objView = new SC_MobileView(); $objCustomer = new SC_Customer(); $objDate = new SC_Date(START_BIRTH_YEAR, date("Y", strtotime("now"))); // 空メール if (isset($_SESSION['mobile']['kara_mail_from'])) { $_POST['email'] = $_SESSION['mobile']['kara_mail_from']; $this->tpl_kara_mail_from = $_POST['email']; } elseif (MOBILE_USE_KARA_MAIL) { $token = $objMobile->gfPrepareKaraMail('entry/index.php'); if ($token !== false) { $this->tpl_mainpage = 'entry/mail.tpl'; $this->tpl_title = '会員登録(空メール)'; $this->tpl_kara_mail_to = MOBILE_KARA_MAIL_ADDRESS_USER . MOBILE_KARA_MAIL_ADDRESS_DELIMITER . 'entry_' . $token . '@' . MOBILE_KARA_MAIL_ADDRESS_DOMAIN; $this->tpl_from_address = $CONF['email03']; } } // レイアウトデザインを取得 $objLayout = new SC_Helper_PageLayout_Ex(); $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); //---- 登録用カラム配列 $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" => "email2", "convert" => "a"), array("column" => "email_mobile", "convert" => "a"), array("column" => "email_mobile2", "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" => "password02", "convert" => "a"), array("column" => "mailmaga_flg", "convert" => "n")); //---- 登録除外用カラム配列 $arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02"); if ($_SERVER["REQUEST_METHOD"] == "POST") { //-- POSTデータの引き継ぎ $this->arrForm = $_POST; if (isset($this->arrForm['year']) && $this->arrForm['year'] == '----') { $this->arrForm['year'] = ''; } $this->arrForm['email'] = strtolower($this->arrForm['email']); // emailはすべて小文字で処理 //-- 入力データの変換 $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 = 'entry/index.tpl'; $this->tpl_title = '会員登録(1/3)'; } elseif ($_POST["mode"] == "set2") { $this->arrErr = $this->lfErrorCheck2($this->arrForm); $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; } else { $this->arrErr = $this->lfErrorCheck3($this->arrForm); $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; } foreach ($this->arrForm as $key => $val) { $this->{$key} = $val; } if ($this->arrErr || !empty($_POST["return"])) { // 入力エラーのチェック //-- データの設定 if ($_POST["mode"] == "set1") { $checkVal = array("email", "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 != "mode" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } } else { //-- テンプレート設定 if ($_POST["mode"] == "set1") { $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; } elseif ($_POST["mode"] == "set2") { $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; if (@$this->arrForm['pref'] == "" && @$this->arrForm['addr01'] == "" && @$this->arrForm['addr02'] == "") { $address = $this->lfGetAddress($_REQUEST['zip01'] . $_REQUEST['zip02']); $this->pref = @$address[0]['state']; $this->addr01 = @$address[0]['city'] . @$address[0]['town']; } } elseif ($_POST["mode"] == "confirm") { //パスワード表示 $passlen = strlen($this->arrForm['password']); $this->passlen = $this->lfPassLen($passlen); //メール受け取り if (!isset($this->arrForm['mailmaga_flg'])) { $this->arrForm['mailmaga_flg'] = ""; } if (strtolower($this->arrForm['mailmaga_flg']) == "on") { $this->arrForm['mailmaga_flg'] = "2"; } else { $this->arrForm['mailmaga_flg'] = "3"; } $this->tpl_mainpage = 'entry/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 != "mode" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) { $this->list_data[$key] = $val; } } //-- 仮登録と完了画面 if ($_POST["mode"] == "complete") { // 確認画面で再度エラーチェックを行う。(画面1) $arrErr = $this->lfErrorCheck1($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/index.tpl'; $this->tpl_title = '会員登録(1/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } // 確認画面で再度エラーチェックを行う。(画面2) $arrErr = $this->lfErrorCheck2($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/set1.tpl'; $this->tpl_title = '会員登録(2/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } // 確認画面で再度エラーチェックを行う。(画面3) $arrErr = $this->lfErrorCheck3($this->arrForm); if (count($arrErr) > 0) { $this->tpl_mainpage = 'entry/set2.tpl'; $this->tpl_title = '会員登録(3/3)'; $this->arrErr = $arrErr; //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); exit; } $this->CONF = $CONF; $this->uniqid = $this->lfRegistData($this->arrForm, $arrRegistColumn, $arrRejectRegistColumn, CUSTOMER_CONFIRM_MAIL, true, $this->arrForm["email"]); // 空メールを受信済みの場合はすぐに本登録完了にする。 if (isset($_SESSION['mobile']['kara_mail_from'])) { $param = array("mode" => "regist", "id" => $this->uniqid, session_name() => session_id()); $this->sendRedirect($this->getLocation(MOBILE_URL_DIR . "regist/index.php", $param)); exit; } $this->tpl_mainpage = 'entry/complete.tpl'; $this->tpl_title = '会員登録(完了ページ)'; $objMobile->sfMobileSetExtSessionId('id', $this->uniqid, 'regist/index.php'); // 仮登録完了メール送信 $this->to_name01 = $_POST['name01']; $this->to_name02 = $_POST['name02']; $objMailText = new SC_MobileView(); $objMailText->assignobj($this); $objHelperMail = new SC_Helper_Mail_Ex(); $objQuery = new SC_Query(); // 仮会員が有効の場合 if (CUSTOMER_CONFIRM_MAIL == true) { // Moba8パラメーターを保持する場合はカラム追加 if (isset($_SESSION['a8'])) { $this->etc_value = "&a8=" . $_SESSION['a8']; } $subject = $objHelperMail->sfMakeSubject($objQuery, $objMailText, $this, '会員登録のご確認'); $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl"); } else { $subject = $objHelperMail->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご完了'); $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); // ログイン状態にする $objCustomer->setLogin($_POST["email"]); } $objMail = new SC_SendMail(); $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"], $CONF["email01"]); // 宛先の設定 $name = $_POST["name01"] . $_POST["name02"] . " 様"; $objMail->setTo($_POST["email"], $name); $objMail->sendMail(); // 完了ページに移動させる。 $this->sendRedirect($this->getLocation("./complete.php"), true); exit; } } } //---- ページ表示 $objView->assignobj($this); $objView->display(SITE_FRAME); }
function sfTax($price, $tax = null, $tax_rule = null) { // 店舗基本情報を取得 static $CONF; if (is_null($CONF) && (is_null($tax) || is_null($tax_rule))) { $CONF = SC_Helper_DB_Ex::sf_getBasisData(); } if (is_null($tax)) { $tax = $CONF['tax']; } if (is_null($tax_rule)) { $tax_rule = $CONF['tax_rule']; } $real_tax = $tax / 100; $ret = $price * $real_tax; switch ($tax_rule) { // 四捨五入 case 1: $ret = round($ret); break; // 切り捨て // 切り捨て case 2: $ret = floor($ret); break; // 切り上げ // 切り上げ case 3: $ret = ceil($ret); break; // デフォルト:切り上げ // デフォルト:切り上げ default: $ret = ceil($ret); break; } return $ret; }
function lfGetOrderDetail($order_id) { $objQuery = new SC_Query(); if (DB_TYPE == "mysql") { // CUSTOM FOR MYSQL $col = "od.product_id AS product_id, od.product_code AS product_code, od.product_name AS product_name, od.classcategory_name1 AS classcategory_name1,\nod.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate,\no.status AS status, p.down AS down, (SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD(o.create_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY)))) AS effective"; $where = "p.product_id = od.product_id AND od.order_id = o.order_id AND od.order_id = ?"; $objQuery->setorder("classcategory_id1, classcategory_id2"); $arrRet = $objQuery->select($col, "dtb_products p, dtb_order_detail od, dtb_order o", $where, array($order_id)); } else { // CUSTOM FOR POSTGRESQL $baseinfo = SC_Helper_DB_Ex::sf_getBasisData(); $col = "od.product_id AS product_id, od.product_code AS product_code, od.product_name AS product_name, od.classcategory_name1 AS classcategory_name1,\nod.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate,\no.status AS status, p.down AS down, (SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 THEN 1 WHEN DATE(NOW()) <= DATE(o.create_date + '" . $baseinfo['downloadable_days'] . " days') THEN 1 ELSE 0 END) AS effective"; $where = "p.product_id = od.product_id AND od.order_id = o.order_id AND od.order_id = ?"; $objQuery->setorder("classcategory_id1, classcategory_id2"); $arrRet = $objQuery->select($col, "dtb_products p, dtb_order_detail od, dtb_order o", $where, array($order_id)); } return $arrRet; }