Changeset 16392
- Timestamp:
- 2007/10/12 12:41:54 (15 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/pages/regist/LC_Page_Regist.php
r16379 r16392 45 45 */ 46 46 function process() { 47 $objConn = new SC_DBConn();48 47 $objQuery = new SC_Query(); 49 48 $objView = new SC_SiteView(); … … 109 108 */ 110 109 function mobileProcess() { 111 $obj Conn = new SC_DBConn();110 $objQuery = new SC_Query(); 112 111 $objView = new SC_MobileView(); 113 112 $objSiteInfo = $objView->objSiteInfo; … … 121 120 122 121 //-- 入力チェック 123 $this->arrErr = lfErrorCheck($_GET);122 $this->arrErr = $this->lfErrorCheck($_GET); 124 123 if ($this->arrErr) { 125 124 $this->tpl_mainpage = 'regist/error.tpl'; 126 $this->tpl_css = "/css/layout/regist/error.css";127 125 $this->tpl_title = 'エラー'; 128 126 129 127 } else { 130 //$this->tpl_mainpage = 'regist/complete.tpl';131 //$this->tpl_title = ' 会員登録(完了ページ)';132 128 $registSecretKey = $this->lfRegistData($_GET); //本会員登録(フラグ変更) 133 129 $this->lfSendRegistMail($registSecretKey); //本会員登録完了メール送信 134 130 135 131 // ログイン済みの状態にする。 136 $objQuery = new SC_Query(); 132 137 133 $email = $objQuery->get("dtb_customer", "email", "secret_key = ?", array($registSecretKey)); 138 134 $objCustomer->setLogin($email); … … 167 163 function lfRegistData($array) { 168 164 $objQuery = new SC_Query(); 169 $objConn = new SC_DBConn();170 165 $this->arrInfo; 171 166 172 167 do { 173 168 $secret = SC_Utils_Ex::sfGetUniqRandomId("r"); 174 } while( ($result = $obj Conn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($secret)) ) != 0);169 } while( ($result = $objQuery->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($secret)) ) != 0); 175 170 176 171 $sql = "SELECT email FROM dtb_customer WHERE secret_key = ? AND status = 1"; 177 $email = $obj Conn->getOne($sql, array($array["id"]));178 179 $obj Conn->query("BEGIN");172 $email = $objQuery->getOne($sql, array($array["id"])); 173 174 $objQuery->begin(); 180 175 $arrRegist["secret_key"] = $secret; // 本登録ID発行 181 176 $arrRegist["status"] = 2; 182 177 $arrRegist["update_date"] = "NOW()"; 183 178 184 $objQuery = new SC_Query();185 179 $where = "secret_key = ? AND status = 1"; 186 180 … … 208 202 209 203 $sql = "SELECT mailmaga_flg FROM dtb_customer WHERE email = ?"; 210 $result = $obj Conn->getOne($sql, array($email));204 $result = $objQuery->getOne($sql, array($email)); 211 205 212 206 switch($result) { … … 229 223 230 224 $objQuery->update("dtb_customer", $arrRegistMail, "email = " . SC_Utils_Ex::sfQuoteSmart($email). " AND del_flg = 0"); 231 $obj Conn->query("COMMIT");225 $objQuery->commit(); 232 226 233 227 return $secret; // 本登録IDを返す … … 237 231 function lfErrorCheck($array) { 238 232 239 $obj Conn = new SC_DbConn();233 $objQuery = new SC_Query(); 240 234 $objErr = new SC_CheckError($array); 241 235 … … 247 241 248 242 $sql = "SELECT customer_id FROM dtb_customer WHERE secret_key = ? AND status = 1 AND del_flg = 0"; 249 $result = $obj Conn->getOne($sql, array($array["id"]));243 $result = $objQuery->getOne($sql, array($array["id"])); 250 244 251 245 if (! is_numeric($result)) { … … 261 255 //---- 正会員登録完了メール送信 262 256 function lfSendRegistMail($registSecretKey) { 263 $obj Conn = new SC_DbConn();264 global $CONF;257 $objQuery = new SC_Query(); 258 $objHelperMail = new SC_Helper_Mail_Ex(); 265 259 266 260 //-- 姓名を取得 267 261 $sql = "SELECT email, name01, name02 FROM dtb_customer WHERE secret_key = ?"; 268 $result = $obj Conn->getAll($sql, array($registSecretKey));262 $result = $objQuery->getAll($sql, array($registSecretKey)); 269 263 $data = $result[0]; 270 264 271 265 //-- メール送信 272 266 $objMailText = new SC_SiteView(); 273 $objMailText->assign("CONF", $ CONF);267 $objMailText->assign("CONF", $this->CONF); 274 268 $objMailText->assign("name01", $data["name01"]); 275 269 $objMailText->assign("name02", $data["name02"]); 276 270 $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); 277 $subject = sfMakeSubject('会員登録が完了しました。');271 $subject = $objHelperMail->sfMakesubject($objQuery, $objMailText, $this, '会員登録が完了しました。'); 278 272 $objMail = new SC_SendMail(); 279 273 280 274 $objMail->setItem( 281 '' 282 , $subject //"【" .$CONF["shop_name"]. "】".ENTRY_CUSTOMER_REGIST_SUBJECT// サブジェクト283 , $toCustomerMail 284 , $CONF["email03"] 285 , $CONF["shop_name"] 286 , $CONF["email03"] 287 , $CONF["email04"] 288 , $CONF["email04"] 275 '' // 宛先 276 , $subject // サブジェクト 277 , $toCustomerMail // 本文 278 , $CONF["email03"] // 配送元アドレス 279 , $CONF["shop_name"] // 配送元 名前 280 , $CONF["email03"] // reply_to 281 , $CONF["email04"] // return_path 282 , $CONF["email04"] // Errors_to 289 283 ); 290 284 // 宛先の設定 -
branches/feature-module-update/data/class/pages/regist/LC_Page_Regist_Complete.php
r15532 r16392 14 14 * @package Page 15 15 * @author LOCKON CO.,LTD. 16 * @version $Id $16 * @version $Id:LC_Page_Regist_Complete.php 15532 2007-08-31 14:39:46Z nanasess $ 17 17 */ 18 18 class LC_Page_Regist_Complete extends LC_Page { … … 54 54 // レイアウトデザインを取得 55 55 $helper = new SC_Helper_PageLayout_Ex(); 56 $ this = $helper->sfGetPageLayout($this, false, DEF_LAYOUT);56 $helper->sfGetPageLayout($this, false, DEF_LAYOUT); 57 57 58 $objView->assignobj($ objPage);58 $objView->assignobj($this); 59 59 // フレームを選択(キャンペーンページから遷移なら変更) 60 if($ objPage->dir_name != "") {60 if($this->dir_name != "") { 61 61 $objView->display(CAMPAIGN_TEMPLATE_PATH . $dir_name . "/active/site_frame.tpl"); 62 62 $objCampaignSess->delCampaign(); … … 64 64 $objView->display(SITE_FRAME); 65 65 } 66 } 67 68 /** 69 * モバイルページを初期化する. 70 * 71 * @return void 72 */ 73 function mobileInit() { 74 $this->init(); 75 } 76 77 /** 78 * Page のプロセス(モバイル). 79 * 80 * @return void 81 */ 82 function mobileProcess() { 83 $objView = new SC_MobileView(); 84 85 // カートが空かどうかを確認する。 86 $objCartSess = new SC_CartSession("", false); 87 $this->tpl_cart_empty = count($objCartSess->getCartList()) < 1; 88 89 $objView->assignobj($this); 90 $objView->display(SITE_FRAME); 66 91 } 67 92 -
branches/feature-module-update/html/mobile/redirect.php
r16124 r16392 7 7 * 8 8 * 9 * モバイルサイト/ 空メールの返信からの遷移9 * モバイルサイト/メールからのリダイレクト 10 10 */ 11 11 12 // FIXME13 define('SKIP_MOBILE_INIT', true);14 require_once 'require.php';12 // {{{ requires 13 require_once("./require.php"); 14 require_once(CLASS_EX_PATH . "page_extends/LC_Page_Redirect_Ex.php"); 15 15 16 if (isset($_GET['token'])) { 17 $next_url = GC_Utils_Ex::gfFinishKaraMail($_GET['token']); 18 } 16 // }}} 17 // {{{ generate page 19 18 20 if (isset($next_url) && $next_url !== false) { 21 header("Location: $next_url"); 22 } else { 23 header('Location: ' . MOBILE_SITE_URL); 24 } 19 $objPage = new LC_Page_Redirect_Ex(); 20 $objPage->mobileInit(); 21 $objPage->mobileProcess(); 22 register_shutdown_function(array($objPage, "destroy")); 25 23 ?> -
branches/feature-module-update/html/mobile/regist/complete.php
r15532 r16392 1 1 <?php 2 /* 2 /** 3 * 3 4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 4 5 * 5 6 * http://www.lockon.co.jp/ 7 * 8 * 9 * モバイルサイト/会員登録完了 6 10 */ 7 11 12 // {{{ requires 8 13 require_once("../require.php"); 14 require_once(CLASS_EX_PATH . "page_extends/regist/LC_Page_Regist_Complete_Ex.php"); 9 15 10 class LC_Page{ 11 function LC_Page(){ 12 $this->tpl_mainpage = 'regist/complete.tpl'; 13 $this->tpl_css = '/css/layout/regist/complete.css'; 14 $this->tpl_title = '会員登録(完了ページ)'; 15 } 16 } 16 // }}} 17 // {{{ generate page 17 18 18 $objPage = new LC_Page(); 19 $objView = new SC_MobileView(); 20 21 // カートが空かどうかを確認する。 22 $objCartSess = new SC_CartSession("", false); 23 $objPage->tpl_cart_empty = count($objCartSess->getCartList()) < 1; 24 25 // レイアウトデザインを取得 26 $objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 27 28 $objView->assignobj($objPage); 29 $objView->display(SITE_FRAME); 30 19 $objPage = new LC_Page_Regist_Complete_Ex(); 20 $objPage->mobileInit(); 21 $objPage->mobileProcess(); 22 register_shutdown_function(array($objPage, "destroy")); 31 23 ?> -
branches/feature-module-update/html/mobile/regist/index.php
r16379 r16392 1 1 <?php 2 /* 2 /** 3 * 3 4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 4 5 * 5 6 * http://www.lockon.co.jp/ 7 * 8 * 9 * モバイルサイト/会員登録 6 10 */ 7 11 12 // {{{ requires 8 13 require_once("../require.php"); 14 require_once(CLASS_EX_PATH . "page_extends/regist/LC_Page_Regist_Ex.php"); 9 15 10 //---- ページ表示クラス 11 class LC_Page { 12 13 var $arrSession; 14 var $tpl_mainpage; 15 var $arrPref; 16 // }}} 17 // {{{ generate page 16 18 17 function LC_Page() { 18 $this->tpl_css = '/css/layout/regist/index.css'; // メインCSSパス 19 } 20 } 21 22 $objConn = new SC_DBConn(); 23 $objPage = new LC_Page(); 24 $objView = new SC_MobileView(); 25 $objSiteInfo = $objView->objSiteInfo; 26 $objCustomer = new SC_Customer(); 27 $CONF = sf_getBasisData(); 28 $arrInfo = $objSiteInfo->data; 29 30 //-- 本登録完了のためにメールから接続した場合 31 if ($_GET["mode"] == "regist") { 32 33 //-- 入力チェック 34 $objPage->arrErr = lfErrorCheck($_GET); 35 if ($objPage->arrErr) { 36 $objPage->tpl_mainpage = 'regist/error.tpl'; 37 $objPage->tpl_css = "/css/layout/regist/error.css"; 38 $objPage->tpl_title = 'エラー'; 39 40 } else { 41 //$objPage->tpl_mainpage = 'regist/complete.tpl'; 42 //$objPage->tpl_title = ' 会員登録(完了ページ)'; 43 $registSecretKey = lfRegistData($_GET); //本会員登録(フラグ変更) 44 lfSendRegistMail($registSecretKey); //本会員登録完了メール送信 45 46 // ログイン済みの状態にする。 47 $objQuery = new SC_Query(); 48 $email = $objQuery->get("dtb_customer", "email", "secret_key = ?", array($registSecretKey)); 49 $objCustomer->setLogin($email); 50 header("Location: " . gfAddSessionId("./complete.php")); 51 exit; 52 } 53 54 //-- それ以外のアクセスは無効とする 55 } else { 56 $objPage->arrErr["id"] = "無効なアクセスです。"; 57 $objPage->tpl_mainpage = 'regist/error.tpl'; 58 $objPage->tpl_css = "/css/layout/regist/error.css"; 59 $objPage->tpl_title = 'エラー'; 60 61 } 62 63 //---- ページ表示 64 $objView->assignobj($objPage); 65 $objView->display(SITE_FRAME); 66 67 //---- 登録 68 function lfRegistData($array) { 69 global $objConn; 70 global $arrInfo; 71 72 do { 73 $secret = sfGetUniqRandomId("r"); 74 } while( ($result = $objConn->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($secret)) ) != 0); 75 76 $sql = "SELECT email FROM dtb_customer WHERE secret_key = ? AND status = 1"; 77 $email = $objConn->getOne($sql, array($array["id"])); 78 79 $objConn->query("BEGIN"); 80 $arrRegist["secret_key"] = $secret; // 本登録ID発行 81 $arrRegist["status"] = 2; 82 $arrRegist["update_date"] = "NOW()"; 83 84 $objQuery = new SC_Query(); 85 $where = "secret_key = ? AND status = 1"; 86 87 $arrRet = $objQuery->select("point", "dtb_customer", $where, array($array["id"])); 88 // 会員登録時の加算ポイント(購入時会員登録の場合は、ポイント加算) 89 $arrRegist['point'] = $arrRet[0]['point'] + $arrInfo['welcome_point']; 90 91 $objQuery->update("dtb_customer", $arrRegist, $where, array($array["id"])); 92 93 /* 購入時の自動会員登録は行わないためDEL 94 // 購入時登録の場合、その回の購入を会員購入とみなす。 95 // 会員情報の読み込み 96 $where1 = "secret_key = ? AND status = 2"; 97 $customer = $objQuery->select("*", "dtb_customer", $where1, array($secret)); 98 // 初回購入情報の読み込み 99 $order_temp_id = $objQuery->get("dtb_order_temp", "order_temp_id"); 100 // 購入情報の更新 101 if ($order_temp_id != null) { 102 $arrCustomer['customer_id'] = $customer[0]['customer_id']; 103 $where3 = "order_temp_id = ?"; 104 $objQuery->update("dtb_order_temp", $arrCustomer, $where3, array($order_temp_id)); 105 $objQuery->update("dtb_order", $arrCustomer, $where3, array($order_temp_id)); 106 } 107 */ 108 109 $sql = "SELECT mailmaga_flg FROM dtb_customer WHERE email = ?"; 110 $result = $objConn->getOne($sql, array($email)); 111 112 switch($result) { 113 // 仮HTML 114 case '4': 115 $arrRegistMail["mailmaga_flg"] = 1; 116 break; 117 // 仮TEXT 118 case '5': 119 $arrRegistMail["mailmaga_flg"] = 2; 120 break; 121 // 仮なし 122 case '6': 123 $arrRegistMail["mailmaga_flg"] = 3; 124 break; 125 default: 126 $arrRegistMail["mailmaga_flg"] = $result; 127 break; 128 } 129 130 $objQuery->update("dtb_customer", $arrRegistMail, "email = " . SC_Utils_Ex::sfQuoteSmart($email). " AND del_flg = 0"); 131 $objConn->query("COMMIT"); 132 133 return $secret; // 本登録IDを返す 134 } 135 136 //---- 入力エラーチェック 137 function lfErrorCheck($array) { 138 139 global $objConn; 140 $objErr = new SC_CheckError($array); 141 142 $objErr->doFunc(array("仮登録ID", 'id'), array("EXIST_CHECK")); 143 if (! EregI("^[[:alnum:]]+$",$array["id"] )) { 144 $objErr->arrErr["id"] = "無効なURLです。メールに記載されている本会員登録用URLを再度ご確認ください。"; 145 } 146 if (! $objErr->arrErr["id"]) { 147 148 $sql = "SELECT customer_id FROM dtb_customer WHERE secret_key = ? AND status = 1 AND del_flg = 0"; 149 $result = $objConn->getOne($sql, array($array["id"])); 150 151 if (! is_numeric($result)) { 152 $objErr->arrErr["id"] .= "※ 既に会員登録が完了しているか、無効なURLです。<br>"; 153 return $objErr->arrErr; 154 155 } 156 } 157 158 return $objErr->arrErr; 159 } 160 161 //---- 正会員登録完了メール送信 162 function lfSendRegistMail($registSecretKey) { 163 global $objConn; 164 global $CONF; 165 166 //-- 姓名を取得 167 $sql = "SELECT email, name01, name02 FROM dtb_customer WHERE secret_key = ?"; 168 $result = $objConn->getAll($sql, array($registSecretKey)); 169 $data = $result[0]; 170 171 //-- メール送信 172 $objMailText = new SC_MobileView(); 173 $objMailText->assign("CONF", $CONF); 174 $objMailText->assign("name01", $data["name01"]); 175 $objMailText->assign("name02", $data["name02"]); 176 $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl"); 177 $subject = sfMakeSubject('本会員登録が完了しました。'); 178 $objMail = new SC_SendMail(); 179 180 $objMail->setItem( 181 '' // 宛先 182 , $subject//"【" .$CONF["shop_name"]. "】".ENTRY_CUSTOMER_REGIST_SUBJECT // サブジェクト 183 , $toCustomerMail // 本文 184 , $CONF["email03"] // 配送元アドレス 185 , $CONF["shop_name"] // 配送元 名前 186 , $CONF["email03"] // reply_to 187 , $CONF["email04"] // return_path 188 , $CONF["email04"] // Errors_to 189 ); 190 // 宛先の設定 191 $name = $data["name01"] . $data["name02"] ." 様"; 192 $objMail->setTo($data["email"], $name); 193 $objMail->sendMail(); 194 } 195 19 $objPage = new LC_Page_Regist_Ex(); 20 $objPage->mobileInit(); 21 $objPage->mobileProcess(); 22 register_shutdown_function(array($objPage, "destroy")); 196 23 ?> -
branches/feature-module-update/html/regist/complete.php
r16326 r16392 8 8 // {{{ requires 9 9 require_once("../require.php"); 10 require_once(CLASS_EX_PATH . "page_extends/regist/LC_Page_Regist_Compl ate_Ex.php");10 require_once(CLASS_EX_PATH . "page_extends/regist/LC_Page_Regist_Complete_Ex.php"); 11 11 12 12 // }}} 13 13 // {{{ generate page 14 14 15 $objPage = new LC_Page_Regist_Compl ate_Ex();15 $objPage = new LC_Page_Regist_Complete_Ex(); 16 16 $objPage->init(); 17 17 $objPage->process();
Note: See TracChangeset
for help on using the changeset viewer.