Changeset 20140
- Timestamp:
- 2011/02/11 18:57:18 (15 years ago)
- Location:
- branches/version-2_5-dev/data
- Files:
-
- 4 edited
-
Smarty/templates/default/mypage/refusal_confirm.tpl (modified) (1 diff)
-
Smarty/templates/mobile/mypage/refusal.tpl (modified) (1 diff)
-
Smarty/templates/sphone/mypage/refusal_confirm.tpl (modified) (1 diff)
-
class/pages/mypage/LC_Page_Mypage_Refusal.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/default/mypage/refusal_confirm.tpl
r20116 r20140 28 28 <form name="form1" method="post" action="?"> 29 29 <input type="hidden" name="mode" value="complete" /> 30 <input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" /> 30 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 31 31 32 <div id="mycontentsarea"> 32 33 <h3><!--{$tpl_subtitle|h}--></h3> -
branches/version-2_5-dev/data/Smarty/templates/mobile/mypage/refusal.tpl
r20116 r20140 27 27 <form action="?" method="post"> 28 28 <input type="hidden" name="mode" value="complete"> 29 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 30 29 31 <input type="submit" name="complete" value="退会する"> 30 32 </form> -
branches/version-2_5-dev/data/Smarty/templates/sphone/mypage/refusal_confirm.tpl
r20116 r20140 28 28 <form name="form1" method="post" action="?"> 29 29 <input type="hidden" name="mode" value="complete" /> 30 <input type="hidden" name=" uniqid" value="<!--{$tpl_uniqid}-->" />30 <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 31 31 <div id="mycontentsarea"> 32 32 <h3><!--{$tpl_subtitle|h}--></h3> -
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php
r20116 r20140 23 23 24 24 // {{{ requires 25 require_once(CLASS_REALDIR . "pages/ LC_Page.php");25 require_once(CLASS_REALDIR . "pages/mypage/LC_Page_AbstractMypage.php"); 26 26 27 27 /** … … 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_Mypage_Refusal extends LC_Page {34 class LC_Page_Mypage_Refusal extends LC_Page_AbstractMypage { 35 35 36 36 // }}} … … 44 44 function init() { 45 45 parent::init(); 46 $this->tpl_title = 'MYページ';46 $this->tpl_title = 'MYページ'; 47 47 $this->tpl_subtitle = '退会手続き(入力ページ)'; 48 $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl';49 $this->tpl_mainno = 'mypage';48 $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl'; 49 $this->tpl_mainno = 'mypage'; 50 50 $this->tpl_mypageno = 'refusal'; 51 51 } … … 58 58 function process() { 59 59 parent::process(); 60 $this->action();61 $this->sendResponse();62 60 } 63 61 … … 68 66 */ 69 67 function action() { 70 $objCustomer = new SC_Customer();71 $objSiteSess = new SC_SiteSession();72 73 // 退会判定用情報の取得74 $this->tpl_login = $objCustomer->isLoginSuccess(true);75 76 $this->lfCheckLogin();77 68 78 69 switch ($this->getMode()){ 79 70 case 'confirm': 80 81 $this->tpl_mainpage = TEMPLATE_REALDIR . 'mypage/refusal_confirm.tpl'; 82 $this->tpl_subtitle = '退会手続き(確認ページ)'; 83 84 // 確認ページを経由したことを登録 85 $objSiteSess->setRegistFlag(); 86 // hiddenにuniqidを埋め込む 87 $this->tpl_uniqid = $objSiteSess->getUniqId(); 88 71 $this->tpl_mainpage = TEMPLATE_REALDIR . 'mypage/refusal_confirm.tpl'; 72 $this->tpl_subtitle = '退会手続き(確認ページ)'; 89 73 break; 90 74 91 75 case 'complete': 92 // 正しい遷移かどうかをチェック 93 $this->lfIsValidMovement($objSiteSess); 94 $this->lfDeleteCustomer(); //会員削除 76 if (!SC_Helper_Session_Ex::isValidToken()) { 77 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); 78 } 79 80 $objCustomer = new SC_Customer(); 81 $this->lfDeleteCustomer($objCustomer->getValue('customer_id')); 82 $objCustomer->EndSession(); 83 SC_Response_Ex::sendRedirect('refusal_complete.php'); 95 84 } 96 85 // mobileは確認画面がない 86 $this->transactionid = SC_Helper_Session_Ex::getToken(); 97 87 } 98 88 … … 106 96 } 107 97 108 // 正しい遷移かどうかをチェック109 function lfIsValidMovement(&$objSiteSess) {110 // uniqid がPOSTされているかをチェック111 $uniqid = $objSiteSess->getUniqId();112 if ($objSiteSess->isPrePage() || !empty($_POST['uniqid']) && ($_POST['uniqid'] === $uniqid) ) {113 return;114 } else {115 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess);116 }117 }118 98 119 function lfCheckLogin(){ 120 $objCustomer = new SC_Customer(); 121 //ログイン判定 122 if (!$objCustomer->isLoginSuccess(true)){ 123 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 124 }else { 125 //マイページトップ顧客情報表示用 126 $this->CustomerName1 = $objCustomer->getvalue('name01'); 127 $this->CustomerName2 = $objCustomer->getvalue('name02'); 128 $this->CustomerPoint = $objCustomer->getvalue('point'); 129 } 130 } 99 /** 100 * 会員情報を削除する 101 * 102 * @access private 103 * @return void 104 */ 105 function lfDeleteCustomer($customer_id){ 106 $objQuery = SC_Query::getSingletonInstance(); 131 107 132 function lfDeleteCustomer(){ 133 $objQuery = new SC_Query(); 134 $objCustomer = new SC_Customer(); 135 //会員削除 136 $objQuery->exec("UPDATE dtb_customer SET del_flg=1, update_date=now() WHERE customer_id=?", array($objCustomer->getValue('customer_id'))); 137 138 $objCustomer->EndSession(); 139 //完了ページへ 140 SC_Response_Ex::sendRedirect('refusal_complete.php'); 141 exit; 108 $sqlval['del_flg'] = 1; 109 $sqlval['update_date'] = 'now()'; 110 $where = 'customer_id = ?'; 111 $objQuery->update('dtb_customer', $sqlval, $where, array($customer_id)); 142 112 } 143 113 144 114 } 145 ?>
Note: See TracChangeset
for help on using the changeset viewer.
