<?php

class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='品牌首页';
		$this->getUser('1,2,3,4,5,');
		//-- ------ #Option ------ --
		//Parid
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=' SELECT A.shsgtID,A.shsgtName,A.shsgtParid
			FROM '.$this->sysTableHead.'shopsalegroup AS A
			WHERE 1=1 AND A.shsgtRecycle=0 AND A.shsgtChecked>1 AND A.shsgtParid={Nets.Parid}
			ORDER BY A.shsgtOrderBy DESC,A.shsgtID DESC ';
		$tmpAR0['InitialString']=2;
		$tmpAR0['Parid']='shsgtID';
		$tmpAR0['Text']='shsgtName';
		$tmpAR0['Value']='shsgtID';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='nets/options_ShopsaleList_group';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sParid1);
		$this->sParid2=$this->sParid1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='所有分类';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sParid2,$tmpAR0);
		
	}
	public function OnList(){
		//-- ------ #LIST ------ --
		$tmpAR0=$this->AnalyerRequest($this->sysCookieHead.'CompareIDS','',2);
		$tmpAR0=explode($this->sysSPLIT2,$tmpAR0[0]);
		//-- ------ #Datas ------ --
		$tmpListSTR0='DList_Compare';
		$tmpListAR0=$this->AnalyerRequest($tmpListSTR0,'1,0,6,0',0);
		//-- #Spell SQL --
		$tmpSQL=' SELECT A.shstID,A.shstName,A.shstNameStyle,B.shsctSourceR00
			FROM {Nets.TableHead}shopsale AS A
			INNER JOIN {Nets.TableHead}shopsalecont AS B ON B.shsctIndexID=A.shstID
			WHERE 1=1 AND A.shstRecycle=0 AND A.shstChecked>1 AND (1=2 {Nets.IDS})
			ORDER BY A.shstOrderBy DESC,A.shstID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR_0='';
		foreach ($tmpAR0 as $Row0) {
			$tmpSTR_0.=' OR A.shstID='.$this->sCode->Int32($Row0,0);
		}
		$tmpSTR=str_replace('{Nets.IDS}',$tmpSTR_0,$tmpSTR);
		$this->sData_List=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		//#Set page button
		$this->sPAjaxButton->resetTemlate('../../../Config/m_default/File/pageButton3.htm');
		$this->sPAjaxButton->sPage=$this->sysPage;
		$this->sPAjaxButton->setPage($this->sDb->sysPageInfo);
		
		return 0;
	}
	public function getSearch($pValue,$pType){
/*
Parid
Keyword

ListType
OrderBy
Brand
PriceRang
*/
		$tmpAR0=array(
			$this->sMainID,
			$this->sKeyword,
			$this->sSearchAR[0],
			$this->sSearchAR[1],
			$this->sSearchAR[2],
			$this->sSearchAR[3],
			);
		if($pType==0) $tmpAR0[0]=$pValue;
		if($pType==1) $tmpAR0[1]=$pValue;
		if($pType==2) $tmpAR0[2]=$pValue;
		if($pType==3) $tmpAR0[3]=$pValue;
		if($pType==4) $tmpAR0[4]=$pValue;
		if($pType==5) $tmpAR0[5]=$pValue;

		//#SPICAL
		if ($pType==100) {
			/*
			$tmpAR0[8]=0;
			$tmpAR0[9]=0;
			$tmpAR0[10]=0;
			$tmpAR0[11]=0;
			$tmpAR0[12]=0;
			*/
		}else if ($pType==101) {
		}
		//#SPELL
		$tmpSTR=$this->sysPage.'?ID='.$tmpAR0[0].'&DKeyword='.$tmpAR0[1].'&DSearch='.
			$tmpAR0[2].$this->sysSPLIT1.$tmpAR0[3].$this->sysSPLIT1.$tmpAR0[4].$this->sysSPLIT1.$tmpAR0[5];
		return $tmpSTR;
	}
	
	
	
}

?>