<?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=='DLinkSearch'){
			$this->OnLinkSearch();
			
		}
	}
	public function OnLinkSearch(){
		//ControlName,Keyword,Parid,Hot,Type
		$this->sSearchAR0=$this->AnalyerRequest('DLinkSearch',',-1,-1,,-1,0,-1',0);
		//-- ------ #Search data ------ --
		$tmpListSTR='DList0';
		$tmpListAR=$this->AnalyerRequest($tmpListSTR,'1,0,27,0',0);
		if($this->sSearchAR0[6]==1){
			$tmpListAR=$this->AnalyerRequest($tmpListSTR,'1,0,12,0',0);
		}
		
		$tmpSortSTR='DSort0';
		$tmpSortAR=$this->AnalyerRequest($tmpSortSTR,'sztID,1',0);
		//#Spell sql
		$tmpSQL=' SELECT A.coltID,A.coltName,A.coltParid,A.coltURL,B.colctSourceR00
			FROM {Nets.TableHead}commlink AS A
			INNER JOIN {Nets.TableHead}commlinkcont AS B ON B.colctIndexID=A.coltID
			WHERE 1=1 AND A.coltRecycle=0 AND A.coltChecked>1 ';
		if($this->sSearchAR0[3]!=''){
			$tmpSQL.=' AND A.coltName LIKE \'%'.$this->sSearchAR0[3].'%\' ';
		}
		if($this->sSearchAR0[4]!=-1){
			$tmpSQL.=' AND A.coltParid='.$this->sSearchAR0[4].' ';
		}
		
		$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->sFlag='Data';
		$this->sPAjaxButton->sPanel=$this->sSearchAR0[0].'_Box_'.$this->sSearchAR0[1].'_'.$this->sSearchAR0[2];
		$this->sPAjaxButton->resetTemlate('../../../Config/m_default/File/pageAjaxButton3.htm');
		$this->sPAjaxButton->sExtendParameter='&ActionType=DLinkSearch&DLinkSearch='.$this->sSearchAR0[0].$this->sysSPLIT1.$this->sSearchAR0[1].$this->sysSPLIT1.$this->sSearchAR0[2].$this->sysSPLIT1.$this->sSearchAR0[3].$this->sysSPLIT1.$this->sSearchAR0[4].$this->sysSPLIT1.$this->sSearchAR0[5].$this->sysSPLIT1.$this->sSearchAR0[6];
		$this->sPAjaxButton->setPage($this->sDb->sysPageInfo);

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

}
?>