<?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     Admin.Itemmanage.Order.Complete
 * @author      T.Shimano <shimano@fuco.jp>
 * @access      public
 */
class Admin_Itemmanage_Order_Complete
{   
	// DBインターフェイス
    var $itemorder;

	
	// 入力パラメータ
	var $itemcd;
	var $structcd;
	
	var $suppliercd;
	var $suppliediv;
	var $ordercd;
	
	var $orderunitprice;
	var $ordernum;
	
	// 検索パラメータ
    var $searchkey;
    
    // タイトル
    var $title;
    var $pagename;
    var $div;
	
	
    function execute()
    {
    	$itemcd = $this->itemcd;
    	$structcd = $this->structcd;
    	
    	$suppliercd = $this->suppliercd;
    	$suppliediv = $this->suppliediv;
    	$ordercd    = $this->ordercd;
    	
    	$orderunitprice = $this->orderunitprice;
    	$ordernum = $this->ordernum;
    	
    	foreach ($this->itemcd as $key=>$val ) {	
    		$res = $this->itemorder->update($itemcd[$key], $structcd[$key], $suppliercd, $suppliediv, $ordercd, $orderunitprice[$key], $ordernum[$key]);
    	    if(!$res) return 'invalidToken';
    	}
    	
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Order_Completeが実行されました", "Admin_Itemmanage_Order_Complete#execute");

        return 'success';
    }
    
    function getRequestGET()
    {
    	$str = "";
    	foreach ($this->searchkey as $key=>$val) {
    		if (!empty($val)) {
    			if($str != "") {
    				$str.= "&$key=$val";
    			} else {
    				$str = "$key=$val";
    			}
    		}
    	}
    	return $str;
    }

    function getRequestPOST()
    {
    	$str = "";
    	foreach ($this->searchkey as $key=>$val) {
    		if (!empty($val)) {
    			$str .= "<input type=\"hidden\" name=\"$key\" value=\"$val\">\r";
    		}
    	}
    	return $str;
    }
}
?>
