<?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      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Admin_Itemmanage_Sellpricechange_Done
{
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    
    var $title;
    var $pagename;
    var $upduser;
    var $div;
    
    //conponent
    var $db_stock;
    
    //検索post
    var $salestartdate_from;
    var $salestartdate_to;
    var $src_price;
    var $src_title;
    
    var $state;
    var $pricecheck;
    var $itemcd;
    var $structcd;
    var $stockcd;
    var $price;
    
    var $nopricelist;
    var $nopricecheck;
    
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Sellpricechange_Doneが実行されました", "Admin_Itemmanage_Sellpricechange_Done#execute");

        foreach($this->pricecheck as $key => $value){
            $res = $this->db_stock->updatePrice($this->itemcd[$key], 
                                                   $this->structcd[$key],
                                                   $this->stockcd[$key], 
                                                   $this->price[$key], 
                                                   $this->state,
                                                   $this->upduser);
        }

        if (!res) return "error";

        if (empty($this->pricecheck)){
            $this->nopricecheck = "no";
            return "error";
        }
        return 'success';
    }
}
?>
