<?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     Admin.Itemmanage.Castitem.Done
 * @author      netnee <mail@example.com>
 * @access      public
 */
class Admin_Itemmanage_Castitem_Done
{
    var $itembasic;
    
    var $title;
    var $pagename;
    var $upduser;
    var $div;
    
    var $itemdiv;
    var $jancode;
    var $hinban;
    var $itemtitle;
    var $release_date_start;
    var $release_date_end;
    var $publish_date_start;
    var $publish_date_end;
    var $maker_capital;
    var $maker_name;
    var $media;
    var $cast;
    var $situation;
    var $photo_situation;
    var $publish_situation;
    var $sort;
    var $genre_select;
    
    var $cd;
    var $mode;
    var $cast_name;
    var $castcd;
    var $disppriority;
    var $updcnt;
    
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Castitem_Doneが実行されました", "Admin_Itemmanage_Castitem_Done#execute");
        
        $res = false;
        
        $div = (empty($this->div)) ? 2 : 1;
        if (!empty($this->mode) && $this->mode == "insert"){
            if (strlen($this->disppriority)<=0) $this->disppriority = 1;
            // キャストを追加
            $res = $this->itembasic->insertCastItem($this->cd, $this->cast_name, $this->disppriority, $this->upduser);
        } elseif (!empty($this->mode) && $this->mode == "delete") {
            // キャストを削除
            $res = $this->itembasic->deleteCastItem($this->cd, $this->castcd, $this->updcnt, $this->upduser);
        }
        
        
        if ($res){
            return 'success';
        } else {
            return 'error';
        }
    }
}
?>
