<?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.Change.Update.Form
 * @author      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Admin_Itemmanage_Change_Update_Form
{
    var $view;
    var $itemupdate;

    var $result;
    var $castnm;
    var $genrenm;

    var $title;
    var $pagename;
    var $from;
    
    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 $itemcd;
    var $itemnm;
    var $itemnmkana;
    var $subtitle;
    var $maker_capi;
    var $makercd;
    var $labelcd;
    var $seriescd;
    var $iteminfo;
    var $comment;
    var $itemexp;

    var $genre;
    var $examgroupcd;
    var $rankingrate;
    var $itemdivcd;
    var $eirinrating;
    var $examno;
    var $releasedate;

    var $originaltitle;
    var $productyear;
    var $productcountry;

    var $updcnt;
    var $webupdcnt;
    var $cd;

    var $cas;
    var $return;

    var $option01;
    var $option02;
    var $option03;
    var $option04;
    var $option05;
    var $option06;
    var $option07;
    var $option08;
    var $option09;
    var $option10;

    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Change_Update_Formが実行されました", "Admin_Itemmanage_Change_Update_Form#execute");

        $this->result = $this->view->getOneItemRow(NULL);

        if (!isset($this->itemnm) && !isset($this->itemnmkana) && 
            !isset($this->maker_capi) && !isset($this->makercd) &&
            !isset($this->comment) && !isset($this->rankingrate) &&
            !isset($this->releasedate) && !isset($this->itemexp) &&
            !isset($this->option01) && !isset($this->option02) &&
            !isset($this->option03) && !isset($this->option04) &&
            !isset($this->option05) && !isset($this->option06) &&
            !isset($this->option07) && !isset($this->option08) &&
            !isset($this->option09) && !isset($this->option10)){
            
            $this->cd             = $this->result["itemcd"];
            $this->itemnm         = $this->result["itemnm"];
            $this->itemnmkana     = $this->result["itemnmkana"];
            $this->maker_capi     = $this->result["maker_capi"];
            $this->makercd        = $this->result["makercd"];
            $this->itemexp        = $this->result["itemexp"];
            $this->comment        = $this->result["comment"];
            $this->rankingrate    = $this->result["rankingrate"];
            $this->releasedate    = str_replace("-", "/", $this->result["releasedate"]);
            $this->updcnt         = $this->result["item_basic_updcnt"];
            $this->webupdcnt      = $this->result["item_web_attr_updcnt"];

            $this->option01       = $this->result["basic_option01"];
            $this->option02       = $this->result["basic_option02"];
            $this->option03       = $this->result["basic_option03"];
            $this->option04       = $this->result["basic_option04"];
            $this->option05       = $this->result["basic_option05"];
            $this->option06       = $this->result["basic_option06"];
            $this->option07       = $this->result["basic_option07"];
            $this->option08       = $this->result["basic_option08"];
            $this->option09       = $this->result["basic_option09"];
            $this->option10       = $this->result["basic_option10"];
        }

        return 'success';
    }
    function getOption() {
        return $this->itemupdate->getOptionList(100,200);
    }
    function getGenrename($params)
    {
        return $this->genrenm[$params["itemcd"]];
    }

    function getGenreCheckbox() {
        $genre["l"] = $this->view->getGenreTreeAll();
        $genre["s"] = $this->view->getGenrecdForItemcd($this->result["itemcd"]);
        return $genre;
    }
}
?>
