<?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.Input
 * @author      S.Oguma <shinichiro.oguma@netnee.jp>
 * @access      public
 */
class Seller_Itemexhibit_Register_Input
{
    var $view;
    var $auth;
    var $itemsearch;
    var $sidemenu;
    var $t_tag;
    var $session;
    var $c_mypage;
    var $tname;
    var $itemupdate;
    var $dlitem;
    
    var $bodyid;

    var $results;
    var $genre;
    var $tags;
    var $gnr;

    var $img;
    var $pagedata;
    var $nowpages;
    var $totalpages;
    var $rc;
    var $from;

    var $page;

    var $start;
    var $end;

    var $list;
    var $sort;

    var $item;
    var $c;
    var $sc;

    var $title;

    var $actionChain;

    var $condition;
    var $comment;
    var $price;
    var $shipping;
    var $number;


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

        $this->status = $this->c_mypage->checkStatus($this->auth->getAuthData("membercd"));
        if (!$this->status["scd"]) {
            $location = SSL_URL_ROOT.
                        htmlspecialchars($_SERVER["SCRIPT_NAME"], ENT_QUOTES).
                        '?action=customer_mypage_seller_insert_form';
            header('location:'.$location);
        }

        return 'success';
    }

    function getItemData() {
        $results = $this->view->getStructData($this->c, $this->sc);
        $results["stock"] = $this->view->getStockDetail($this->c,
                                                        $this->sc,
                                                        "onedepo");

        $gnr = $this->view->getGenreForItemcd();
        foreach ($gnr[$this->c] as $val) $c[] = $val[0];
        $results["genre"] = $this->view->getGenreTree($c);
        $results["tags"] = $this->t_tag->getPopularTag(NULL, $this->c);
        $results["dl"] = $this->dlitem->getDownloadItem($this->c, $this->sc);

        return $results;
    }
    
    function getBasicOption() {
        return $this->itemupdate->getOptionList(100,200);
    }
    function getStructOption() {
        return $this->itemupdate->getOptionList(200,300);
    }

    function getConditionList()
    {
        return $this->tname->selectDivAll(9);
    }
}
?>
