<?php
class PaDefault extends CustomPage {
	public $ssetParid=1;
	
	public function PaDefault(){
		$this->ComPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='单位';
		$this->sLimitCount=0;
		
		//-- ------ #ActionType ------ --
		if($this->sActionType=='DUnitSearch'){
			$this->OnUnitSearch();
			
		}
	}
	public function OnUnitSearch(){
		//ControlName,Keyword,Parid,Zoneid
		$this->sSearchAR0=$this->AnalyerRequest('DUnitSearch',',,,,-1',0);
		//-- ------ #Search data ------ --
		$tmpListSTR='DList0';
		$tmpListAR=$this->AnalyerRequest($tmpListSTR,'1,0,36,0',0);
		$tmpSortSTR='DSort0';
		$tmpSortAR=$this->AnalyerRequest($tmpSortSTR,'sztID,1',0);
		//#Spell sql
		$tmpSQL=' SELECT A.coutID,A.coutName,A.coutParid
			FROM {Nets.TableHead}communit AS A 
			WHERE 1=1 AND A.coutRecycle=0 AND A.coutChecked>1 ';
		if($this->sSearchAR0[1]!=''){
			$tmpSQL.=' AND A.coutName LIKE \'%'.$this->sSearchAR0[1].'%\' ';
		}
		if($this->sSearchAR0[2]!=-1){
			$tmpSQL.=' AND A.coutParid='.$this->sSearchAR0[2].' ';
		}
		
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$this->sListData=$this->sDb->SearchP($tmpSTR,$tmpListAR);
		//#Set page button
		$this->sPAjaxButton->sPage=$this->sysPage;
		$this->sPAjaxButton->resetTemlate('../../../Config/m_default/File/pageButton3.htm');
		$this->sPAjaxButton->sExtendParameter='&DUnitSearch='.$this->sSearchAR0[0];
		$this->sPAjaxButton->setPage($this->sDb->sysPageInfo);

		return 0;
	}
	public function OnList(){
		
		return 0;
	}

}
?>