- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/class/pages/contact/LC_Page_Contact.php
r18562 r18609 38 38 39 39 /** 40 * Page を初期化する. 41 * 42 * @return void 43 */ 44 function init() { 45 parent::init(); 46 $this->tpl_mainpage = 'contact/index.tpl'; 47 $this->tpl_title = 'お問い合わせ(入力ページ)'; 48 $this->tpl_page_category = 'contact'; 49 50 $masterData = new SC_DB_MasterData_Ex(); 51 $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank")); 52 } 53 54 /** 55 * Page のプロセス. 56 * 57 * @return void 58 */ 59 function process() { 60 global $objCampaignSess; 61 62 $conn = new SC_DBConn(); 63 $this->objView = new SC_SiteView(); 64 $objCampaignSess = new SC_CampaignSession(); 65 $objDb = new SC_Helper_DB_Ex(); 66 $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 67 SC_Utils_Ex::sfDomainSessionStart(); 68 69 $objCustomer = new SC_Customer(); 70 71 $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : ""; 72 73 // レイアウトデザインを取得 74 $layout = new SC_Helper_PageLayout_Ex(); 75 $layout->sfGetPageLayout($this, false, DEF_LAYOUT); 76 77 //フォーム値変換用カラム 78 $arrConvertColumn = array( 40 * フォーム値変換用カラム 41 * 42 * 43 */ 44 var $arrConvertColumn = array( 79 45 array( "column" => "name01", "convert" => "aKV" ), 80 46 array( "column" => "name02", "convert" => "aKV" ), … … 87 53 array( "column" => "addr02", "convert" => "aKV" ), 88 54 array( "column" => "email", "convert" => "a" ), 89 array( "column" => "email02", "convert" => "a" ),90 55 array( "column" => "tel01", "convert" => "n" ), 91 56 array( "column" => "tel02", "convert" => "n" ), … … 94 59 ); 95 60 61 /** 62 * Page を初期化する. 63 * 64 * @return void 65 */ 66 function init() { 67 parent::init(); 68 $this->tpl_mainpage = 'contact/index.tpl'; 69 $this->tpl_title = 'お問い合わせ(入力ページ)'; 70 $this->tpl_page_category = 'contact'; 71 $this->httpCacheControl('nocache'); 72 73 $masterData = new SC_DB_MasterData_Ex(); 74 $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank")); 75 } 76 77 /** 78 * Page のプロセス. 79 * 80 * @return void 81 */ 82 function process() { 83 global $objCampaignSess; 84 85 $conn = new SC_DBConn(); 86 $this->objView = new SC_SiteView(); 87 $objCampaignSess = new SC_CampaignSession(); 88 $objDb = new SC_Helper_DB_Ex(); 89 $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 90 SC_Utils_Ex::sfDomainSessionStart(); 91 92 $objCustomer = new SC_Customer(); 93 94 $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : ""; 95 96 // レイアウトデザインを取得 97 $layout = new SC_Helper_PageLayout_Ex(); 98 $layout->sfGetPageLayout($this, false, DEF_LAYOUT); 99 96 100 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 97 101 98 102 switch ($_POST['mode']) { 99 103 case 'confirm': 100 // エラーチェック 101 $this->arrForm = $_POST; 102 $this->arrForm['email'] = isset($_POST['email']) ? strtolower($_POST['email']) : ''; 103 $this->arrForm['email02'] = isset($_POST['email02']) ? strtolower($_POST['email02']) : ''; 104 $this->arrForm = $this->lfConvertParam($this->arrForm,$arrConvertColumn); 105 $this->arrErr = $this->lfErrorCheck($this->arrForm); 106 if ( ! $this->arrErr ){ 107 // エラー無しで完了画面 108 $this->tpl_mainpage = 'contact/confirm.tpl'; 109 $this->tpl_title = 'お問い合わせ(確認ページ)'; 110 } else { 111 foreach ($arrConvertColumn as $key) { 112 $this->$key['column'] = $this->arrForm[$key['column']]; 113 } 114 } 115 break; 104 $this->lfContactConfirm(); 105 break; 116 106 117 107 case 'return': 118 foreach ($arrConvertColumn as $key) { 119 $this->$key['column'] = $_POST[$key['column']]; 120 } 121 break; 108 $this->lfContactReturn(); 109 break; 122 110 123 111 case 'complete': 124 $this->arrForm = $_POST; 125 $this->arrForm['email'] = strtolower($_POST['email']); 126 $this->arrForm = $this->lfConvertParam($this->arrForm,$arrConvertColumn); 127 $this->arrErr = $this->lfErrorCheck($this->arrForm); 128 if(!$this->arrErr) { 129 $this->lfSendMail($CONF, $this); 130 // 完了ページへ移動する 131 $this->sendRedirect($this->getLocation("./complete.php", array(), true)); 132 exit; 133 } else { 134 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 135 } 136 break; 112 $this->lfContactComplete(); 113 break; 137 114 138 115 default: 139 break;116 break; 140 117 } 141 118 … … 183 160 // }}} 184 161 // {{{ protected functions 162 163 /** 164 * 確認画面 165 * 166 * @return void 167 */ 168 function lfContactConfirm() { 169 // エラーチェック 170 $this->arrForm = $_POST; 171 $this->arrForm['email'] = strtolower($_POST['email']); 172 $this->arrForm = $this->lfConvertParam($this->arrForm,$this->arrConvertColumn); 173 $this->arrErr = $this->lfErrorCheck($this->arrForm); 174 if ( ! $this->arrErr ){ 175 // エラー無しで完了画面 176 $this->tpl_mainpage = 'contact/confirm.tpl'; 177 $this->tpl_title = 'お問い合わせ(確認ページ)'; 178 } else { 179 foreach ($this->arrForm as $key => $val){ 180 $this->$key = $val; 181 } 182 } 183 } 184 185 /** 186 * 前に戻る 187 * 188 * @return void 189 */ 190 function lfContactReturn() { 191 foreach ($_POST as $key => $val){ 192 $this->$key = $val; 193 } 194 } 195 196 /** 197 * 完了ページへ 198 * 199 * @return void 200 */ 201 function lfContactComplete() { 202 $this->arrForm = $_POST; 203 $this->arrForm['email'] = isset($_POST['email']) ? strtolower($_POST['email']) : ''; 204 $this->arrForm['email02'] = isset($_POST['email02']) ? strtolower($_POST['email02']) : ''; 205 $this->arrForm = $this->lfConvertParam($this->arrForm,$this->arrConvertColumn); 206 $this->arrErr = $this->lfErrorCheck($this->arrForm); 207 if(!$this->arrErr) { 208 $this->lfSendMail($this); 209 // 完了ページへ移動する 210 $this->sendRedirect($this->getLocation("./complete.php", array(), true)); 211 exit; 212 } else { 213 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 214 } 215 } 185 216 186 217 //エラーチェック処理部 … … 239 270 // ------------ メール送信 ------------ 240 271 241 function lfSendMail($CONF, &$objPage){ 242 272 function lfSendMail(&$objPage){ 273 $objDb = new SC_Helper_DB_Ex(); 274 $CONF = $objDb->sf_getBasisData(); // 店舗基本情報 243 275 $objQuery = new SC_Query(); 244 $objMailText = new SC_SiteView();245 276 $objSiteInfo = $this->objView->objSiteInfo; 246 277 $arrInfo = $objSiteInfo->data; 247 $objPage->tpl_shopname =$arrInfo['shop_name'];278 $objPage->tpl_shopname = $arrInfo['shop_name']; 248 279 $objPage->tpl_infoemail = $arrInfo['email02']; 249 $objMailText->assignobj($objPage); 250 $toCustomerMail = $objMailText->fetch("mail_templates/contact_mail.tpl"); 251 $objMail = new SC_SendMail(); 252 253 if ( $objPage->arrForm['email'] ) { 254 $fromMail_name = $objPage->arrForm['name01'] ." 様"; 255 $fromMail_address = $objPage->arrForm['email']; 256 } else { 257 $fromMail_name = $CONF["shop_name"]; 258 $fromMail_address = $CONF["email02"]; 259 } 280 281 $fromMail_name = $objPage->arrForm['name01'] ." 様"; 282 $fromMail_address = $objPage->arrForm['email']; 283 260 284 $helperMail = new SC_Helper_Mail_Ex(); 261 $subject = $helperMail->sfMakeSubject($objQuery, $objMailText, $this, "お問い合わせがありました。"); 262 $objMail->setItem( 263 $CONF["email02"] // 宛先 264 , $subject // サブジェクト 265 , $toCustomerMail // 本文 266 , $fromMail_address // 配送元アドレス 267 , $fromMail_name // 配送元 名前 268 , $fromMail_address // reply_to 269 , $CONF["email04"] // return_path 270 , $CONF["email04"] // Errors_to 271 ); 272 $objMail->sendMail(); 273 274 $subject = $helperMail->sfMakeSubject($objQuery, $objMailText, $this, "お問い合わせを受け付けました。"); 275 $objMail->setItem( 276 '' // 宛先 277 , $subject // サブジェクト 278 , $toCustomerMail // 本文 279 , $CONF["email03"] // 配送元アドレス 280 , $CONF["shop_name"] // 配送元 名前 281 , $CONF["email02"] // reply_to 282 , $CONF["email04"] // return_path 283 , $CONF["email04"] // Errors_to 284 ); 285 $objMail->setTo($objPage->arrForm['email'], $objPage->arrForm['name01'] ." 様"); 286 $objMail->sendMail(); 285 $helperMail->sfSendTemplateMail($CONF["email02"], $CONF["shop_name"], "5", $objPage, $fromMail_address, $fromMail_name, $fromMail_address); 286 $helperMail->sfSendTemplateMail($objPage->arrForm['email'], $objPage->arrForm['name01'] ." 様", "5", $objPage, $CONF["email03"], $CONF["shop_name"], $CONF["email02"]); 287 287 } 288 288 }
Note: See TracChangeset
for help on using the changeset viewer.