<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *
 * @package     [[package名]]
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Customer_Mypage_Moremember_Update_Done
{
    var $tilte;
    var $c_moremember;     //その他の登録情報用ＤＢクラス
    var $otherinfo;        //その他の登録情報
    var $otherinfo_serial; //その他の登録情報のシリアライズ化情報
    var $session;
    var $auth;             //ログイン情報
    
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    function execute()
    {
        $membercd = $this->auth->getAuthData("membercd");
        
        $log =& LogFactory::getLog();
        $log->debug("Customer_Mypage_Moremember_Update_Doneが実行されました", "Customer_Mypage_Moremember_Update_Done#execute");
        $updres = $this -> update();
        if(!$updres) return 'input';
        $genreres = $this->c_moremember->updateGenreMember($this->otherinfo->category, $membercd);
        if(!$genreres) return 'input';
        return 'success';
    }

    function setOtherinfo_serial($value)
    {
        $value = urldecode($value);
        $this -> otherinfo_serial = $value;
        $this -> otherinfo = unserialize($value);
    }

    function update()
    {
        $membercd = $this->auth->getAuthData("membercd");
        
        if($this -> otherinfo == "") {
            return false;
        } else {
            $res = $this -> c_moremember -> update($membercd, $this -> otherinfo);
            if($res == false) {
                return false;
            } else {
                return true;
            }
        }
    }
}
?>
