<?php
require($netsFileConfig['sysCoreRoot_Real'].'Inc/netsFunc/Func/netsSimpleXml.php');


class PaDefault extends CustomPage {
	public $ssetParid=1;
	
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnPInitial(){
		$this->checkUser('1,2,3,4,5,');
		$this->sActionType='Normal';
		$this->sTable=array(
			array('sttTableName'=>$this->sysTableHead.'netsuserinfo','sttColumnHead'=>'uit'),
			array('sttTableName'=>$this->sysTableHead.'netsuserinfocont','sttColumnHead'=>'uict'),);
		$this->sUiName='User/nets/my_myInfo0';
	}
	public function OnBInitial(){
		$this->sMetaTitle='用户';
		$this->sLimitCount=0;
		$this->sApp=new netsuserinfo($this->sConnString);
		//Sex
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=45;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$this->sSex1=$this->sSex2=$this->sControl->bindDropdown($tmpAR0);
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有审核状态]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sSex2,$tmpAR0);
	}
	public function OnModify(){
		parent::OnModify();
		$this->sUserInfo[4]['Columns']['uttType']['Value']='1,2,3,4,5,';
		$tmpINT=$this->sApp->Login($this->sUserInfo);
	}
	public function OnNormal(){
		$tmpSQL=' SELECT * 
			FROM '.$this->sysTableHead.'netsuserinfo AS A 
			INNER JOIN '.$this->sysTableHead.'netsuserinfocont AS B ON B.uictIndexID=A.uitID
			WHERE 1=1 AND A.uitID='.$this->sUserInfo[0]['Columns']['uitID']['Value'].' ';
		$tmpDataCollection0=$this->sDb->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$tmpRow=$tmpDataCollection0[0];
			$this->sMainID=$tmpRow[$this->sTable[0]['sttColumnHead'].'ID'];
			//-- #Get value --
			$Coun0=0;
			while (count($this->sUiDescription_Normal)>$Coun0) {
				if(isset($tmpRow[$this->sUiDescription_Normal[$Coun0]['stcotName']])){
					$this->sUiDescription_Normal[$Coun0]['Value']=$tmpRow[$this->sUiDescription_Normal[$Coun0]['stcotName']];
				}
				$Coun0++;
			}
		}else {}
	}
	
	public function DefUiPanel(&$pColumn,$pFlag){
		if($pColumn['stcotName']=='Quick'){
			$pColumn['ControlStyle']='width:50px;';
		}else if($pColumn['stcotName']=='uitChecked' && $pFlag=='Search'){
			$pColumn['Option']=$this->sChecked2;
		}else if($pColumn['stcotName']=='uitParid' && $pFlag=='Search'){
			$pColumn['Option']=$this->sParid2;
		}else if($pColumn['stcotName']=='uictCoSex' && $pFlag=='Normal'){
			$pColumn['Option']=$this->sSex1;
		}
		return $pColumn;
	}
	public function DefUiButton($pFlag,$Exception){
		parent::DefUiButton($pFlag,array('List','Normal','ListChildLink','NormalChildLink',));
		if($pFlag=='Normal'){ ?>
<li class="ButBut"><input type="submit" value="保存我的信息" class="Control2" onclick="tmpCommon.setActionType('Normal','DModify','','');" /></li>
<?php
		}
	}
}
?>