tpl_login = false; $this->tpl_disable_logout = false; $this->tpl_error = ""; } /** * Page のプロセス. * * @return void */ function process() { if(!file_exists(DATA_PATH.'downloads/donation.csv')){ $objQuery = new SC_Query; $ret = $objQuery->getOne("SELECT php_path FROM dtb_bloc WHERE php_path = 'frontparts/bloc/send_point.php'"); if(!$ret){ $objQuery->query("INSERT INTO dtb_bloc (bloc_name,tpl_path,filename,create_date,update_date,php_path,del_flg) VALUES('東北地方太平洋沖地震ポイント寄付','','send_point',NOW(),NOW(),'frontparts/bloc/send_point.php',0)"); } } $objCustomer = new SC_Customer(); $objCustomer->updateSession(); // クッキー管理クラス $objCookie = new SC_Cookie(COOKIE_EXPIRE); // ログイン判定 if($objCustomer->isLoginSuccess()) { $this->tpl_user_point = $objCustomer->getValue('point'); if (strlen($this->tpl_user_point) == 0) $this->tpl_user_point = 0; if(isset($_POST["sendpoint"]) and $this->isValidToken()){ //ポイント寄付処理 $point = intval(mb_convert_kana($_POST["sendpoint"],"n")); if(!$point or $this->tpl_user_point < $point){ $this->tpl_error = "1以上のポイントを保有ポイント内で半角数字で入力してください。"; }else{ $objQuery = new SC_Query; $sqlval = array('point' => ($this->tpl_user_point - $point)); $where = 'customer_id = ? AND del_flg = 0 AND status = 2'; $rs = $objQuery->update('dtb_customer', $sqlval, $where, array($objCustomer->getValue('customer_id'))); if($rs){ $fp = fopen(DATA_PATH.'downloads/donation.csv','a+'); fwrite($fp,date("Y-m-d G:i:s").",".$objCustomer->getValue('customer_id').",".$point."\n"); $objCustomer->setValue("point", ($this->tpl_user_point - $point)); $this->tpl_error = "ご協力ありがとうございます。".$point."ptを承りました。
寄付頂いたポイント分を、東北地方太平洋沖地震の復旧活動へ寄付いたします。"; } else { $this->tpl_error = "システムエラー"; } } } $this->tpl_login = true; $objCustomer->updateSession(); $this->tpl_user_point = $objCustomer->getValue('point'); if (strlen($this->tpl_user_point) == 0) $this->tpl_user_point = 0; $this->tpl_name1 = $objCustomer->getValue('name01'); $this->tpl_name2 = $objCustomer->getValue('name02'); } else { // クッキー判定 $this->tpl_login_email = $objCookie->getCookie('login_email'); if($this->tpl_login_email != "") { $this->tpl_login_memory = "1"; } // POSTされてきたIDがある場合は優先する。 if($_POST['login_email'] != "") { $this->tpl_login_email = $_POST['login_email']; } } $this->transactionid = $this->getToken(); } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } } $objPage = new LC_Page_FrontParts_Bloc_SendPoint(); register_shutdown_function(array($objPage, "destroy")); $objPage->init(); $objPage->process(); ?>

東北地方太平洋沖地震へのポイント寄付のお願い

tpl_login){?>

現在お客様が保有している当店のポイントを東北地方太平洋沖地震の復旧活動へ寄付出来ます。

下記フォームに寄付するポイント数を入力の上、「寄付」ボタンをクリックしてください。

運営担当者が寄付されたポイントを集計し、東北地方太平洋沖地震の復旧活動に寄付させて頂きます。

tpl_error; ?>

現在お客様が保有しているポイント:tpl_user_point ?>pt

ptを寄付

会員のお客様は、現在お客様が保有している当店のポイントを東北地方太平洋沖地震の復旧活動へ寄付できます。ログインしてご協力をお願いします。

- ログイン -

運営担当者が寄付されたポイントを集計し、東北地方太平洋沖地震の復旧活動へ寄付させて頂きます。