<?php
class netssysoptiongroup extends netsDb {
	private $sysErrorClassID='0000';
	private $sysErrorFuncID=0;
	private $sysErrorID=0;
	
	public function netssysoptiongroup($pConnection){
		$this->netsDb($pConnection);
	}
	public function Check(&$pTableDescriptAR,$pExceptionAR1,$pExceptionAR2){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';

		if(count($pExceptionAR1)==0){
			$pExceptionAR1=array();
		}
		parent::Check($pTableDescriptAR,$pExceptionAR1,$pExceptionAR2);
		//
		$tmpSTR='sogtName';
		if(strlen($pTableDescriptAR[0]['Columns'][$tmpSTR]['Value'])<1 && !in_array($tmpSTR,$pExceptionAR2)){
			$this->sysLastError='提交内容错误:1.名称不能为空';
			return $this->sysErrorFuncID.'001';
		}
		
		return 0;
	}
	public function makeCache(){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		//-- ------ ### ------ --
		$tmpSQL=' SELECT A.sogtID,A.sogtName
			FROM {Nets.TableHead}netssysoptiongroup AS A
			WHERE 1=1 AND A.sogtRecycle=0 AND A.sogtChecked>1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		//-- ------ ### ------ --
		$tmpSQL=' SELECT A.sotID,A.sotName,A.sotValue,A.sotParid,A.sotNumCode,A.sotNameStyle,
			A.sotIntroduct,A.sotSourceR00
			FROM {Nets.TableHead}netssysoption AS A
			WHERE 1=1 AND A.sotRecycle=0 AND A.sotChecked>1 AND A.sotParid={Nets.Parid}
			ORDER BY A.sotOrderBy DESC,A.sotID DESC ';
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Parid}',$Row0['sogtID'],$tmpSTR);
			$tmpData1=$this->Search($tmpSTR);
			
			$Coun1=0;
			$tmpCONTENT='<?php $tmpSTR=\' ';
			foreach ($tmpData1 as $Row1){
				$tmpCONTENT.=$Row1['sotID'].$this->sysSPLIT6.
					$Row1['sotName'].$this->sysSPLIT6.
					$Coun1.$this->sysSPLIT6.
					$Row1['sotParid'].$this->sysSPLIT6.
					$Row1['sotName'].$this->sysSPLIT6.
					$Row1['sotValue'].$this->sysSPLIT6.
					$Row1['sotSourceR00'].$this->sysSPLIT6.
					$Row1['sotIntroduct'].$this->sysSPLIT6.
					$Row1['sotNameStyle'].$this->sysSPLIT6.
					$Row1['sotName'].$this->sysSPLIT6.
					''.$this->sysSPLIT6.$this->sysSPLIT7;
				
				$Coun1++;
			}
			$tmpCONTENT.='\'; ?>';
			$tmpFilepath=$this->sysFileConfig['PathRoot'].$this->sysFileConfig['sysDataCachePath'].'options_cache/option_'.$Row0['sogtID'].'.php';
			$tmpINT=$this->writeFile($tmpFilepath,$tmpCONTENT);
			
			$Coun0++;
		}
		
		return 0;
	}
	
	
}
?>