<?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 Util_Dropmaker_Series
{
    var $maker;
    
    var $capital;  //頭文字
    var $dropid;   //メーカ名ドロップのID
    var $selid;   //メーカ名選択済みのID

    var $div;
    
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Util_Dropmakerが実行されました", "Util_Dropmaker#execute");

        return "success";
    }
    
    //文字出力
    function getOutput()
    {
        $div = (empty($this->div)) ? 2 : 1;
        $maker_results = array();
        
        $maker_results = $this->maker->selectOfSeries($div);
        
        /**************************
         * 出力フォーマットは以下の通り
         * 
         * ドロップのID
         * optionのname,optionのvalue,option.selected
         * optionのname,optionのvalue,option.selected
         * ...
         * 
         */

        $out = $this->dropid ."\n0,メーカー名,false";
        foreach ($maker_results as $key => $val) {
            $out .= "\n". $val["makercd"] .",". $val["makernm"];
            if ($this->selid == $val["makercd"]) {
                $out .= ",true";
            } else {
                $out .= ",false";
            }
        }
        return $out;
    }
}
?>
