<?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.'netsuserunit','sttColumnHead'=>'uut'),
			array('sttTableName'=>$this->sysTableHead.'netsuserunitcont','sttColumnHead'=>'uuct'),);
		$this->sUiName='User/nets/s_unit_complete';
	}
	public function OnBInitial(){
		$this->sMetaTitle='单位';
		$this->sLimitCount=0;
		$this->sApp=new netsuserunit($this->sConnString);
		
	}
	public function OnModify(){
		parent::OnModify();
		$this->sUserInfo[0]['Columns']['uitTypeid']['Value']='1,2,3,4,5,';
		$tmpApp=new netsuserinfo($this->sConnString);
		$tmpINT=$tmpApp->Relogin($this->sUserInfo);
	}
	public function OnNormal(){
		$tmpSQL=' SELECT 
			* 
			FROM '.$this->sysTableHead.'netsuserunit AS A 
			INNER JOIN '.$this->sysTableHead.'netsuserunitcont AS B ON B.uuctIndexID=A.uutID
			INNER JOIN '.$this->sysTableHead.'netsuserinfo AS C ON C.uitUnitid=A.uutID
			WHERE 1=1 AND C.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']=='uutChecked' && $pFlag=='Search'){
			$pColumn['Option']=$this->sChecked2;
		}else if($pColumn['stcotName']=='uutParid' && $pFlag=='Search'){
			$pColumn['Option']=$this->sParid2;
		}else if($pColumn['stcotName']=='uuctCoSex' && $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="setActionType('Normal','DModify','','');" /></li>
<?php
		}
	}
	public function DefUiJscript($pFlag){
?>
function jsDCheck(pPara){
	var tmpControl="";
	var tmpError="";
	var tmpChecker=new netsChecker();
	var tmpActionWithOut=document.getElementById("ActionWithOut");
	var Coun0=0;
	//-- ------ #ActionWithOut ------ --
	if(tmpActionWithOut==undefined){
		return true;
	}
	if(tmpActionWithOut.value=="1"){
		return true;
	}else if(tmpActionWithOut.value=="2"){
		return false;
	}
	//-- ------ #Check ------ --
	//#uuctComName,请填写企业名称
	//#uuctComContact,请填写企业联系人
	//#uuctComContactTele,请填写企业联系电话
	//#uuctComZoneChoose,请填写所在地区
	//#uuctComZoneDetail,请填写详细地址
	//#uuctComContactWebsite,请填写企业主页
	//#uuctComContactEmail,请填写企业电邮
	//#uuctComContactFax,请填写企业传真
	//#uuctComProduct,请填写公司主要产品
	//#uuctComLogo,请填写公司LOGO
	
	//#uuctComName
	tmpCheckCont=document.getElementById("uuctComNameTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业名称"+sysSPLIT8;
	}
	//#uuctComContact
	tmpCheckCont=document.getElementById("uuctComContactTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业联系人"+sysSPLIT8;
	}
	//#uuctComContactTele
	tmpCheckCont=document.getElementById("uuctComContactTeleTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业联系电话"+sysSPLIT8;
	}
	//#uuctComZoneChoose
	tmpCheckCont=document.getElementById("uuctComZoneChooseTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写所在地区"+sysSPLIT8;
	}
	//#uuctComZoneDetail
	tmpCheckCont=document.getElementById("uuctComZoneDetailTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写详细地址"+sysSPLIT8;
	}
	//#uuctComContactWebsite
	tmpCheckCont=document.getElementById("uuctComContactWebsiteTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业主页"+sysSPLIT8;
	}
	//#uuctComContactEmail
	tmpCheckCont=document.getElementById("uuctComContactEmailTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业电邮"+sysSPLIT8;
	}
	//#uuctComContactFax
	tmpCheckCont=document.getElementById("uuctComContactFaxTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写企业传真"+sysSPLIT8;
	}
	//#uuctComProduct
	tmpCheckCont=document.getElementById("uuctComProductTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写公司主要产品"+sysSPLIT8;
	}
	//#uuctComLogo
	tmpCheckCont=document.getElementById("uuctComLogoTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<2){
		Coun0++;
		tmpError+=Coun0+".请填写公司LOGO"+sysSPLIT8;
	}

	//-- ------ #Result ------ --
	if(tmpError!=""){
		tmpSTR="<span class=\"FStrong\">对不起，您提交的内容存在以下错误:</span>"+sysSPLIT8+tmpError;
		showMessage("系统消息 - <?php echo ($this->sysFileConfig['bussinessMetaTitle']); ?>",tmpSTR,"","0");
		return false;
	}else{
		return true;
	}
}
<?php
	}
}
?>