<?php
class Normal_Into extends netsControl {
	public function Normal_Into(){
		$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>';
		}
		//-- ------ #Config ------ --
		$tmpDateSPLIT0='-';
		$tmpExText_AA=".NETSAA";
		$tmpExText_AB=".NETSAB";
		$tmpExText_BA=".NETSBA";
		$tmpExText_BB=".NETSBB";
		$tmpCode=new netsCode();
		$tmpDb=new netsDb($this->sConnString);
		$tmpParameter=explode($this->sysSPLIT13,$pColumn['Parameter']);
		$tmpColumn=$pColumn['Value'];
		$tmpColumn=str_replace($tmpExText_AA,'',$tmpColumn);
		$tmpColumn=str_replace($tmpExText_AB,'',$tmpColumn);
		$tmpColumn=str_replace($tmpExText_BA,'',$tmpColumn);
		$tmpColumn=str_replace($tmpExText_BB,'',$tmpColumn);
		$tmpParameter[0]=str_replace($tmpExText_AA,'',$tmpParameter[0]);
		$tmpParameter[0]=str_replace($tmpExText_AB,'',$tmpParameter[0]);
		$tmpParameter[0]=str_replace($tmpExText_BA,'',$tmpParameter[0]);
		$tmpParameter[0]=str_replace($tmpExText_BB,'',$tmpParameter[0]);

		$tmpYearStart=date('Y')-90+1;
		$tmpYearCount=90;
		$tmpYear=date('Y');
		$tmpMonthStart=1;
		$tmpMonthCount=12;
		$tmpMonth=9;
		
		$tmpStartid=2;
		$tmpChoose_URL='URL';
		$tmpChoose_SQL='SQL';
		$tmpChoose_ColumnHead='ID';
		$tmpChoose_ColumnHeadCont='Name';
		
		$tmpData_URL='URL';
		$tmpData_SQL='SQL';
		$tmpChoose_ColumnHead='ID';
		$tmpChoose_ColumnHeadCont='Name';
		
		$tmpColumns=array(
			array('所有省',-1),
			array('所有市区',-1),
			);
		
		$tmpTexts=array(
			'请选择学校',-1,
			'请选择院系',-1,
			);
		
		$tmpDates=array(
			array('年',$tmpYear,),
			array('月',$tmpMonth,),
			);
		//-- ------ #Parameter ------ --
		//print_r($tmpParameter);
		if(count($tmpParameter)==11){
			$tmpColumns=array();
			$tmpAR0=explode($this->sysSPLIT3,$tmpParameter[0]);
			if(count($tmpAR0)==3){
				//-- #Zone --
				$tmpColumns=array();
				$tmpAR1=explode($this->sysSPLIT2,$tmpAR0[0]);
				foreach($tmpAR1 as $Row1){
					$tmpAR2=explode($this->sysSPLIT1,$Row1);
					if(count($tmpAR2)==2){
						$tmpColumns[]=$tmpAR2;
					}
				}
				//-- #Name --
				$tmpTexts=array();
				$tmpAR1=explode($this->sysSPLIT2,$tmpAR0[1]);
				foreach($tmpAR1 as $Row1){
					$tmpAR2=explode($this->sysSPLIT1,$Row1);
					if(count($tmpAR2)==2){
						$tmpTexts[]=$tmpAR2;
					}
				}
				//-- #Date --
				$tmpAR1=explode($this->sysSPLIT2,$tmpAR0[2]);
				$tmpYear=$tmpAR1[0];
				$tmpMonth=$tmpAR1[1];
				$tmpDates[0][1]=$tmpAR1[0];
				$tmpDates[1][1]=$tmpAR1[1];
			}

			$tmpStartid=$tmpParameter[1];
			$tmpChoose_URL=$tmpParameter[2];
			$tmpChoose_SQL=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpParameter[3]);
			$tmpChoose_ColumnHead=$tmpParameter[4];
			$tmpChoose_ColumnHeadCont=$tmpParameter[5];

			$tmpData_URL=$tmpParameter[6];
			$tmpData_SQL=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpParameter[7]);
			$tmpChoose_ColumnHead=$tmpParameter[8];
			$tmpChoose_ColumnHeadCont=$tmpParameter[9];
			
		}
		//-- ------ #Value ------ --
		$tmpValues=explode($this->sysSPLIT3,$tmpColumn);
		if(count($tmpValues)==3){
			//-- #Right --
			//#Zone
			$tmpColumns=array();
			$tmpAR0=explode($this->sysSPLIT2,$tmpValues[0]);
			foreach($tmpAR0 as $Row0){
				$tmpAR1=explode($this->sysSPLIT1,$Row0);
				$tmpColumns[]=$tmpAR1;
			}
			//#Text
			$tmpTexts=array();
			$tmpAR0=explode($this->sysSPLIT2,$tmpValues[1]);
			foreach($tmpAR0 as $Row0){
				$tmpAR1=explode($this->sysSPLIT1,$Row0);
				$tmpTexts[]=$tmpAR1;
			}
			//#Date
			$tmpAR0=explode($this->sysSPLIT2,$tmpValues[2]);
			if(count($tmpAR0)==2){
				$tmpYear=$tmpAR0[0];
				$tmpMonth=$tmpAR0[1];
				$tmpDates[0][1]=$tmpAR0[0];
				$tmpDates[1][1]=$tmpAR0[1];
			}
		}else{
			//-- #Error --
			//#Name
			$tmpSTR='';
			$Coun0=0;
			foreach($tmpColumns as $Row0){
				if($Coun0!=0){
					$tmpSTR.=$this->sysSPLIT2;
				}
				$tmpSTR.=$Row0[0].$this->sysSPLIT1.$Row0[1].$tmpExText_AA;
				$Coun0++;
			}
			$pColumn['Value']=$tmpSTR.$tmpExText_AB.$this->sysSPLIT3;
			//#Text
			$tmpSTR='';
			$Coun0=0;
			foreach($tmpTexts as $Row0){
				if($Coun0!=0){
					$tmpSTR.=$this->sysSPLIT2;
				}
				$tmpSTR.=$Row0[0].$this->sysSPLIT1.$Row0[1].$tmpExText_AB;
				$Coun0++;
			}
			$pColumn['Value'].=$tmpSTR.$tmpExText_BB.$this->sysSPLIT3;
			//#Date
			$pColumn['Value'].=$tmpYear.$this->sysSPLIT2.$tmpMonth;
		}
		//-- ------ #Show value ------ --
		$Coun0=0;
		$tmpSTR='';
		foreach($tmpTexts as $Row0){
			if($Coun0!=0){
				$tmpSTR.=$this->sysSPLIT1;
			}
			$tmpSTR.=$Row0[0];
			$Coun0++;
		}
		$tmpName=$tmpSTR;
		$tmpDate=$tmpYear.$tmpDateSPLIT0.$tmpMonth;


?>
<!-- #<?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="" cellpadding="0" cellspacing="0"><tr><td class="">
<!-- ### -->
<input id="<?php echo($tmpControl); ?>_Name_Startid" name="<?php echo($tmpControl); ?>_Name_Startid" value="<?php echo($tmpStartid); ?>" type="hidden" />
<!-- ### -->
<div id="<?php echo($tmpControl); ?>_Name_Box" class="DHidden">
<!-- #Head -->
<ul class="Into_Title">
<?php
$Coun0=0;
foreach($tmpColumns as $Row0){ ?>
<li id="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>" class="Into_Title_Cell">
	<a id="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Link" name="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Link" href="#Here" onclick="tmpInto.OnTab_Name('<?php echo($tmpControl); ?>',<?php echo($Coun0); ?>);" class="Link1 FBlack3"><?php echo($Row0[0]); ?></a>
	<input id="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Text" name="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Text" value="<?php echo($Row0[0]); ?>" type="hidden" />
	<input id="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Value" name="<?php echo($tmpControl); ?>_Name_Tab_<?php echo($Coun0); ?>_Value" value="<?php echo($Row0[1]); ?>" type="hidden" /></li>
<?php $Coun0++; } ?>

<li class="Into_Title_Button"><a href="#Here" onclick="tmpInto.OnSearch_Condition('<?php echo($tmpControl); ?>');" class="Link1 FBlack2">搜索</a></li>
<li class="Into_Title_Input"><input id="<?php echo($tmpControl); ?>_Name_Search" name="<?php echo($tmpControl); ?>_Name_Search" 
	value="" type="text" class="Into_Title_Input_A"
	onclick="tmpInto.OnSearchFocus_Name('<?php echo($tmpControl); ?>',0);"
	onblur="tmpInto.OnSearchFocus_Name('<?php echo($tmpControl); ?>',1);" /></li>
<li class="DClear"></li></ul>
<input id="<?php echo($tmpControl); ?>_Name_Tab_Index" name="<?php echo($tmpControl); ?>_Name_Tab_Index" value="0" type="hidden" />
<!-- #Choose -->
<ul id="<?php echo($tmpControl); ?>_Name_Choose" class="DHidden">

<li class="Into_Data_Normal Into_Data_5"><a href="#Here" onclick="tmpInto.OnChooseZone_Name('<?php echo($tmpControl); ?>','1000','2',0);" class="Link1 FBlack2">2010</a></li>

<li class="DClear"></li></ul>
<!-- #Data -->
<?php
$Coun0=0;
foreach($tmpTexts as $Row0){ ?>
<ul class="Into_Data_Title">
	<li class="Into_Data_Title_0">您已选择了：</li>
	<li class="Into_Data_Title_1"><a id="<?php echo($tmpControl); ?>_Name_Child_<?php echo($Coun0); ?>_Label" href="#Here" class="Link1 FBlack1" onclick="tmpInto.OnChildBox_Show('<?php echo($tmpControl); ?>','<?php echo($Coun0); ?>');"><?php echo($Row0[0]); ?></a></li>
	<li class="Into_Data_Title_2"><a id="<?php echo($tmpControl); ?>_Name_Child_<?php echo($Coun0); ?>_Button" href="#Here" class="Link1 FBlack1" onclick="tmpInto.OnChildBox_Show('<?php echo($tmpControl); ?>','<?php echo($Coun0); ?>');">收起<<</a></li>
	<li class="DClear"></li></ul>
<ul id="<?php echo($tmpControl); ?>_Name_Child_<?php echo($Coun0); ?>" class="Into_Choose">
<?php
if(true){
	$tmpSTR=str_replace('{Nets.Parid}','',$tmpData_SQL);
}else{
	$tmpSTR=str_replace('{Nets.Parid}',$tmpText[1],$tmpData_SQL);
}
$tmpData1=$tmpDb->Search($tmpSTR);
$Coun1=0;
foreach($tmpData1 as $Row1){ ?>
<li id="<?php echo($tmpControl); ?>_Date_Cell_<?php echo($Coun1); ?>" class="Into_Data_Normal Into_Data_3"><a href="#Here" onclick="tmpInto.OnChoose_Name('<?php echo($tmpControl); ?>','<?php echo($Row1[$tmpChoose_ColumnHead.'Name']); ?>','<?php echo($Row1[$tmpChoose_ColumnHead.'ID']); ?>',<?php echo($Coun0); ?>);" class="Link1 FBlack2"><?php echo($Row1[$tmpChoose_ColumnHead.'Name']); ?></a></li>
<?php $Coun1++; } ?>
<li class="Into_Data_4"><a href="#Here" class="Link1">更多>></a></li>
</ul>
<input id="<?php echo($tmpControl); ?>_Name_Text_<?php echo($Coun0); ?>" name="<?php echo($tmpControl); ?>_Name_Text_<?php echo($Coun0); ?>" value="<?php echo($Row0[0]); ?>" type="hidden" />
<input id="<?php echo($tmpControl); ?>_Name_Value_<?php echo($Coun0); ?>" name="<?php echo($tmpControl); ?>_Name_Value_<?php echo($Coun0); ?>" value="<?php echo($Row0[1]); ?>" type="hidden" />

<?php $Coun0++; } ?>

<!-- #Close -->
<ul class="Into_Close">
<li class="Into_Close_Cell_1"><a href="#Here" onclick="tmpInto.CloseName('<?php echo($tmpControl); ?>');" class="Link1 FGreen1">关闭窗口</a></li>
<li class="DClear"></li></ul>
</div>
<!-- #CONTROL -->
<input id="<?php echo($tmpControl); ?>_Name" name="<?php echo($tmpControl); ?>_Name" type="text" class="SControl1 ControlText Into_Text"
onclick="tmpControl.onControlLight(this,'ControlText Into_Text');tmpInto.ShowName('<?php echo($tmpControl); ?>');<?php echo($pColumn['Parameter_JS_Onclick']); ?>"
onblur="tmpControl.onControlBlur(this,'ControlText Into_Text');<?php echo($pColumn['Parameter_JS_Onblur']); ?>"
onfocus="<?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 ($tmpName); ?>" style="<?php echo ($pColumn['ControlStyle']); ?>" />

</td><td class="">&nbsp;&nbsp;</td><td class="">
<!-- ### -->
<div id="<?php echo($tmpControl); ?>_Date_Box" class="DHidden">
<!-- #Year -->
<ul class="Into_Choose"><li class="Into_Data_0">年份：</li>
<?php
$Coun0=0;
while($tmpYearCount>$Coun0){
	$tmpINT=$tmpYearStart+$Coun0;
	$tmpStyle='Into_Data_Normal';
	if($tmpINT==$tmpYear){
		$tmpStyle='Into_Data_Choosed';
	} ?>
<li id="<?php echo($tmpControl); ?>_Date_ChooseYear_<?php echo($Coun0); ?>" class="<?php echo($tmpStyle); ?> Into_Data_1"><a href="#Here" onclick="tmpInto.OnChoosed_Date_Year('<?php echo($tmpControl); ?>',<?php echo($tmpINT); ?>);" class="Link1 FBlack2"><?php echo($tmpINT); ?></a></li>
<?php $Coun0++; } ?>

<li class="DClear"></li></ul>
<input id="<?php echo($tmpControl); ?>_Date_Year" name="<?php echo($tmpControl); ?>_Date_Year" value="<?php echo($tmpYear); ?>" type="hidden" />
<!-- #Month -->
<ul class="Into_Data"><li class="Into_Data_0">月份：</li>
<?php
$Coun0=0;
while($tmpMonthCount>$Coun0){
	$tmpINT=$tmpMonthStart+$Coun0;
	$tmpStyle='Into_Data_Normal';
	if($tmpINT==$tmpMonth){
		$tmpStyle='Into_Data_Choosed';
	} ?>
<li id="<?php echo($tmpControl); ?>_Date_ChooseMonth_<?php echo($Coun0); ?>" class="<?php echo($tmpStyle); ?> Into_Data_2"><a href="#Here" onclick="tmpInto.OnChoosed_Date_Month('<?php echo($tmpControl); ?>',<?php echo($tmpINT); ?>);" class="Link1 FBlack2"><?php echo($tmpINT); ?></a></li>
<?php $Coun0++; } ?>

<li class="DClear"></li></ul>
<input id="<?php echo($tmpControl); ?>_Date_Month" name="<?php echo($tmpControl); ?>_Date_Month" value="<?php echo($tmpMonth); ?>" type="hidden" />
<!-- #Close -->
<ul class="Into_Close">
<li class="Into_Close_Cell_1"><a href="#Here" onclick="tmpInto.CloseDate('<?php echo($tmpControl); ?>');" class="Link1 FGreen1">关闭窗口</a></li>
<li class="DClear"></li></ul>
</div>
<!-- #CONTROL -->
<input id="<?php echo($tmpControl); ?>_Date" name="<?php echo($tmpControl); ?>_Date" type="text" class="SControl1 ControlText Into_Date"
onclick="tmpControl.onControlLight(this,'Into_Date');tmpInto.ShowDate('<?php echo($tmpControl); ?>');<?php echo($pColumn['Parameter_JS_Onclick']); ?>"
onblur="tmpControl.onControlBlur(this,'Into_Date');<?php echo($pColumn['Parameter_JS_Onblur']); ?>"
onfocus="<?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 ($tmpDate); ?>" style="<?php echo ($pColumn['ControlStyle']); ?>" />

</td></tr></table>
<input id="<?php echo($tmpControl); ?>" name="<?php echo($tmpControl); ?>" type="hidden" value="<?php echo ($pColumn['Value']); ?>"
style="width:400px;" />
<?php echo ($tmpIntroduct); ?>
<!-- ------ #SCRIPT ------ -->
<script type="text/javascript">
tmpInto.sName_TabCount=<?php echo(count($tmpColumns)); ?>;
tmpInto.sName_ChildCount=<?php echo(count($tmpTexts)); ?>;

tmpInto.sDate_YearStart=<?php echo($tmpYearStart); ?>;
tmpInto.sDate_YearCount=<?php echo($tmpYearCount); ?>;
tmpInto.sDate_MonthStart=<?php echo($tmpMonthStart); ?>;
tmpInto.sDate_MonthCount=<?php echo($tmpMonthCount); ?>;
tmpInto.sDate_DefaultYear=<?php echo($tmpYear); ?>;
tmpInto.sDate_DefaultMonth=<?php echo($tmpMonth); ?>;

tmpInto.sURL_Name="<?php echo($tmpChoose_URL); ?>";
tmpInto.sURL_Data="<?php echo($tmpData_URL); ?>";



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