<?php
class IndexAction extends HomeAction{
    public function _initialize() {
        parent::_initialize();
    }
    
    public function index(){
		$this->imagelist();
        $this->display();
    }
	
	public function news($catid,$num){
			$news_catid = D("Article")->where(array('cid'=>$catid))->limit(0,$num)->order('`order` desc,create_time desc')->select();
			$this->assign("news_".$catid,$news_catid);
	}
    
    public function cases($catid,$num){
		if($catid){
			$where=array('cid'=>$catid);	
		}
			$cases = D("Case")->where($where)->limit(0,$num)->order('`order` desc,create_time desc')->select();
			$this->assign("Cases".$catid,$cases);
    }
	public function page($id,$pagename='about'){
		$action=D('page');
		$pages=$action->where(array('id'=>$id))->find();
		$this->assign('page_'.$pagename,$pages);
	}
	public function links(){
		$action=D('Links');
		$links=$action->where()->select();
		$this->assign('links',$links);		
			
	}
	public function imagelist(){
		$action=D("Imagelist");
		$imagelist=$action->where()->select();
		$this->assign('imagelist',$imagelist);	
	}
    
}