<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */

class Admin_Portalmanage_News_Complete
{
	// ページ情報 
	var $pagename;
	var $title;
    var $from;    //ページ遷移元のアクション名
    
	// DB 
    var $news;
    
    // 入力パラメータ
    var $newscd;
    var $date;
    var $newstitle;
    var $body;
    var $releasediv;
    var $updcnt;
    var $kubun;
    
    function execute()
    {

        if($this->kubun == 1) { //　追加　
            $this->news->insert($this->date, $this->newstitle, $this->body, $this->releasediv, "fuco");
        } elseif($this->kubun == 2) { // 変更 
            $this->news->update($this->newscd, $this->date, $this->newstitle, $this->body, $this->releasediv, "fuco", $this->updcnt);
        } elseif($this->kubun == 3) { // 消去 
        	foreach( $this->newscd as $key=>$val ) {
                $this->news->delete($val, $this->updcnt[$key], "fuco");
        	}
        }
        $log =& LogFactory::getLog();
        $log->debug("Admin_Portalmanage_News_Completeが実行されました", "Admin_Portalmanage_News_Compelete#execute");
        return 'success';
    }
}
?>