<?php
class _ACTIONNAME_Action extends HomeAction{
    public function _initialize() {
        parent::_initialize();
    }
	
	public function index(){
		$name = $this->getActionName();
        $action = D($name);
        $ary_get['pageall'] = $this->_get('pageall', 'htmlspecialchars', 10);
        $count = $action->where($where)->count();
        $obj_page = $this->_Page($count, $ary_get['pageall']);
        $page = $obj_page->newshow();
        $ary_data = $action->where($where)->limit($obj_page->firstRow, $obj_page->listRows)->order(array('order'=>'desc'))->select();
        $this->assign("data", $ary_data);
        $this->assign("page", $page);
        $this->assign("filter",$ary_get);
        $this->display();		
	}	
    
    public function show(){
		$name = $this->getActionName();
		$id=abs(intval($this->_request('id')));
		if(!$id){
			$this->error("非法访问");
		}
		$datas = D($name)->where(array('id'=>$id))->find();
		$this->assign("datas",$datas);
		$this->display();
    }
	
	public function lists(){
		$name = $this->getActionName();
        $action = D($name);
        $ary_get['pageall'] = $this->_get('pageall', 'htmlspecialchars', 10);
		
		$catid=abs(intval($this->_request('catid')));
		$where=array();
		if($catid){
			$where['cid']=$catid;	
		}
        $count = $action->where($where)->count();
        $obj_page = $this->_Page($count, $ary_get['pageall']);
        $page = $obj_page->newshow();
        $ary_data = $action->where($where)->limit($obj_page->firstRow, $obj_page->listRows)->order(array('order'=>'desc'))->select();
        $this->assign("data", $ary_data);
        $this->assign("page", $page);
        $this->assign("filter",$ary_get);
        $this->display();		
	}
    
}