本文整理汇总了PHP中SC_Helper_DB_Ex::sf_getBasisData方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Helper_DB_Ex::sf_getBasisData方法的具体用法?PHP SC_Helper_DB_Ex::sf_getBasisData怎么用?PHP SC_Helper_DB_Ex::sf_getBasisData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Helper_DB_Ex
的用法示例。
在下文中一共展示了SC_Helper_DB_Ex::sf_getBasisData方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* @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();
}
示例2: process
/**
* 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);
}
示例3: process
/**
* 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();
}
//---- ページ表示
//.........这里部分代码省略.........
示例4: mobileProcess
/**
* 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";
//.........这里部分代码省略.........
示例5: mobileProcess
/**
* 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);
}
示例6: process
/**
* 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) {
//.........这里部分代码省略.........
示例7: mobileProcess
/**
* 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);
}
示例8: lfGetRealFileName
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];
}
示例9: mobileProcess
/**
* 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);
}
示例10: mobileProcess
/**
* 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)';
//.........这里部分代码省略.........
示例11: sfTax
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;
}
示例12: lfGetOrderDetail
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;
}