<?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     
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Seller_Itemexhibit_Receive
{
    var $auth;
    var $c_itemexhibit;
    var $data;
    var $membercd;
    var $range;
    var $range_y;
    var $d;

    function execute()
    {
        $log =& LogFactory::getLog();

        $this->membercd = $this -> auth -> getAuthData("membercd");

        if (empty($this->range)) $this->range = (int)date("m");
        if (empty($this->range_y)) $this->range_y = (int)date("Y");
        if (isset($this->d))     $d = true;
        else                     $d = false;
        $sdate = $this->getSdate();
        $edate = $this->getEdate();
        $this->data = $this->c_itemexhibit->getReceiveManage(
                                            $this->membercd, 
                                            $sdate, 
                                            $edate,
                                            $d);
        return 'success';
    }

    function getRangeY() {
        $r = array();
        for ($i = 2007; $i <= date("Y"); $i++) $r[] = $i;
        return $r;
    }

    function getSdate() {
        $time = mktime(0,0,0,$this->range,1,$this->range_y);
        return date("Y-m-d", $time);
    }
    function getEdate() {
        // 次の月の1日とする
        $time = mktime(0,0,0,$this->range+1,1,$this->range_y);
        return date("Y-m-d", $time);
    }
}
?>
