<?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     Seller.Itemexhibit.Register_Image_Form
 * @author      Y.Shiotzawa <yukie.shiozawa@netnee.jp>
 * @access      public
 */
class Seller_Itemexhibit_Register_Image_Form
{
    var $view;
    var $itemview;    
    var $auth;
    var $itemsearch;
    var $sidemenu;
    var $t_tag;
    var $session;
    var $tname;


    var $bodyid;

    var $res;
    var $results;
    var $cast;
    var $genre;
    var $img;
    var $pagedata;
    var $nowpages;
    var $totalpages;
    var $rc;

    var $start;
    var $end;

    var $list;
    var $sort;
    var $mkr;
    var $series;
    var $cst;
    var $gnr;
    var $lbl;
    var $era;
    var $etc;
    var $tag;

    var $q;
    var $select;
    var $q_select;
    var $keyword;
    var $itemnumber;
    var $jancode;

    var $item;
    
    var $cd;
    
    var $itemcd;
    var $from;
    var $structcd;
    var $stockcd;
    var $sellercd;
    var $itemnm;
    var $makernm;
    var $salestartdate;
    var $makerprice;
    var $saleformnm;
    var $medianm;
    var $rectime;
    var $makeritemcd;
    var $jancd;
    var $condition;
    var $conditionno;
    var $itemexp;
    var $sellingprice;
    var $souryouprc;
    var $exhibitcount;
    var $castnm;
    
    var $mode;
    
    var $mediacd;
    var $title;
    var $actionChain;

    var $itemregist;
    var $itemregist_serial;
    var $imgurllist;
    
    //seller_itemexhibit_now_info 用
    var $curnum;
    var $lowprice;

	//var $sort;
	var $pageID;
	var $listsize;

    /**
     * Actionの実行
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Seller_Itemexhibit_Register_Imageが実行されました", "Seller_Itemexhibit_Register_Image#execute");

        if($this->conditionno) $this->condition = $this->conditionno;
        
       if($this->from == "info"){
         $this->res = $this->view->getOneItemRow2($this->itemcd);
 
          $this->jancd        = $this->res["jancd"];
          $this->saleformnm   = $this->res["saleformnm"];
          $this->makernm   = $this->res["makernm"];
       
        $this->castnm = $this->view->getCastForItemcd($this->itemcd);
       }
       

        // 画像 URL 取得
        $typediv = "2";
        $struct = $this->structcd;

        $this->imgurllist = $this->itemview->UserImageUrl($typediv, $this->itemcd, $struct, $this->sellercd, $this->stockcd);

        $tmpcd = $this->itemcd . "-" . $struct . "-" . $this->sellercd. "-" . $this->stockcd;
        
        if (!empty($this->imgurllist[$tmpcd])){
            $this->mode = "upd";
        } else {
            $this->mode = "ins";
        }
        
        return 'success';
    }
    
    function getItemregist()
	{
    	return $this -> itemregist;
	}
	
    function getCastname($params)
    {
        return $this->castnm[0];

    }
    function getConditionName()
    {
        $condition = $this->tname->selectKey(9, $this->condition);
        return $condition["name"];
    }

}
?>
