<?php
/**
 * [LJCMS] (C)2012-2099 LJdev,Inc.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2014.04.03
*/

class control extends salebase {
    
	public function action_run() {

        $var_array = array(
        			
        );            
        TPL::assign($var_array);
	    TPL::display($this->cptpl.'index.tpl');
        }

        public function action_welcome(){

	        // 未发货订单
			$searchsql = " AND status not in ('待付款') AND status not in ('已发货')";
	        $model = parent::model('order', 'am');
	        list($total, $data) = $model->getList(array('page'=>$this->page, 'pagesize'=>$this->pagesize, 'searchsql'=>$searchsql));
	        unset($model);

	        //待审核采购订单
	        $model = parent::model('purchase', 'sa');
	        list($total1, $data1) = $model->notReview(array('page'=>$this->page, 'pagesize'=>$this->pagesize));
	        
	        //待入库采购订单
	        $model = parent::model('purchase', 'sa');
	        list($total2, $data2) = $model->storage(array('page'=>$this->page, 'pagesize'=>$this->pagesize));







	        $var_array = array(
	        	'ordernum' => $total,
	        	'order1' => $data,
	        	'order111' =>'未发货订单',


	        	'purchase1' => $total1,
	        	'purchase11' => $data1,
	        	'purchase111' => '待审核采购订单',

	        	'purchase2' => $total2,
	        	'purchase22' => $data2,
	        	'purchase222' => '待入库采购订单',

	        );            
	        TPL::assign($var_array);
	        TPL::display($this->cptpl.'welcome.tpl');
        }
    
}
?>
