<?php
/*********************************************************      
 程序说明：         
    功能说明：用户信息显示上部页面
    调用关系：调用: header.inc    
              被调用:        
    变量说明：
    作者：    
      
修改注释：      
NO.1      
姓名：          
时间：
修改说明：
*********************************************************/
require("../../inc/header.inc");
$dataTypeNo = $_REQUEST['dataTypeNo'];
$sysTypeNo=$_REQUEST['sysTypeNo'];
?>
<script LANGUAGE="JavaScript"> 
function  checkType(sel)
{
	if(sel.value=="MSISDN")
	{
		document.getElementById('sisid').disabled=true;
	}
	else
	{
		document.getElementById('sisid').disabled=false;
	}	
}

function selectSysId(sysTypeNo,dataTypeNo){
	var URL,selSysId;

	selSysId = document.actionForm.sysId.value;
	URL = "./subscriberListDown.php?sysId="+selSysId+"&sysTypeNo="+sysTypeNo+"&dataTypeNo="+dataTypeNo;
	//window.alert(URL);
	window.parent.main.location = URL;
}    

function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	temp += splitstring[i];
	return temp;
}

function checkSubmit(actionType,transValue){      
	var baseURL,URL,selSysId;
	//console.log("actionType"+<?php echo $sysTypeNo;?>);
	switch(actionType){
		case 3: //single add
			<?php
			switch($sysTypeNo){
				case '325':
					echo "baseURL = \"./vlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '330':
					echo "baseURL = \"./hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '340':
					echo "baseURL = \"./aucSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '360':
					echo "baseURL = \"./ppsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";					
					break;
				case '395':
					echo "baseURL = \"./rcmSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '370':
					echo "baseURL = \"./mnpSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '375':
					echo "baseURL = \"./oprSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '378':
					echo "baseURL = \"./ipalimSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '380':
					echo "baseURL = \"./eirSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '390':
					echo "selSysId = document.actionForm.sysId.value;";
					echo "baseURL = \"./vmsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
				?>
					baseURL = baseURL+'sysId='+selSysId+'&';
				<?php
					break;
				case '253':
					echo "baseURL = \"./sn-hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
			}
			?>
			break;
		case 6: //batch add
			<?php
			switch($sysTypeNo){
				case '330':
					echo "baseURL = \"./hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					break;
				case '360':
					echo "baseURL = \"./ppsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					break;
				case '395':
					echo "baseURL = \"./rcmSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					break;
				case '390':
					echo "selSysId = document.actionForm.sysId.value;";
					echo "baseURL = \"./vmsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&isBatchCreate=1&\"; \n";
				?>
					baseURL = baseURL+'sysId='+selSysId+'&';
				<?php
					break;
				case '253':
					echo "baseURL = \"./sn-hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
			}
			?>
			break;
		case 5: //upload
	<?php
			switch($sysTypeNo){
				case '325':
					echo "baseURL = \"./vlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '330':
					//echo "baseURL = \"./hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					echo "baseURL = \"./hlrGetAll.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '340':
					echo "baseURL = \"./aucSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '360':
					echo "baseURL = \"./ppsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '395':
					echo "baseURL = \"./rcmSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '370':
					echo "baseURL = \"./mnpSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '375':
					echo "baseURL = \"./oprSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;	
				case '378':
					echo "baseURL = \"./ipalimSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '380':
					echo "baseURL = \"./eirSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
				case '390':
					echo "selSysId = document.actionForm.sysId.value;";
					echo "baseURL = \"./vmsSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					//echo "baseURL = \"./subscriberConfig.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
				?>
					baseURL = baseURL+'sysId='+selSysId+'&';
				<?php
					break;
				case '253':
					echo "baseURL = \"./sn-hlrSubsConf.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&\"; \n";
					break;
			}
			?>
			break;
		case 4: //statistic
			<?php
			if($sysTypeNo==390)
				echo "baseURL = \"../pubSubsImport/subscriberImportIndex.php?sysId=$sysId&dataTypeNo=$dataTypeNo&\"; \n";
			else
				echo "baseURL = \"../pubSubsImport/subscriberImportIndex.php?sysId=$sysTypeNo"."_99_99&dataTypeNo=$dataTypeNo&\"; \n";
			?>
			break;
		default:
			alert("Unknown action!");
			return(false);
	}	
	//URL		= baseURL+transValue+'&sysId='+selSysId;
	//alert(baseURL);
	URL		= baseURL+transValue;
	window.parent.main.location = URL;      
}  
</script>

	<!--
	if (actionType == 5) {
		window.alert(URL);
		return;
	}
	-->

<base target="main">
<body topmargin=14 leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">


<form name="actionForm" method="POST" action="./subscriberListDown.php" >    
<?php
$canwrite_flag=checkWritePrivilege();
	switch($sysTypeNo){
		case '330':
			$titleName="$strTitleAccount > Subscriber > HLR";
			$helpId = "2.2.1.2";
			break;
		case '325':
			$titleName="$strTitleAccount > Subscriber > VLR";
			$helpId = "2.2.1.1";
			break;
		case '360':
			if($dataTypeNo == 0){
				$titleName="$strTitleAccount > Subscriber > PPS";
				$helpId = "2.2.1.3";
			}else{
				$titleName="$strTitleAccount > Recharge card";
				$helpId = "2.2.2";
			}
			break;
		case '395':
			$titleName="$strTitleAccount > Recharge card";
			$helpId = "2.2.2";
			break;
		case '370':
			$titleName="$strTitleAccount > Subscriber > MNP";
			$helpId = "2.2.1.7";
			break;
		case '375':
			$titleName="$strTitleAccount > Subscriber > OPPS";
			$helpId = "2.2.1.8";
			break;	
		case '378':
			$titleName="$strTitleAccount > Subscriber > iPALIM";
			$helpId = "2.2.1.9";
			break;
		case '340':
			$titleName="$strTitleAccount > Subscriber > AUC";
			$helpId = "2.2.1.4";
			break;
		case '380':
			$titleName="$strTitleAccount > Subscriber > EIR";
			$helpId = "2.2.1.5";
			break;
		case '390':
			$titleName="$strTitleAccount > Subscriber > $strVMSOrVSS";
			$helpId = "2.2.1.6";
			break;
		default:
			$titleName="Unknown sysTypeNo";
			exit(1);
	}

adjust_head_frame("up");
adjust_title_head_frame("up");
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"60%\">";
echo "$titleName";
echo "</td>";
echo "<td width=\"40%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";


switch($sysTypeNo){
case '330':
	echo "$tabelHead";
	echo "<select size=\"1\" name=\"selKeyFieldName\" >";
	echo "<option value=\"inter_msisdn\">MSISDN</option>";
	echo "<option value=\"imsi\" selected>IMSI</option>";
	echo "</select>";
	break;
case '325':
	echo "$tabelHead";
	echo "<select size=\"1\" name=\"selKeyFieldName\" onChange=\"javascript:checkType(this);\">";
	echo "<option value=\"MSISDN\">MSISDN</option>";
	echo "<option value=\"IMSI\" selected>IMSI</option>";
	echo "</select>";
	break;
case '360':
	if($dataTypeNo == 0){
		echo "$tabelHead";
		echo "MSISDN";
		echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
	}else{
		echo "$tabelHead";
		echo "Card no.";
		echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"card_no\">"; 
	}
	break;
case '395':
	echo "$tabelHead";
	echo "Card no.";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"card_no\">"; 
	break;
case '370':
	echo "$tabelHead";
	echo "MSISDN";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
	break;
case '375':
	echo "$tabelHead";
	if(!isset($opps_type_sel))
		$opps_type_sel=0;
	$oppsType=array(0=>"All",1=>"OPR",2=>"IMDX");
	echo "User Type&nbsp;";
	echo "<select name=\"opps_type_sel\">";
	for($i=0;$i<sizeof($oppsType);$i++)
	{
		if($i == $opps_type_sel)
			echo "<option value=$i selected>{$oppsType[$i]}</option>";
		else
			echo "<option value=$i>{$oppsType[$i]}</option>";
	}
	echo "</select>&nbsp;";
	//echo "MSISDN";
	//echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
	
	echo "&nbsp;&nbsp;<select size=\"1\" name=\"selKeyFieldName\" >";
	echo "<option value=\"msisdn\">MSISDN</option>";
	echo "<option value=\"imsi\" selected>IMSI</option>";
	echo "<option value=\"imei\" selected>IMEI</option>";
	echo "</select>&nbsp;";
	
	break;	
case '378':
	echo "$tabelHead";
	echo "IMSI";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"imsi\">";
	break;
case '340':
	echo "$tabelHead";
	echo "IMSI";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"key_imsi\">"; 
	break;
case '380':
	echo "$tabelHead";
	echo "IMEI";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"imei\">"; 
	break;
case '390':
	echo "$tabelHead";
	echo "MSISDN";
	echo "<input type=\"hidden\" name=\"selKeyFieldName\" value=\"msisdn\">"; 
	break;
case '253':
	echo "$tabelHead";
	echo "<select size=\"1\" name=\"selKeyFieldName\" >";
	echo "<option value=\"msisdn\" selected>MSISDN</option>";
	echo "<option value=\"imsi\">IMSI</option>";
	echo "</select> ";
	break;
default:
	echo "Unknown sysTypeNo";
	exit(1);
}

?>
<input type="text" name="selKeyValue" size="20" onBlur="this.value=ignoreSpaces(this.value);" class="text">&nbsp;&nbsp;


<nobr>
		<span id="divid" onClick="javascript:document.actionForm.submit();" style="cursor:hand">
			<?php 
				echo "<input type=\"submit\" value=\"Search in OMC\" class=\"button\" name=\"searchInOmc\">";
				echo "&nbsp;";
	    		//echo "<IMG align=absBottom border=0 src=\"../../images/search.gif\" >&nbsp;$strSearch&nbsp;";
				if( ('330'==$sysTypeNo) || ('360'==$sysTypeNo) || ('395'==$sysTypeNo)){ 
					echo "<input type=\"submit\" value=\"Overview\" class=\"button\" name=\"overview\">";
				}
				switch ($sysTypeNo) {
				case '325':
					echo "<input type=\"submit\" id=\"sisid\" value=\"Search in VLR\" class=\"button\" name=\"searchInServer\">";
					//echo "<input type=button onClick=\"javascript:checkType();\" class=\"button\" value=\"Search in VLR\" name=\"searchInServer\">";
					break;
				/*
				case '330':
					echo "<input type=\"submit\" value=\"Search in HLR\" class=\"button\" name=\"searchInServer\">";
					break;
				case '360':
					echo "<input type=\"submit\" value=\"Search in PPS\" class=\"button\" name=\"searchInServer\">";
					break;
				*/
				default:
					break;
				}
				if($sysTypeNo==390){
					echo "Select System:";
					echo "<select name=\"sysId\" size=\"1\" onChange=\"javascript:selectSysId($sysTypeNo,$dataTypeNo)\">";
					echo "<option value=\"{$sysTypeNo}_0_0\">{$strVMSOrVSS}_0_0</option>";
					echo "<option value=\"{$sysTypeNo}_1_0\">{$strVMSOrVSS}_1_0</option>";
					echo "<option value=\"{$sysTypeNo}_2_0\">{$strVMSOrVSS}_2_0</option>";
					echo "<option value=\"{$sysTypeNo}_3_0\">{$strVMSOrVSS}_3_0</option>";
					echo "<option value=\"{$sysTypeNo}_4_0\">{$strVMSOrVSS}_4_0</option>";
					echo "<option value=\"{$sysTypeNo}_5_0\">{$strVMSOrVSS}_5_0</option>";
					echo "<option value=\"{$sysTypeNo}_6_0\">{$strVMSOrVSS}_6_0</option>";
					echo "<option value=\"{$sysTypeNo}_7_0\">{$strVMSOrVSS}_7_0</option>";
					echo "<option value=\"{$sysTypeNo}_8_0\">{$strVMSOrVSS}_8_0</option>";
					echo "<option value=\"{$sysTypeNo}_9_0\">{$strVMSOrVSS}_9_0</option>";		
					echo "</select>"; 
				}
				?>
		</div>


<?php 
echo "</td>";
echo "<td align=\"right\">";


if($sysTypeNo==390)
	$strGetAll='Get';
?>
<span style="cursor:hand" onClick=checkSubmit(5,"isLoadIndex=1")>
		<nobr>
			<IMG align=absBottom border=0 src="../../images/reload.gif">&nbsp;<?php echo "$strGetAll";?>&nbsp;&nbsp;
		</nobr>
		</span>


<?php
if ($sysTypeNo != 325 && $sysTypeNo != 340 && $dataTypeNo != 1){

		if($canwrite_flag)
	  	echo "<span style=\"cursor:hand\" onClick=checkSubmit(3,\"isTryCreate=1\")><nobr>";
	  else
	  	echo "<span disabled><nobr>";	
		echo "<IMG align=absBottom border=0 src=\"../../images/add.gif\">Add single";
		echo "&nbsp;&nbsp;</nobr></span>";
	}

	if (($sysTypeNo == 330 || $sysTypeNo == 360 || $sysTypeNo == 390) &&$dataTypeNo == 0){
	  if($canwrite_flag)
	  	echo "<span style=\"cursor:hand\" onClick=checkSubmit(6,\"isTryCreate=1\")><nobr>";
	  else
	  	echo "<span disabled><nobr>";
		echo "<IMG align=absBottom border=0 src=\"../../images/batchAdd.gif\">Add batch";
		echo "&nbsp;&nbsp;</nobr></span>";
	}


	if ($sysTypeNo != 325 && $sysTypeNo != 340 && $sysTypeNo != 390){
		if($canwrite_flag)
			echo "<span style=\"cursor:hand\" onClick=checkSubmit(4,\"isTryImport=1\")><nobr>";
		else
			echo "<span disabled><nobr>";
		echo "<IMG align=absBottom border=0 src=\"../../images/import_1.gif\">$strImport";
		echo "</nobr></span>";
	}

echo "</td>";
echo "</tr>";
echo "</table>";


//$tabelHead="<table border=\"0\" width=\"100%\"  cellpadding=\"1\" cellspacing=\"0\"  bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\"><tr valign=\"bottom\"><td><nobr> ";   


echo "<input Name=\"sysTypeNo\" type=\"hidden\" value=\"$sysTypeNo\">";
echo "<input Name=\"dataTypeNo\" type=\"hidden\" value=\"$dataTypeNo\">";
adjust_title_tail_frame("up");
adjust_content_head_frame("up");
adjust_content_tail_frame("up");
?>
</form>
</body>
</html>
