/** * 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); }