<?php
class Normal_TextChoose extends netsControl {
	public function Normal_TextChoose(){
		$this->netsControl();
	}
	public function Control($pColumn){
		$tmpControl=$pColumn['stcotName'].'Txt'.$pColumn['NameExtend'];
		$tmpIntroduct='';
		if(strlen($pColumn['stcoctUiIntroduct'])>0 && $pColumn['stcoctUiIntroduct']!='&nbsp;'){
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="ControlIntroduct">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}else{
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="DHidden">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}
		
		$tmpParameters=$pColumn['Parameter'];
		if($tmpParameters!='' && count($tmpParameters)>1 && isset($tmpParameters['Type'])){
		}else{
			$tmpParameters=array(
				'Type'=>'chooseSearch',
				'Controlname'=>$pColumn['stcotName'],
				'ExtendType'=>'External_Search',
				'URL'=>$this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/other/channel.php',
				'SPLIT0'=>$this->sysSPLIT5,
				'SPLIT1'=>$this->sysSPLIT2,
				'Columns'=>array(
					array('ID','编号','Label',100,),
					array('Name','名称','Text',330,),
					array('Count','数量','Text',40,),
					),
				);
		}
		$tmpParametersSTR=$tmpParameters['Type'].$this->sysSPLIT2.
			$tmpControl.$this->sysSPLIT2.
			$tmpParameters['ExtendType'].$this->sysSPLIT2.
			$tmpParameters['URL'];
		$tmpFramestyle='';
		$tmpControlParameterName=$tmpControl;
		$tmpColumnsName='';
		if($tmpParameters['Type']!='chooseDay'){
			$tmpFramestyle='style="width:552px;"';
		}
		
		$tmpParameters=explode($this->sysSPLIT2,$tmpParametersSTR);
		$tmpFramestyle='style="width:552px;"';
		$tmpControlParameterName='CONTROL';
		if($tmpParameters[0]=='chooseDay'){
			$pColumn['ShowValue']=$pColumn['Value'];
			$tmpFramestyle='';
			
		}
		if(count($tmpParameters)>2){
			$tmpControlParameterName=$tmpParameters[1];
		}
		
?>
<!-- #<?php echo ($tmpControl); ?> -->
<?php if ($pColumn['stcoctSingleLine']==0) { ?><tr id="<?php echo($tmpControl); ?>_RowBox" class="<?php echo ($pColumn['LineStyle']); ?>"><?php } ?>
<td id="<?php echo ($tmpControl); ?>_Label" class="PanelTitle"><?php echo ($pColumn['stcoctUiName']); ?>：</td>
<td id="<?php echo ($tmpControl); ?>PanelBox" class="PanelBox <?php if ($pColumn['stcoctSingleLine']==1) { ?>PanelMultiColumn<?php } ?>" <?php if ($pColumn['stcoctSingleLine']==0 && $pColumn['stcoctColspan']>1) { ?>colspan="<?php echo($pColumn['stcoctColspan']); ?>"<?php } ?>>
<!--S.<?php echo ($tmpControl); ?>-->
<!-- #chooseBox //chooseBox -->
<div id="<?php echo($tmpControl); ?>_ChooseBox" class="DHidden" <?php echo($tmpFramestyle); ?>>
	<iframe id="<?php echo($tmpControl); ?>_ContentBox_A" class="DHidden" scrolling="auto" frameborder="0" src="" <?php echo($tmpFramestyle); ?>></iframe>
	<div id="<?php echo($tmpControl); ?>_ContentBox_B" class="DHidden">&nbsp;</div>
	<div class="chooseBut"><a href="#Here" class="Link1 FGreen1" onclick="tmpTextChoose.Close('<?php echo($tmpControl); ?>');">关闭弹窗</a></div></div>
<input id="<?php echo($tmpControl); ?>_Type" name="<?php echo($tmpControl); ?>_Type" type="hidden" value="0" />
<!-- # -->
<input id="<?php echo($tmpControl); ?>Show" name="<?php echo($tmpControl); ?>Show" type="text" class="SControl1 ControlText"
onclick="tmpControl.onControlLight(this,'ControlText');<?php echo($pColumn['Parameter_JS_Onclick']); ?>"
onblur="tmpControl.onControlBlur(this,'ControlText');<?php echo($pColumn['Parameter_JS_Onblur']); ?>"
onfocus="tmpControl.chooseCall('<?php echo ($tmpParametersSTR); ?>',this);<?php echo($pColumn['Parameter_JS_Onfocus']); ?>"
onchange="<?php echo($pColumn['Parameter_JS_Onchange']); ?>"
onmouseover="<?php echo($pColumn['Parameter_JS_Onmouseover']); ?>"
onmouseout="<?php echo($pColumn['Parameter_JS_Onmouseout']); ?>"
value="<?php echo ($pColumn['ShowValue']); ?>" style="<?php echo ($pColumn['ControlStyle']); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter0" name="<?php echo($tmpControl); ?>_Patameter0" type="hidden" value="<?php echo ($tmpParameters[0]); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter1" name="<?php echo($tmpControl); ?>_Patameter1" type="hidden" value="<?php echo ($tmpParameters[1]); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter2" name="<?php echo($tmpControl); ?>_Patameter2" type="hidden" value="<?php echo ($tmpParameters[2]); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter3" name="<?php echo($tmpControl); ?>_Patameter3" type="hidden" value="<?php echo ($tmpParameters[3]); ?>" />
<input id="<?php echo($tmpControl); ?>_Index" name="<?php echo($tmpControl); ?>_Index" type="hidden" value="-1" />
<input id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" type="hidden" value="<?php echo ($pColumn['Value']); ?>" /><?php echo ($tmpIntroduct); ?>
<!-- #Hidden -->
<div id="<?php echo($tmpControl); ?>_BgHidden" onclick="tmpTextChoose.Close('<?php echo($tmpControl); ?>');" class="DHidden">&nbsp;</div>
<!-- #JSCRIPT -->
<script type="text/javascript">
var tmp<?php echo($tmpControl); ?>=new TextChoose();
tmp<?php echo($tmpControl); ?>.sControlName="<?php echo($tmpControl); ?>";

var tmpDay_<?php echo($tmpControlParameterName); ?>=new netsDay();
tmpDay_<?php echo($tmpControlParameterName); ?>.sControlName="<?php echo($tmpControlParameterName); ?>";
function ChooseDay_Open<?php echo($tmpControlParameterName); ?>_callback(){
	var tmpBox=document.getElementById(tmpChooseDay.sControlName+tmpChooseDay.sBox);
	var tmpURL=tmpChooseDay.sAjax_0.sURL;
	var tmpFlag=tmpChooseDay.sAjax_0.sFlag;
	var tmpContent=document.getElementById(tmpChooseDay.sControlName+tmpChooseDay.sContent);
	var tmpControl=document.getElementById(tmpChooseDay.sControlName);
	var tmpHttpRequest=tmpChooseDay.sAjax_0.sHttpRequests;
	//alert(sHttpRequest.responseText);
	if(tmpHttpRequest.readyState==4){
		//alert(sHttpRequest.responseText);
		var tmpData=getDataByFlag(tmpHttpRequest.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			tmpContent.className="";
			tmpContent.innerHTML=tmpData;
	    	var tmpDate=tmpCommon.formatDate(tmpControl.value);
	    	tmpDay_<?php echo($tmpControlParameterName); ?>.initial(tmpDate.getYear(),tmpDate.getMonth(),tmpDate.getDate(),tmpDate.getHours(),tmpDate.getMinutes(),tmpDate.getSeconds(),0);
	    	tmpFrames.showBlack_ById(tmpChooseDay.sControlName+"_BgHidden","BgHidden",0);
	    	tmpFrames.hiddenAllElement("Select",0);
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpFrames.showChoose(0,tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL));
	    	tmpFrames.showLoading(1);
	    }
		tmpBox.className="chooseBox";
		tmpBox.style.marginTop=tmpTextChoose.sFloatPosition+tmpCommon.sysPx;
	}else{
		tmpFrames.showLoading(0);
	}
}

</script>
<!--sendRequest--><!--E.<?php echo ($tmpControl); ?>--></td>
<td id="<?php echo ($tmpControl); ?>_ImgIntroduct" class="PanelImgIntroduct">
<?php if(strlen($pColumn['stcoctUiImgIntroduct'])>0 && $pColumn['stcoctUiImgIntroduct']!='&nbsp;'){ ?>
<a href="#Here"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_4.jpg" title="<?php echo($pColumn['stcoctUiImgIntroduct']); ?>" /></a>
<?php }else{ ?>&nbsp;<?php } ?></td><?php if ($pColumn['stcoctSingleLine']==0) { ?></tr><?php } ?>
<?php
	}
}
?>