<?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      Your Name <mail@example.com>
 * @access      public
 */
class Admin_Itemmanage_Rankchange_Done_Releasedate
{

    var $title;
    var $pagename;
    var $div;

    var $db_item;
    var $upduser;

    var $makercd;
    var $labelcd;
    var $maker_capi;
    var $src_title;
    var $src_stock;
    var $src_image;
    var $src_media;
    var $src_release;

    var $itemcd;
    var $rankcheck;
    var $rankingrate;

    var $norank;

    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Rankchange_Doneが実行されました", "Admin_Itemmanage_Rankchange_Done_Releasedate#execute");
        $date = date("Y-m-d");
        foreach($this->rankcheck as $key => $value){
            $data = $this->db_item->getItemWeb($this->itemcd[$key]);
            $res =  $this->db_item->updateItemWeb($this->itemcd[$key], 
                                                  $date, 
                                                  $data['rankingrate'], 
                                                  $data['comment'], 
                                                  $this->upduser, 
                                                  $data['updcnt']);
        }
        
        if (!res) return "error";
        if (empty($this->rankcheck)){
            $this->norank = "no";
            return "error";
        }
        return 'success';
    }
}
?>
