<?php
class Normal_TextChooses_Checkbox extends netsControl {
	public function Normal_TextChooses_Checkbox(){
		$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>';
		}
		$tmpCode=new netsCode();
		$tmpDb=new netsDb($this->sConnString);
		$tmpDefaultValue=-1;
		$tmpDefaultText='未设置分类';
		
		$tmpParameter=explode($this->sysSPLIT13,$pColumn['Parameter']);
		if($tmpParameter[0]==0){
			$tmpValues=explode($this->sysSPLIT1,$tmpParameter[1]);
		}else{
			$tmpValues=explode($this->sysSPLIT1,$pColumn['Value']);
		}
		$Coun0=0;
		while(count($tmpParameter)>$Coun0){
			$tmpParameter[$Coun0]=str_replace($this->sysSPLIT4,'',$tmpParameter[$Coun0]);
			$tmpParameter[$Coun0]=str_replace($this->sysSPLIT10,'',$tmpParameter[$Coun0]);
			$Coun0++;
		}
		
		
?>
<!-- #<?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); ?>-->
<table class="TextChoosesCheckbox_Box" cellpadding="0" cellspacing="0"><tr>
<td class="TextChoosesCheckbox_M"><div class="TextChoosesCheckbox_IBox">
<div class="TextChoosesCheckbox_Title TextChoosesCheckbox_1"><a href="#Here" class="Link1 FBlue2">所属类别</a></div>
<!-- ### -->
<?php
$tmpValues=explode($this->sysSPLIT1,$pColumn['Value']);
$tmpParid=$tmpParameter[1];
$tmpSQL=$tmpParameter[7];

$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
$tmpSTR=str_replace('{Nets.ID}',$tmpParid,$tmpSTR);
$tmpData0=$tmpDb->Search($tmpSTR);
$Coun0=0;
foreach($tmpData0 as $Row0){ ?>
<div class="TextChoosesCheckbox_2">
<table class="TextChoosesCheckbox_7" cellpadding="0" cellspacing="0"><tr>
	<td class="TextChoosesCheckbox_8"><img src="<?php echo($this->sysFileConfig['sysCoreRoot']); ?>Ui/Common/Img/Common/icon_24.jpg" /></td>
	<td class="TextChoosesCheckbox_9"><a href="#Here" onclick="tmp<?php echo($tmpControl); ?>.sID=<?php echo($Row0[$tmpParameter[2].'ID']); ?>;tmp<?php echo($tmpControl); ?>.sKeyword='';tmp<?php echo($tmpControl); ?>.SearchCell();" class="Link1 FBlack2"><?php echo($Row0[$tmpParameter[2].'Name']); ?></a></td>
	<td class="TextChoosesCheckbox_10"><a href="#Here" onclick="tmp<?php echo($tmpControl); ?>.OpenChild(<?php echo($Row0[$tmpParameter[2].'ID']); ?>);"><img src="<?php echo($this->sysFileConfig['sysCoreRoot']); ?>Ui/Common/Img/Common/icon_30.jpg" /></a></td></tr></table>
<div id="<?php echo ($tmpControl); ?>_Rowbox_<?php echo($Row0[$tmpParameter[2].'ID']); ?>" class="DHidden"></div>
</div>
<?php $Coun0++; } ?>
</div></td><td id="<?php echo ($tmpControl); ?>_Cellbox" class="TextChoosesCheckbox_C">
<!-- ### -->
<ul class="TextChoosesCheckbox_Title">
<li class="TextChoosesCheckbox_4"><span class="FStrong">查询</span></li>

<li class="TextChoosesCheckbox_6"><a href="#Here"  onclick="tmp<?php echo($tmpControl); ?>.sKeyword=document.getElementById('<?php echo ($tmpControl); ?>_Keyword').value;tmp<?php echo($tmpControl); ?>.SearchCell();" class="Link1 FBlack2">查询</a></li>
<li class="TextChoosesCheckbox_5"><input id="<?php echo ($tmpControl); ?>_Keyword" name="<?php echo ($tmpControl); ?>_Keyword" value="请输入您要查询的内容..." type="text" /></li>
<li class="DClear"></li></ul>
<ul id="<?php echo ($tmpControl); ?>_Cells" class=""><?php
$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
$tmpSTR=str_replace('{Nets.ID}',$tmpParid,$tmpSTR);
$tmpData0=$tmpDb->Search($tmpSTR);
$Coun0=0;
foreach($tmpData0 as $Row0){ ?><li class="TextChoosesCheckbox_Cell"><div class="TextChoosesCheckbox_CellA"><input id="<?php echo ($tmpControl); ?>_Cell_<?php echo($Row0[$tmpParameter[2].'ID']); ?>" name="<?php echo ($tmpControl); ?>_Cell_<?php echo($Row0[$tmpParameter[2].'ID']); ?>" value="<?php echo($Row0[$tmpParameter[2].'ID']); ?>" type="checkbox" <?php if(in_array($Row0[$tmpParameter[2].'ID'],$tmpValues)){ echo('checked="checked"'); } ?> onclick="tmp<?php echo($tmpControl); ?>.OnChoose(this);" /></div><div class="TextChoosesCheckbox_CellB"><label for="<?php echo ($tmpControl); ?>_Cell_<?php echo($Row0[$tmpParameter[2].'ID']); ?>"><?php echo($Row0[$tmpParameter[2].'Name']); ?></label></div><div class="DClear"></div></li><?php $Coun0++; } ?><li class="DClear"></li></ul>
<div class="TextChoosesCheckbox_Button"></div>
</td></tr></table>
<input id="<?php echo ($tmpControl); ?>" name="<?php echo ($tmpControl); ?>" value="<?php echo($pColumn['Value']); ?>" type="text" />

<!-- ------ #SCRIPT ------ -->
<script type="text/javascript">
var tmp<?php echo ($tmpControl); ?>=new TextChooses_Checkbox();
tmp<?php echo ($tmpControl); ?>.sName="<?php echo ($tmpControl); ?>";
tmp<?php echo ($tmpControl); ?>.sPage="<?php echo ($tmpParameter[5]); ?>";

function <?php echo ($tmpControl); ?>_OpenChild_Callback(){
	var tmpOBJECT=tmp<?php echo ($tmpControl); ?>;
	var tmpURL=tmpOBJECT.sAjax_0.sURL;
	var tmpFlag=tmpOBJECT.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpOBJECT.sAjax_0.sPanel);
	var tmpHttpRequest=tmpOBJECT.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-->"){
	    	tmpPanel.innerHTML=tmpData;
	    	
	    }else{
	    	tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
		tmpPanel.innerHTML=tmpCommon.sysLoading_Ajax;
	}
}
function <?php echo ($tmpControl); ?>_SearchCell_Callback(){
	var tmpOBJECT=tmp<?php echo ($tmpControl); ?>;
	var tmpURL=tmpOBJECT.sAjax_0.sURL;
	var tmpFlag=tmpOBJECT.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpOBJECT.sAjax_0.sPanel);
	var tmpHttpRequest=tmpOBJECT.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-->"){
	    	tmpPanel.innerHTML=tmpData;
	    	tmpOBJECT.OnRChooseALL();
	    	
	    }else{
	    	tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
		tmpPanel.innerHTML=tmpCommon.sysLoading_Ajax;
	}
}



</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
	}
}
?>