<?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: */

require_once 'Pager.php';

/**
 * メーカー一覧
 *
 * @package     Admin.Itemmanage.Nondelivery.List
 * @author      netnee T.Otogawa <tomokazu.otogawa@netnee.jp>
 * @access      public
 */


class Admin_Itemmanage_Nondelivery_List
{
    var $c_deliv;
    var $row;
    
    var $srcdispnum;        // 表示件数
    var $srcdispnumlist;    // 表示件数リスト

    var $title;
    var $pagetitle;
    var $pagename;
    var $session;

    // 入力パラメータ
    var $cnt;         // 総登録件数
    var $pageID;      // ページ番号
    
	var $Pager_perPage;
	var $Pager_delta;
	var $Pager_append;
	var $Pager_clearIfVoid;
	var $Pager_urlVar;
	var $Pager_useSessions;
	var $Pager_closeSession;
	var $Pager_mode;
	var $Pager_prevImg;
	var $Pager_nextImg;
	var $Pager_altPage;
	var $Pager_altPrev;
	var $Pager_altNext;
	var $Pager_altFirst;
	var $Pager_altLast;
	var $Pager_firstPagePre;
	var $Pager_firstPageText;
	var $Pager_firstPagePost;
	var $Pager_lastPagePre;
	var $Pager_lastPageText;
	var $Pager_lastPagePost;
	var $Pager_separator;
	var $Pager_spacesBeforeSeparator;
	var $Pager_spacesAfterSeparator;

	function getPager()
	{
        // Pager設定
        $pageparams = array(
        'totalItems'    => $this->cnt,
        'perPage'       => $this->Pager_perPage,       // １ページの行数
        'delta'         => $this->Pager_delta,       // 表示ページから、前後に表示するページ数
        'append'        => $this->Pager_append,
        'currentPage'   => $this->pageID,
        'clearIfVoid'   => $this->Pager_clearIfVoid,
        'urlVar'        => $this->Pager_urlVar,
        'useSessions'   => $this->Pager_useSessions,
        'closeSession'  => $this->Pager_closeSession,
        'mode'          => $this->Pager_mode,
        'prevImg'       => $this->Pager_prevImg,
        'nextImg'       => $this->Pager_nextImg,
        'altPage'       => $this->Pager_altPage,
        'altPrev'       => $this->Pager_altPrev,
        'altNext'       => $this->Pager_altNext,
        'altFirst'      => $this->Pager_altFirst,
        'altLast'       => $this->Pager_altLast,
        'firstPagePre'  => $this->Pager_firstPagePre,
        'firstPageText' => $this->Pager_firstPageText,
        'firstPagePost' => $this->Pager_firstPagePost,
        'lastPagePre'   => $this->Pager_lastPagePre,
        'lastPageText'  => $this->Pager_lastPageText,
        'lastPagePost'  => $this->Pager_lastPagePost,
        'separator'     => $this->Pager_separator,
        'spacesBeforeSeparator' => $this->Pager_spacesBeforeSeparator,
        'spacesAfterSeparator'  => $this->Pager_spacesAfterSeparator,
        );
        
        // Pager出力
        $pager = & Pager::factory($pageparams);
        $this->pagedata = $pager->getPageData();
        $link =	$pager->getLinks();
        return $link["all"];
	}


    function execute()
    {
        // 検索取得
        $this->row = $this->c_deliv->selectNonDelivery($this->Pager_perPage, $this->Pager_perPage*($this->pageID - 1));

        //取得したレコード数
        //$this->cont = count($this->row);
        $this->cnt = $this->c_deliv->countNonDelivery();
        
        $tmplist = array();
        foreach($this->row as $val){
            $tmpval = array("orderno"      => $val['orderno'],
                             "suppliernm"  => $val['suppliernm'],
                             "makernm"     => $val['makernm'],
                             "makeritemcd" => $val['makeritemcd'],
                             "icd"         => $val['itemcd'],
                             "itemnm"      => $val['itemnm'],
                             "medianm"     => $val{'medianm'},
                             "orderdate"   => $val{'orderdate'},
                             "excnt"       => $val['excnt'],
                             "ndcnt"       => $val['ndcnt']);
            array_push($tmplist,$tmpval);
        }
        $this->row = $tmplist;

        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Nondelivery_Listが実行されました", "Admin_Itemmanage_Nondelivery_List#execute");

        return 'success';
    }
}
?>
