<?php
class Normal_TextChooses extends netsControl {
	public function Normal_TextChooses(){
		$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;"';
		}
		
		//$pColumn['Value']='1;V13电容器;5;|||2;40系列数字集成电路 ;3;|||3;74系列数字集成电路;2;|||4;微控制器（单片机）及外围电路;12;|||5;V13电容器;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); ?>-->
<!-- #List sort -->
<table id="<?php echo($tmpControl); ?>List" class="TextChooses_1" cellpadding="0" cellspacing="1"><tr class="TextChooses_2">
<!-- #Sort button -->
<?php
$Coun0=0;
foreach($tmpParameters['Columns'] as $parameterColumn){ if($Coun0==0){ ?>
<td class="ListTitle1"><a href="#Here" class="Link1 FNowrap"><?php echo($parameterColumn[0]); ?></a></td>
<?php }else{ ?>
<td class="TextChooses_Title0" style="width:<?php echo($parameterColumn[3]); ?>px;"><a href="#Here" class="Link1 FNowrap"><?php echo($parameterColumn[1]); ?></a></td>
<?php } $tmpColumnsName.=$parameterColumn[0].$this->sysSPLIT1; $Coun0++; } ?>
<td class="TextChooses_Title_Normal"><input id="<?php echo($tmpControl); ?>_ChooseAll" name="<?php echo($tmpControl); ?>_CheckedAll" type="checkbox" class="SControl1 ControlCheckbox" title="全选" onclick="tmp<?php echo($tmpControl); ?>.onCheckedALL(<?php echo(count($tmpParameters['Columns'])); ?>);" /></td>
<td class="TextChooses_Title_Normal">操作</td>
</tr>
<!-- #Template -->
<tr class="DHidden">
<?php
$Coun1=0;
foreach($tmpParameters['Columns'] as $parameterColumn){ if($Coun1==0){ ?>
<td class="ListCellID"><span>{Nets.ID}</span><input type="hidden" value="{Nets.Style}" /></td>
<?php }else if($Coun1==1){ ?>
<td class="ListCellTitle"><input onclick="tmp<?php echo($tmpControl); ?>.Open_Byrow(this);" onchange="tmp<?php echo($tmpControl); ?>.getChooseValue('<?php echo($tmpControl); ?>');"
	value="{Nets.Text}" style="width:<?php echo($parameterColumn[3]); ?>px;" type="text" readonly /></td>
<?php }else{ ?>
<td class="ListCellTitle"><input onchange="tmp<?php echo($tmpControl); ?>.getChooseValue('<?php echo($tmpControl); ?>');"
	value="1" style="width:<?php echo($parameterColumn[3]); ?>px;" type="text" /></td>
<?php } $Coun1++; } ?>
<td class="ListCellCheck"><input type="checkbox" class="SControl1 ControlCheckbox" onclick="tmp<?php echo($tmpControl); ?>.onRowChecked(this);" /></td>
<td class="ListCellOption"><a href="#Here" onclick="tmp<?php echo($tmpControl); ?>.Delete(this);"><img title="删除此信息" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_19.jpg" /></a></td>
</tr>
<!-- #List -->
<?php
$Coun0=0;
$tmpAR0=explode($tmpParameters['SPLIT0'],$pColumn['Value']);
foreach($tmpAR0 as $Row0){
$tmpAR1=explode($tmpParameters['SPLIT1'],$Row0);
if((count($tmpAR1)-1)==count($tmpParameters['Columns'])){
	$tmpLineStyle='ListCell';
	$tmpINT=$Coun0+1;
	if($tmpINT%2==0){
		$tmpLineStyle='ListCell0';
	}
?>
<tr class="<?php echo($tmpLineStyle); ?>" onmouseover="tmp<?php echo($tmpControl); ?>.onRowMouseover(this);" onmouseout="tmp<?php echo($tmpControl); ?>.onRowMouseout(this,'<?php echo($tmpLineStyle); ?>');">
<?php
$Coun1=0;
foreach($tmpParameters['Columns'] as $parameterColumn){ if($Coun1==0){ ?>
<td class="ListCellID"><span><?php echo($tmpAR1[$Coun1]); ?></span><input type="hidden" value="<?php echo($tmpLineStyle); ?>" /></td>
<?php }else if($Coun1==1){ ?>
<td class="ListCellTitle"><input onclick="tmp<?php echo($tmpControl); ?>.Open_Byrow(this);" onchange="tmp<?php echo($tmpControl); ?>.getChooseValue('<?php echo($tmpControl); ?>');"
	value="<?php echo($tmpAR1[$Coun1]); ?>" style="width:<?php echo($parameterColumn[3]); ?>px;" type="text" readonly /></td>
<?php }else{ ?>
<td class="ListCellTitle"><input onchange="tmp<?php echo($tmpControl); ?>.getChooseValue('<?php echo($tmpControl); ?>');"
	value="<?php echo($tmpAR1[$Coun1]); ?>" style="width:<?php echo($parameterColumn[3]); ?>px;" type="text" /></td>
<?php } $Coun1++; } ?>
<td class="ListCellCheck"><input type="checkbox" class="SControl1 ControlCheckbox" onclick="tmp<?php echo($tmpControl); ?>.onRowChecked(this);" /></td>
<td class="ListCellOption"><a href="#Here" onclick="tmp<?php echo($tmpControl); ?>.Delete(this);"><img title="删除此信息" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_19.jpg" /></a></td></tr>
<?php $Coun0++; } } ?>
</table>
<!-- #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="1" />
<!-- #Button -->
<ul class="TextChooses_11">
<li class="TextChooses_12"><a href="#Here" onclick="tmpControl.chooseCall('<?php echo ($tmpParametersSTR); ?>',this);<?php echo($pColumn['Parameter_JS_Onclick']); ?>" class="Link1 FBlue3">选取数据</a></li>
<li class="TextChooses_12"><a href="#Here" onclick="tmp<?php echo($tmpControl); ?>.DeleteChoose(<?php echo(count($tmpParameters['Columns'])); ?>);" class="Link1 FBlue3">移除所选</a></li>
<li class="DClear"></li></ul>
<input id="<?php echo($tmpControl); ?>_Patameter0" name="<?php echo($tmpControl); ?>_Patameter0" type="hidden" value="<?php echo ($tmpParameters['Type']); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter1" name="<?php echo($tmpControl); ?>_Patameter1" type="hidden" value="<?php echo ($tmpControl); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter2" name="<?php echo($tmpControl); ?>_Patameter2" type="hidden" value="<?php echo ($tmpParameters['ExtendType']); ?>" />
<input id="<?php echo($tmpControl); ?>_Patameter3" name="<?php echo($tmpControl); ?>_Patameter3" type="hidden" value="<?php echo ($tmpParameters['URL']); ?>" />
<input id="<?php echo($tmpControl); ?>_Index" name="<?php echo($tmpControl); ?>_Index" type="hidden" value="-1" />
<input id="<?php echo($tmpControl); ?>_Columns" name="<?php echo($tmpControl); ?>_Columns" type="hidden" value="<?php echo ($tmpColumnsName); ?>" />
<input id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" type="hidden" value="<?php echo ($pColumn['Value']); ?>" />
<!-- #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
	}
}
?>