<?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_Itemattribute_Watch_Complete
{
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    
    
    var $auth;
    var $c_watchlist;
    var $c_consumer;

    var $kubun;
    var $watchlistcd;
    var $itemcd;
    var $comment;
    var $pagetype;
    var $updcnt;
    
    function execute()
    {
        if ($this->kubun == 1) {
            $this->row = $this->c_watchlist->insert( $this -> auth -> getAuthData("membercd"),
                                                     $this -> itemcd,
                                                     $this -> comment,
                                                     $this -> auth -> getAuthData("membercd"));
            $this->pagetype = "追加";
        } else if ($this->kubun == 2) {
            $this->row = $this->c_watchlist->update( $this -> watchlistcd,
                                                     $this -> auth -> getAuthData("membercd"),
                                                     $this -> itemcd,
                                                     $this -> comment,
                                                     $this -> auth -> getAuthData("membercd"),
                                                     $this -> updcnt);
            $this->pagetype = "変更";
        } else if ($this->kubun == 3) {
            $this->row = $this->c_watchlist->delete( $this -> watchlistcd,
                                                     $this -> auth -> getAuthData("membercd"),
                                                     $this -> auth -> getAuthData("membercd"),
                                                     $this -> updcnt);

            $this->pagetype = "削除";
        }
        if (!$this->row) return 'input';
        
        $log =& LogFactory::getLog();
        $log->debug("Customer_Itemattribute_Watch_Completeが実行されました", "Customer_Itemattribute_Watch_Complete#execute");
        return 'success';
    }
    

}

?>